qt - QML: Button that opens a window from ApplicationWindow -


i have button called adavanced settings in applicationwindow. onclicked want open window, have combobox, textentry, etc. can tell me how proceed onclicked. have:

applicationwindow{  ...      button {         text: "advanced settings"         onclicked: {             var component = qt.createcomponent("popupsetingswindows.qml");          }     } } 

popupsetingswindows.qml

window {     id:secondwindow     width: 800     height: 480     title: "second"      text {       text: "hello world"     } } 

but window doesn't show. did understand wrong ?

i found answer in link provided in comment above. here details example problem , in case link gets inactive in future.

applicationwindow{ id: root property variant win;  // can hold reference..  ...  button {     text: "advanced settings"     onclicked: {         var component = qt.createcomponent("popupsetingswindows.qml");         win = component.createobject(root)         win.show();         }     } } 

qml file remains unchanged


Comments