-
Bug
-
Resolution: Cannot Reproduce
-
P2: Important
-
4.5.2
-
None
Consider the following:
A QPushButton with ActionsContextMenu policy is embedded into a graphics scene. When the right mouse button is pressed on the push button, its context menu is shown. However, if the user again presses the right mouse button on the part of the context menu that overlaps the push button, another context menu is invoked.
This can be repeated several times to invoke multiple context menus.
The following example reproduces the problem:
#include <QtGui> class PushButton : public QPushButton { Q_OBJECT public: PushButton(QWidget *parent = 0) : QPushButton(parent) { setContextMenuPolicy(Qt::ActionsContextMenu); QAction *action = new QAction("Update text", this); addAction(action); } }; #include "main.moc" int main(int argc, char **argv) { QApplication app(argc, argv); QGraphicsView view; QGraphicsScene *scene = new QGraphicsScene(0, 0, 800, 600); QGraphicsProxyWidget *proxy = scene->addWidget(new PushButton); view.setScene(scene); view.show(); return app.exec(); }