http://doc.qt.nokia.com/4.7/qstyleop...xIconWidth-var
But, be aware that some styles might not use it to get the icon size.
http://doc.qt.nokia.com/4.7/qstyleop...xIconWidth-var
But, be aware that some styles might not use it to get the icon size.
Thanks. But the menu class doesn't seem to have any option to set it to an object of QStyleOptionMenuItem. I think the setStyle option might work but QStyleOptionMenuItem is not a style but aids in the style, but I can't understand how to implement it. Can u give a small code that sets the menu's icon width using this class ?
Thanks. I did this :
1. Created a QProxyStyle object.
2. Created a QStyleOptionMenuItem object called o. Called the function setMaxIconWidth (24)
3. Called the drawControl function called oo. Parameters were CE.MenuBarItem, o and a new QPainter object.
4. Called the menu's setStyle function with oo.
Nothing changed. I wonder that the setMaxIconWidth only sets the maximum width. The fact that I want to increase the size of icons is not getting conveyed by this method, i think.
The size of the icon is measured by its width. It is a rectangle. Example: 20x20. The minimum size in some of the styles is 20, so you can't go smaller. But the maximum size is taken from the maximum icon width of the option you set.
I do not have time at the moment, but I'll try to create an example later today (evening on my part of the world). But I can't promise anything.
Note that styles don't need to follow special guidelines. This means that a technique that works with one style, might not work with another. This in turn means that it would be a good idea to create a custom menu style, which you can also do with the proxystyle
Bookmarks