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

Windows: QComboBox menu cannot stay expanded when used in a dock widget that has been redocked

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.2.0 RC1
    • 5.1.1, 5.2.0 Beta1
    • Widgets: Main Window
    • None
    • Windows 7, 32bit Qt, VS2010
    • Fix: 6ff08b7db3d4f93b38ae769413d3f3377b3d272b Warning: f48bc3ef40ec0176497896071c487b5326cd66c1

    Description

      1. Undock the the dockwidget from the main window. Do NOT click on the QComboBox before this.
      2. Click on the QComboBox to get the menu.
      3. Redock the QDockWidget.
      4. Click on the QComboBox and notice now that the menu will appear but then immediately collapse.

      You will get also warning:
      QWindowsWindow::setMouseGrabEnabled: Not setting mouse grab for invisible window QWidgetWindow/'QComboBoxPrivateContainerClassWindow'
      QWindowsBackingStore::flush: GetDC failed (Invalid window handle.)

      Below is code which reproduces this problem. Does not occur in Qt4.8.5.

      #include <QApplication>
      #include <QMainWindow>
      #include <QComboBox>
      #include <QDockWidget>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          QMainWindow w;
          QDockWidget * dock2 = new QDockWidget(&w);
          QComboBox * comboBox = new QComboBox(dock2);
          comboBox->addItem("text1");
          dock2->setWidget(comboBox);
      
          w.addDockWidget(Qt::RightDockWidgetArea, dock2, Qt::Vertical);
          w.show();
      
          return a.exec();
      }
      

      Attachments

        1. qtbug34502_4.log
          17 kB
        2. qtbug34502_diag4.patch
          14 kB
        3. qtbug34503_5.log
          13 kB
        4. qtbug34503_diag_transient5.patch
          3 kB
        5. qtbug34503_diag5.patch
          11 kB
        6. qtbug34503.zip
          3 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kleint Friedemann Kleint
            qtcomsupport Qt Support
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes