Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

QMenu item text disappears when icon added

I am attempting to add an icon to my QMenu using Qt Designer, however I realized that my text disappears when my icon is added. Is there any way for me to show my icon next to my text?

like image 784
MistyD Avatar asked Sep 17 '13 04:09

MistyD


1 Answers

It was not supported in Qt 4, maybe it is in Qt5 I haven't checked. In Designer itself there isn't much you can do. In the code one option is to customize the style to draw both the icon and text: - sizeFromContents for QStyle::CT_MenuBarItem - drawControl for QStyle::CE_MenuBarItem - drawCustomControl for QStyleOptionMenuItem

like image 165
guest Avatar answered Oct 23 '22 08:10

guest