Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-62596

Qt::WA_QuitOnClose has no effect if QQuickWigdet is a child of QWidget

    XMLWordPrintable

Details

    Description

      In the following example, uncommenting of the marked line causes the `w2` window to not close automatically.

      This bug is similar to https://bugreports.qt.io/browse/QTBUG-31569 (which was already solved for Qt 5.1.1).

      
      #include <QWidget>
      #include <QApplication>
      #include <QQuickWidget>
      
      int main(int argc, char *argv[])
      {
      	QApplication a(argc, argv);
      
      	QWidget w;
      	w.setWindowTitle("Close This");
      	w.show();
      
      	QWidget w2;
      //	new QQuickWidget(&w2);   <--------- uncomment this to have the wrong behavior
      	w2.setAttribute(Qt::WA_QuitOnClose, false);
      	w2.setWindowTitle("This should be closed automatically");
      	w2.show();
      
      	return a.exec();
      }
      

      Attachments

        Issue Links

          Activity

            People

              tvete Paul Olav Tvete
              sthlm58 Michal Kucharski
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: