[Interest] Long menus on Windows

Alex Malyushytskyy alexmalvtk at gmail.com
Mon Jun 3 23:46:12 CEST 2013


I will try to recall what I did once.
Instantiate and add subclass  of QWidgetAction to the menu.
Such subclass had to instantiate your widget (better not to derive it from
dialog).
To do this override createWidget. Such widget can be any complex or simple
widget.

If not mistaken I had explicitly call setAutoFillBackground(true ) in a
widget constructor.
You would also have to close menu yourself as a reaction on appropriate
events (for example item selection)
for example in your widget when user selected item you might call

 Q_ASSERT(   parentWidget()->inherits( "QMenu" ) );
  parentWidget() ->close()


Hope this helps,
    Alex



On Fri, May 31, 2013 at 3:24 PM, John Weeks <john at wavemetrics.com> wrote:

> Alex-
>
> Thank you! You seem to be the only one that takes an interest in my
> peculiar questions.
>
> The dialog takes extra clicks- one to select a menu item that displays the
> dialog, then more clicks to interact with the dialog and click OK button. I
> agree that huge menus aren't great; I'm not sure where the big menu gets to
> be big enough to counteract the drawbacks of putting up a dialog.
>
> By the way you can always to make your dialog function like menu.
>
>
> That would be cool. Can you give me a pointer to get me started?
>
> Wait- I guess there really isn't any trickiness- just a button; when you
> click the button, the dialog goes up posititioned at the mouse click. Any
> accept or reject causes the dialog to disappear. I'll think seriously about
> that!
>
> -John Weeks
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130603/076be15f/attachment.html>


More information about the Interest mailing list