[Qt-interest] How to customize QMenu ( icon size, item display only icon )
Malyushytsky, Alex
alex at wai.com
Thu Jan 14 03:07:52 CET 2010
I insert action associated with menu to toolbar.
Icons in the menu should be exactly the same as toolbar has, because
one action from the menu should provide an icon to the action associated with menu.
With such approach user should be able to select which action he wants to be executed when he click menu associated icon.
Until now I managed to implement it except:
a) I am not able to change icon size of the icons in the menu.
For actions in the menu icons are scaled the 16x16, no matter that I load them 32x32.
I seems managed to change width of the icons using stylesheet:
menu->setStyleSheet(" QMenu { "
" icon-size: 32px; "
" } " );
But height of the icon remains 16pt.
Is there any way to enforce menu item to display different height icon?
b) Even though QAction does not have any text set it adds some spacing for the text on the right of then icon.
Is there a way to remove such spacing?
I want QIcon to define all the appearance of QAction.
Thanks,
Alex Malyushytsky
Research Engineer - Weidlinger Associates Inc.
office: 650 230 0210,
direct: 650 230 0349
web: http://www.wai.com
---------------------------------------------------------------------------------------------------
Weidlinger Associates, Inc. made the following annotations.
"This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you."
"Please consider our environment before printing this email."
More information about the Qt-interest-old
mailing list