[Qt-interest] using designer to add menu to toolbar

Andreas Pakulat apaku at gmx.de
Mon Nov 23 17:56:14 CET 2009


On 23.11.09 10:03:42, Duane Hebert wrote:
> >Just try it.I think what I said and what you need are exactly the same one.Actualy I do not think we can add a QMenu to 
> > >toolbar,but only menuAction.Of course we can not see them until run-time because you create them when the app runs ,not >when you 
> >design them.
> 
> Try what?  I must be missing something here.  In order to add an action the way that you say, I must create an action in designer 
> and then I can drag it to the toolbar.  I know that.  But my question was how to add a Qmenu to the toolbar in the same way.  I 
> don't see how to do that. 

The answer is that you can't. Designer simply doesn't allow to do much with
actions at all. So you'll have to write code for that yourself.

And you're not really adding a QMenu, you'd add an action that has a menu
and that menu again has actions. If you try how submenu-editing works in
designer you'll quickly notice that designer hides any non-leaf actions in
the action editor.

Andreas

-- 
It's lucky you're going so slowly, because you're going in the wrong direction.



More information about the Qt-interest-old mailing list