Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.1.1, 5.2.0 Beta1
-
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(); }