[Interest] QMenu size
Joshua Grauman
jnfo-c at grauman.com
Tue Nov 15 17:28:46 CET 2016
Bo,
Thanks! These are great ideas. It's not about making it work like another
system, but it is a unique requirement having to do with recording the
screen...
If you don't mind, could you clarify a bit what you mean with a couple of
your suggestions?
> - Work with the width for height tricks
What does this mean?
> - You can move the menu after it appears with either a reimplementation in
> the resizeEvent, eventFilter on resize or other events, or using 0 time
> single shot timer
I understand the first two of these, but where would I implement a 0 time
single shot?
Thanks again so much!!!
Josh
On Tue, 15 Nov 2016, Bo Thorsen wrote:
> Den 08-11-2016 kl. 23:05 skrev Joshua Grauman:
>> Hello all,
>>
>> I am wondering if there is a way to customize the size of a QMenu used
>> as a context menu. I have it so that when I right click, a popup menu
>> comes up. But I would like it so the QMenu doesn't ever go outside of
>> the window it is clicked in. Right now, if you click near the bottom,
>> the QMenu drops below my app. Or if I have a QMenu with a lot of items,
>> it breaks it up into two columns worth of items, is there a way to make
>> that more (for a wider and less tall sub-QMenu)? Thanks for any thoughts.
>
> This sounds to me like you are trying to force Qt to do something that some
> other system used to do?
>
> I have a lot of requests from customers and I always try to make them accept
> that the default way of doing things are there for a number of reasons and
> they should accept it the it is. So, my advice is to stop thinking about
> this. Or make the guy deciding this stop thinking about it :)
>
> However, if you can't do that, you always have options. Here are a set of
> some of the things I would try:
>
> - Set the maximum height on the QMenu
>
> - Work with the width for height tricks
>
> - You can move the menu after it appears with either a reimplementation in
> the resizeEvent, eventFilter on resize or other events, or using 0 time
> single shot timer
>
> - There are probably a bunch of possible hacks that might work in the area of
> proxy QStyle subclasses
>
> I hope this helps.
>
> Bo Thorsen,
> Director, Viking Software.
>
> --
> Viking Software
> Qt and C++ developers for hire
> http://www.vikingsoft.eu
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
More information about the Interest
mailing list