Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
6.2.0
-
None
-
-
fa6ee2d9c1506da6eaa07062ce854e1ebdfe26ec (qt/qtdeclarative/6.2) 8ec849646d8bd590e64bda6105021bde58fa7ae3 (qt/qtdeclarative/dev)
Description
Hello everyone,
I am migrating some working software to Qt6, and I encountered what I consider to be a bug.
The software has a popup window that becomes visible when the user tries to close the program. It asks the user if they're sure if they want to exit. This is the way it's being done:
onClosing: function(close){ close.accepted = false confirmExitPopup.visible = true } VPPopupWindow { id: confirmExitPopup title: "Exit Program?" text: "Are you sure you want to close?" } Connections { target: confirmExitPopup function onButtonClicked(buttonState) { if(buttonState == "yes") { Qt.quit(); } visible = false; } }
According to the Qt documentation, that is exactly the way it should be done:
However, the program now closes regardless of which button I click. Actually, if I click "no", the GUI crashes. Why is that? This feature was working fine in Qt5.
Attachments
For Gerrit Dashboard: QTBUG-98747 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
385479,2 | Document correct way of handling QQuickWindow::closing | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
385546,2 | Document correct way of handling QQuickWindow::closing | 6.2 | qt/qtdeclarative | Status: MERGED | +2 | 0 |