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?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With