Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.5.0
-
None
-
0054b444a202d08167c49a1a94fd2d306d14f91f
Description
To reproduce, run the test case below and:
- set the keyboard focus onto the line edit
- press the menu key (the one between the window and the ctrl key) 5 times
- try to close the context menu
One needs to select something 5 times or press the escape key five
times. This is because the menu was actually opened five times. This does not happen with
ordinary widgets.
// -------------------------------------- #include <QApplication> #include <QGraphicsView> #include <QGraphicsProxyWidget> #include <QLineEdit> int main (int argc, char **argv) { QApplication app (argc, argv); QGraphicsView *view = new QGraphicsView; QGraphicsScene *scene = new QGraphicsScene; scene->setSceneRect (0, 0, 100, 100); view->setScene (scene); QGraphicsProxyWidget *pw = new QGraphicsProxyWidget; pw->setWidget (new QLineEdit); scene->addItem (pw); view->show (); int res = app.exec (); delete view; delete scene; return res; } // --------------------------------------