Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Open new fullscreen qml window and close/hide current fullscreen window
Forum Update on Monday, May 27th 2025

Open new fullscreen qml window and close/hide current fullscreen window

Scheduled Pinned Locked Moved General and Desktop
qmlfullscreen
3 Posts 2 Posters 9.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • RiteshPanchalR Offline
    RiteshPanchalR Offline
    RiteshPanchal
    wrote on last edited by
    #1

    I am using qt 5.2.1 on nvidia TX1 running Ubuntu 14.04.
    I want open new fullscreen Windows without boarders from currently running fullscreen qml.

    I have 2 qml files

    1. startup.qml
    2. Preview.qml

    On startup, startup.qml is loaded
    main.cpp

    int main(int argc, char *argv[])
    {
        QGuiApplication app(argc, argv);
    
        QQmlApplicationEngine engine;
        engine.load(QUrl(QStringLiteral("qrc:///qml/qml/startup.qml")));
    
        return app.exec();
    }
    

    startup.qml

    import QtQuick 2.2
    import QtQuick.Window 2.0
    import QtQuick.Controls 1.1
    
    ApplicationWindow {
        id: rootWindow
        width: Screen.width
        height: Screen.height
        visible: true
        visibility: Window.FullScreen
    
        Item {
            focus: true
    
            Timer {
                interval: 2500
                running: true;
                onTriggered: {
                    var component = Qt.createComponent("qrc:///qml/qml/Preview.qml")
                    var window    = component.createObject(rootWindow)
                    rootWindow.visible = false
                    window.show()
                }
            }
        }
    }
    

    Preview.qml

    import QtQuick 2.0
    import QtQuick.Window 2.0
    import QtQuick.Controls 1.1
    
    ApplicationWindow {
        id: rootWindow
        width: Screen.width
        height: Screen.height
        visible: true
        visibility: Window.FullScreen
    
    }
    

    After timer delay startup.qml is getting closed and new Preview.qml window appears. But the problem is that it appears in window with boarder and ubuntu unity side pane.

    So how can i open second windows also in fullscreen mode?

    1 Reply Last reply
    0
    • Y Offline
      Y Offline
      Yakov Eremin
      wrote on last edited by
      #2

      Hello, you need to set window flag to avoid drawing borders.

      flags: Qt.Window | Qt.FramelessWindowHint
      
      1 Reply Last reply
      0
      • RiteshPanchalR Offline
        RiteshPanchalR Offline
        RiteshPanchal
        wrote on last edited by
        #3

        Thanks for the Reply.
        I will try your solution also.
        But i found one solution.

        I just replaced

        window.show()
        

        in startup.qml to

        window.showFullScreen()
        

        And this fulfills my requirements.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved