[Interest] adapting a QMenu's width in a QStyle?

René J.V. Bertin rjvbertin at gmail.com
Tue Jun 7 19:27:18 CEST 2016


Hi,

I'm modifying a QStyle so that it uses the Unicode "check mark" glyph for checked menu items, because that I think should give a nice visual unity between the item text and the mark, both in style and in size (= when users select a really large font).

The problem is that when I make horizontal space for the tick at large font sizes (say 32pt), the menu becomes too narrow. From what I understand,
QStyle::drawPrimitive is called with PE_PanelMenu when the (popup) menu backdrop is to be drawn.

What I'm not getting around is the fact that there appears to be some higher-priority clipping that prevents me from extending the right border. This also applies to the item text itself; it is clipped even if I give it an amply wide bounding rectangle.

Am I missing something or am I trying to do the impossible?

Thanks,
R.



More information about the Interest mailing list