Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Problem opening child window 2nd time



  • I'm a newbie, and I'm trying to get a child window to work. I followed after the controls gallery example, and it doesn't work right, in my opinion. When you click the button to show the child window, it works fine, and if you click the button that says close it does window1.visible = false, which works fine.

    However, if instead of clicking the button you close the window using the x box on the window, it destroys the window and if you try to open it again it displays a window, but the controls are missing.

    This program initializes the child window before at the beginning of main.qml. It seems to me that if I initialized the window when I actually click the button, that would work, but I can't figure out how to do it.

    Any ideas?



  • Can anyone give me any help on this one?



  • Hi matthellstrom. Welcome to devnet.
    I tried catch bug that you described, but for me "controls gallery example" works fine.
    Probably it depends on Qt or OS version.
    OS: Win 7 64
    Qt: Qt 5.2 SDK Mingw
    What OS and Qt version do you use?



  • OK qxoz can you try something for me? Could you bring up controls gallery example, click on the button to open the child window, then close the child window using the native operating system close (x) button instead of the button in the window. Then, open the child window again. You'll see that the controls are no longer in the child window.



  • Yes i try it and controls are still there.



  • I don't know why mine isn't working. It seems that when I x out of the window, it destroys it then the controls don't show up when I open it again.


Log in to reply