[Qt-interest] how to add menu dynamically in Qt

Ramesh ramesh.bs at robosoftin.com
Thu May 6 14:46:50 CEST 2010


Hi,

 

I want to add, submenu to a menu item dynamically. How can I achive this?

 

I tried like this,

I have created an  Action and submenu. Then I have added the submenu to
action. 

But, I have connected the "triggered" signal of action. its getting crash if
I click on the action..

 

I have also handled the "aboutToShow" signal of menu, same its also getting
crash when I click on action..

 

Here is the sampe code.

 

Submenu = new QMenu(this);      

connect(Submenu, SIGNAL( aboutToShow()), this, SLOT(move ()));

 

                  QAction *test = new QAction(tr("Selection"), this);

                  test ->setMenu(Submenu);

 

                 menubar()->addAction(test);

 

I want to get the notification, before the display of submenu..

 

 

 


-----------------------------------------------
Robosoft Technologies - Come home to Technology

Disclaimer: This email may contain confidential material. If you were not an intended recipient, please notify the sender and delete all copies. Emails to and from our network may be logged and monitored. This email and its attachments are scanned for virus by our scanners and are believed to be safe. However, no warranty is given that this email is free of malicious content or virus.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100506/31a5aa1f/attachment.html 


More information about the Qt-interest-old mailing list