Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.6
-
None
-
a7cb7dad789849724767bd49eca8958d02eb2277
Description
When setting a QPushButton in a QDialogButtonBox to invisible, the button used to just not be visible in up to Qt 6.5. In Qt 6.6, the button seems to get deleted, which can cause nullptr access in preexisting code that uses QDialogButtonBox .
Reproducer
#include <QApplication> #include <QDialogButtonBox> #include <QPushButton> int main(int argc, char *argv[]) { QApplication app(argc, argv); QDialogButtonBox box(QDialogButtonBox::Ok); qDebug() << box.button(QDialogButtonBox::Ok); box.button(QDialogButtonBox::Ok)->setVisible(false); qDebug() << box.button(QDialogButtonBox::Ok); return 0; }
Use code snippet into Qt Creator
Output under Qt 6.5.2
QPushButton(0x23b073e1710) QPushButton(0x23b073e1710)
Output under Qt 6.6
QPushButton(0x2c258b26570) QWidget(0x0)
Attachments
Issue Links
- is required for
-
QTCREATORBUG-29595 Android: Crash after "Update Installed" in the Sdk Manager
-
- Closed
-
- resulted from
-
QTBUG-114377 Broken focus when hiding a button of a QDialogButtonBox
-
- Closed
-