qml实现全屏

qml实现全屏

 

import QtQuick 2.12
import QtQuick.Window 2.12

Window {
    visible: true
    y:10
    width: fullScreen ? 640 : Screen.desktopAvailableWidth
    height: fullScreen ? 480 : Screen.desktopAvailableHeight
    title: qsTr("Hello World")

    property bool fullScreen: true

    flags: fullScreen ? Qt.Window : Qt.FramelessWindowHint

    MouseArea{
        anchors.fill: parent
        onClicked: {
            fullScreen = !fullScreen
        }
    }
}

 

你可能感兴趣的:(学习笔记,qml)