In my QT C ++ application, I call the QML ModalDialog with 2 buttons (OK / CANCEL) that appear correctly on the screen, and therefore there is no problem.
However, I am struggling to find a way to get the QT C ++ application on which the button was clicked.
I can’t somehow “freeze” when I call QML ModalDialog, wait there until the user clicks the “OK” button or the “Cancel” button. I see that the application calls QML ModalDialog and immediately exits this part and continues.
QMetaObject :: invokeMethod can call the QML function and have a return value, but it just does not wait until the user presses one of the buttons, it just exits immediately, so there is no need to use it.
I want to use this QML ModalDialog in several places of my application (the QML modal dialog may have different text passed from my QT C ++ application), so I was looking for a general solution for this.
In general, I'm looking for something like this:
C / C ++ return_value = QML_Modal_Dialog (....)
Can someone point me in the right direction? Thanks
source
share