理想的我的程序的运行方式了,是就是在系统启动的后第一个程序启动,不进入系统自己的图形界面,打个比方,就是Windows下的explorer.exe程序,所以,我的程序必须的全屏显示,这里实现全屏的方式有很多,最简单一种,就是直接调用Qt提供的FullScreen
Window { visible: true visibility:Window.FullScreen // Show FullScreen title: qsTr("SmartHome") MouseArea { anchors.fill:parent onClicked: { Qt.quit(); } } }
另一种方式就是想将系统的标题栏去掉,完了获取获取屏幕分辨率
Window { visible: true width:Screen.desktopAvailableWidth height:Screen.desktopAvailableHeight // visibility:Window.FullScreen // Show FullScreen title: qsTr("SmartHome") MouseArea { anchors.fill:parent onClicked: { console.log(Screen.desktopAvailableWidth) console.log(Screen.desktopAvailableHeight) Qt.quit(); } } }
这是获取屏幕长和宽的样子,所以,在种类,程序时没有算下面的和上面的任务栏,
所以,如果系统函数可以使用,我们将决定使用系统函数,如果将来,系统函数不可用了,在想办法使用这种获取屏幕分辨率的方式