How to make Fullscreen for QtQuick 2.10 Control Application



  • Hi,
    I am using import QtQuick 2.10. I need to make fullscreen mode. I try to add
    flags: Qt.Window | Qt.FramelessWindowHint
    and didn't work for me?

    import QtQuick 2.10
    import QtQuick.Controls 2.3
    
    ApplicationWindow {
        visible: true
        width: 640
        height: 480
        title: qsTr("Hello World")
        //flags: Qt.Window | Qt.FramelessWindowHint  // This didn't work.
    
    
        Text {
            id: mainPage
            text: qsTr("Main Page")
            font.pixelSize: Qt.application.font.pixelSize * 1
        }
    
        SwipeView {
            id: swipeView
            anchors.fill: parent
            currentIndex: 1 //tabBar.currentIndex
    
            Page1Form {
            }
    
            Page2Form {
            }
    
            Page3Form {
    
            }
        }
    
        footer: TabBar {
            id: tabBar
            currentIndex: swipeView.currentIndex
    
            TabButton {
                text: qsTr("Left Page")
                font.pixelSize: Qt.application.font.pixelSize * 0.7
    
                MouseArea {
                    anchors.fill: parent
                    onPressed: {
                        currentIndex: 0
                    }
                }
            }
    
            TabButton {
                text: qsTr("Mid Page")
                font.pixelSize: Qt.application.font.pixelSize * 0.7
    
                MouseArea {
                    anchors.fill: parent
                    onPressed: {
                        currentIndex: 1
                    }
                }
            }
    
            TabButton {
                text: qsTr("Right Page")
                font.pixelSize: Qt.application.font.pixelSize * 0.7
    
                MouseArea {
                    anchors.fill: parent
                    onPressed: {
                        currentIndex: 2
                    }
                }
            }
        }
    }
    
    


  • @NTMS

    Here's a document of how to make a full screen mode: https://doc.qt.io/qt-5.10/qml-qtquick-window-window.html#visibility-prop



  • @Devopia53 thank you very much. I forgot to import QtQuick.Window 2.3. Its working now.

    Here is the code:

    import QtQuick 2.10
    import QtQuick.Controls 2.3
    import QtQuick.Window 2.3

    ApplicationWindow {
    visible: true
    width: 640
    height: 480
    title: qsTr("Hello World")
    flags: Qt.Window | Qt.FramelessWindowHint
    visibility: Window.FullScreen


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.