PDA

View Full Version : Delayed popup menu



tebessum
1st August 2007, 08:03
Hi;

Press action button, popup menu 1 or 2 second later show
how can fix this problem...



drawMenu = new QMenu(this);
drawMenu->addAction(tr("Line Object"));
drawMenu->addAction(tr("Rectangle"));
drawMenu->addAction(tr("Rounded rectangle"));
drawMenu->addAction(tr("Ellipse"));
drawMenu->addAction(tr("Triangle"));
drawMenu->addAction(tr("Diamond"));

actionDraw->setMenu(drawMenu);

marcel
1st August 2007, 08:24
Do you do anything when the triggered() signal for the action is emitted?

Regards

tebessum
1st August 2007, 08:29
Do you do anything when the triggered() signal for the action is emitted?

Regards



No, I don't ...

If only click to button don't show anything but press to hold 1 or 2 second show it ...

marcel
1st August 2007, 08:37
What do you do with actionDraw. Do you put it in a toolbar?
Because there is another way, designed specifically for that. See this post: http://www.qtcentre.org/forum/f-qt-programming-2/t-implementing-a-butcon-8262.html/?highlight=butcon

regards

jpn
7th August 2007, 11:17
Change the tool button popup mode (http://doc.trolltech.com/4.3/qtoolbutton.html#popupMode-prop) to get the menu popup in a different way.