You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

hatulflezet

Professional

  • "hatulflezet" started this thread

Posts: 1,301

Location: Munich Germany

Occupation: Programmer

  • Send private message

1

Thursday, July 1st 2004, 5:45pm

releasing a popup menu through code

Hi All,

I have a menu item which is a combobox.
I would like that when an item is selected in the combobox, the menu will close, just as if a normal item on it was selected.
But I can't find how to "fake" this "selected" event for the menu, so I need to click out side the menu to make it close again, after selecting an item in my combobox.

Thanks in advabce

Dani.
Click here! I dare ya'!! :]
Project Archimedes
----------------------------------------------------------
"Don't panic, and thanks for all the fish!"

tuxipuxi

Unregistered

2

Thursday, July 1st 2004, 8:27pm

Maybe call hide() for the menu object?

Michael.

hatulflezet

Professional

  • "hatulflezet" started this thread

Posts: 1,301

Location: Munich Germany

Occupation: Programmer

  • Send private message

3

Thursday, July 1st 2004, 8:28pm

hehe - thanks - I thought of it in the mean time...
Click here! I dare ya'!! :]
Project Archimedes
----------------------------------------------------------
"Don't panic, and thanks for all the fish!"

Posts: 2,162

Location: Graz, Austria

Occupation: Student

  • Send private message

4

Thursday, July 1st 2004, 8:29pm

Qt/KDE Developer
Debian User

hatulflezet

Professional

  • "hatulflezet" started this thread

Posts: 1,301

Location: Munich Germany

Occupation: Programmer

  • Send private message

5

Thursday, July 1st 2004, 9:16pm

Quoted

Originally posted by anda_skoa
http://doc.trolltech.com/3.2/qpopupmenu.html#insertItem-d

Cheers,
_


Thanks - I am indeed using this - this was not my problem.
It was about hiding the menu after an item was selcted in the combobox (which is an item in the menu).
Thanks all the same. :)
Click here! I dare ya'!! :]
Project Archimedes
----------------------------------------------------------
"Don't panic, and thanks for all the fish!"

Posts: 2,162

Location: Graz, Austria

Occupation: Student

  • Send private message

6

Friday, July 2nd 2004, 12:18am

Quoted


Futhermore, if the embedded widget closes the menu when the user made a selection, this can be done safely by calling:

Source code

1
2
3
4
        if ( isVisible() &&
             parentWidget() &&
             parentWidget()->inherits("QPopupMenu") )
             parentWidget()->close();



Cheers,
_
Qt/KDE Developer
Debian User