Open a pop-up menu
-
-
can you please post a code snippet where the problem occurs?
From your description, it's not clear to me what you do exactly. But I can try to guess a bit:you call show() on the menu?
The I should quote from the "docs:":http://doc.qt.nokia.com/4.7/qmenu.html#details
bq. Warning: To make QMenu visible on the screen, exec() or popup() should be used instead of show().
- exec() calls a modal event loop so the menu must be closed to go on.
- popup() displays the menu and goes on in the execution logic, wiothout waiting for input.
So perhaps, exec() is the one you were locking for?
Enough crystal ball now :-)
-
Thanks for your reply.
But my class does not have the exec() and popup() methods.
It is a QGraphicsView class.See header below:
@
class MyMenu : public QGraphicsView
{
public:
MyMenu();
void createMenu();protected:
void keyPressEvent(QKeyEvent* event);
void drawBackground(QPainter *painter, const QRectF &rect);private:
MyItem *btnPage[CPAGE];
QGraphicsScene *scene;
QGraphicsItem *buttonParent;};
@