Button Click Signal to make a pop- up window



  • Hi,

    I saw a couple of topics about this but I didn't exactly understand so I'm making this one to ask.

    I'm using Qt Quick and as suggested in the tutorial I made different .qml for every button.

    I want when the button is clicked to make a window pop- up. What should I write after @ onClicked: @

    in the mouseArea.

    Also how to make a second window (the pop- up one), what should I add to the project so I can design it like the main one. I read that I have to make a class that inherits with QWidget but I need a bit more information. A short example would be great.


  • Moderators

    Hi,

    You could use "Dialog":http://qt-project.org/doc/qt-5/qml-qtquick-dialogs-dialog.html component as a Popup Window. Use "open()":http://qt-project.org/doc/qt-5/qml-qtquick-dialogs-dialog.html#open-method to show it.

    bq. I want when the button is clicked to make a window pop- up. What should I write after onClicked:

    You can access the Dialog component by it's id. So for eg.
    @
    onClicked: mydialog.open()
    @

    bq. I read that I have to make a class that inherits with QWidget but I need a bit more information.

    If using QML it's better to stick to QML components to avoid unnecessary complexity.



  • Yes now I understand, thank you.


Log in to reply
 

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