Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

Best way to create a QML Dialog with QQuickView, to be run before main QML window

$
0
0
You can split your Dialog and App into two .qml files and have something like this maybe: File Dialog.qml: import QtQtuick 2.0 Rectangle{    signal done()    Text{       anchors.centerIn: parent       text: "This is my dialog"   }   MouseArea{       anchors.centerIn: parent       onClicked: parent.done()   } } File MyApp.qml: import QtQtuick 2.0 Rectangle{    Text{       anchors.centerIn: parent       text: "This is my app"   } } and main.qml: import QtQtuick 2.0   Rectangle{    width: 640    height: 480      Dialog{       id: dialog      anchors.fill: parent      onDone: {            dialog.visible = false;       }    }        MyApp{      id: app      anchors.fill: parent      visible: !dialog.visible     }   }

Viewing all articles
Browse latest Browse all 4972

Trending Articles