[Qt-interest] Menu and SubMenu Actions

Brad Howes howes at ll.mit.edu
Tue Jul 20 14:59:18 CEST 2010


On Jul 20, 2010, at 8:47 AM, Andre Somers wrote:

> Op 20-7-2010 9:00, Raja Rokkam schreef:
>> Hi All,
>> 
>>          I have a simple issue:
>> 
>> Menu1 -> Item1
>>               Item2
>>               Item3
>> 
>> 
>> When I click on either of items, I will disable all the 3 entries, but 
>> enable the MENU1 entry changing its text.
>> 
>> Now, in the above case if use clicks on MENU1 entry, it should show me 
>> the disabled entries when Hovered and call a SLOT when clicked on it
>> 
>> Right now, its just showing me the disabled list of entries and when 
>> clicked it is moving on to 1st disabled entry.
>> 
>> 
> AFAIK, what you want is not possible with the standard menus in Qt. The 
> behaviour is non-standard and will not be expected by your users. A menu 
> item that represents a submenu can not itself be an action, AFAIK.


I agree with Andre's caution, but I would like to point out that you can receive the aboutToShow() signal to do some stuff before the menu appears to the user. I've done so in the past.

Brad

-- 
Brad Howes
Group 42
MIT Lincoln Laboratory • 244 Wood St. • Lexington, MA 02173
Phone: 781.981.5292 • Fax: 781.981.3495 • Secretary: 781.981.7420









More information about the Qt-interest-old mailing list