How to Open New Window in Maximized Mode(Solved)



  • Hi,

    For my application I need to open a new window in Maximized mode,

    From Parent I Opened new window like

    @onDoubleClicked: {
    var component = Qt.createComponent("newWindow.qml")
    var window = component.createObject(root)
    window.show()

                    }@
    

    And I created my new window like below, here I set visibility: "Maximized"

    @ApplicationWindow {

    id: newWindow
    visibility: "Maximized"
    visible: true
    width: 1080
    height: 680
    .....................
    ....................
    }@

    But the new window is not opening in Maximized mode, am I doing anything wrong ?

    Any help will be appreciated......



  • I think it should be
    @
    visibility: Window.Maximized
    @


  • Moderators

    Hi,

    It is showing it in Maximized mode, but since there is no component in it, it is rendered as transparent
    Add this in the ApplicationWindow and you will notice
    @
    ApplicationWindow {
    id: newWindow
    visibility: "Maximized"
    visible: true
    Rectangle {
    anchors.fill: parent
    color: "red"
    }
    }
    @



  • Hi, thanks for reply....

    Actully there are many components in the window, that's why I put the dotted lines....



  • Try this then:
    @
    window.showMaximized()
    @



  • Hi, thanks for the replay,

    @window.showMaximized()@

    works fine.


  • Moderators

    This too should work,
    @
    onDoubleClicked: {
    var component = Qt.createComponent("AppWin.qml")
    var window = component.createObject(root)
    window.show()
    }
    @

    @
    ApplicationWindow {
    id: newWindow
    visibility: "Maximized"
    visible: true
    Rectangle {
    anchors.fill: parent
    color: "red"
    }
    }
    @

    here no dimensions specified, just the visibility property set to Maximized.


Log in to reply
 

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