Icon on the menu of Qaction not showing up. [ Solved ]
-
Chances are that if you add the menu to the tool bar itself, you will see the icon. As I mentioned in my previous post, set the icon on the menu action explicitly in your code.
-
The same with this
ui>menuHere_no_icon_is_been_shown>setIcon(QIcon(":/icons/Icons/button_blue_fastforward.png"));If you want download example project-> http://dl.dropbox.com/u/11379868/example.zip
-
Did you add the icons to the resource file of the project?
-
Doesn't it depend on the style if you can have an icon for a complete menu, not just for actions in a menu?
-
See clementine screenshot.
!http://oi54.tinypic.com/i3cvpu.jpg(Screen)!So Andre what i want, is used in other programs.. ( + Clementine is a qt app )
Volker yes the icons are on the resource file..
Again If you want download example project-> http://dl.dropbox.com/u/11379868/example.zip -
[quote author="Leon Vytanos" date="1298466699"]The same with this
ui>menuHere_no_icon_is_been_shown>setIcon(QIcon(":/icons/Icons/button_blue_fastforward.png"));
[/quote]Dude, reread my post and then fix to this:
@ui->menuHere_no_icon_is_been_shown->menuAction()->setIcon(QIcon(":/icons/Icons/button_blue_fastforward.png"));@ -
This is how to set the icon to be visible
@ ui->menuHere_no_icon_is_been_shown->menuAction()->setIconVisibleInMenu(1);
@Problem Solved. Thanks Franzk..
-
This is kind-of wrong:
@
ui->menuHere_no_icon_is_been_shown->menuAction()->setIconVisibleInMenu(1);
@this is better:
@
ui->menuHere_no_icon_is_been_shown->menuAction()->setIconVisibleInMenu(true);
@ -
Volker why is it wrong? Doesn't 1 mean true and 0 false? It does..
-
1 and 0 are of type int
true and false are of type boolIt is casted the right way, yes, but it is considered bad style in C++ (in C you do not have a type bool, so 0/1 is ok there).
-
Ok thank you Volker.. I didn't know it.
-
Besides, it is much easier to read true and false than 1 and 0, IMHO.
-
I agree!