Details
-
Bug
-
Resolution: Invalid
-
P2: Important
-
None
-
6.5.5, 6.6.2
Description
A simple reproducer:
#include <QApplication> #include <QCloseEvent> #include <QComboBox> #include <QDebug> #include <QHideEvent> #include <QListWidget> #include <QMouseEvent> #include <QVBoxLayout> class MyBox : public QComboBox { public: explicit MyBox() : QComboBox{} {} protected: void mousePressEvent(QMouseEvent *e) override { qDebug() << Q_FUNC_INFO << "Mouse pressing"; QComboBox::mousePressEvent(e); } }; int main(int argc, char *argv[]) { QApplication a(argc, argv); MyBox *cBox = new MyBox; QListWidget *view = new QListWidget; new QListWidgetItem("Item 1", view); new QListWidgetItem("Item 2", view); new QListWidgetItem("Item 3", view); cBox->setModel(view->model()); cBox->setView(view); QWidget *main = new QWidget; QVBoxLayout *layout = new QVBoxLayout; layout->addWidget(cBox); main->setLayout(layout); main->show(); return a.exec(); } #include "main.moc";
Press combo box to open the item view. This press is registered and correctly captured. But another click that closes the item view is not captured. Nothing is output. Don't know how the mousePressEvent that closes the view is handled.