Icon on the menu of Qaction not showing up. [ Solved ]
-
wrote on 23 Feb 2011, 13:19 last edited by
Did you add the icons to the resource file of the project?
-
wrote on 23 Feb 2011, 13:19 last edited by
Doesn't it depend on the style if you can have an icon for a complete menu, not just for actions in a menu?
-
wrote on 23 Feb 2011, 13:31 last edited by
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 -
wrote on 23 Feb 2011, 13:37 last edited by
[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"));@ -
wrote on 23 Feb 2011, 13:51 last edited by
This is how to set the icon to be visible
@ ui->menuHere_no_icon_is_been_shown->menuAction()->setIconVisibleInMenu(1);
@Problem Solved. Thanks Franzk..
-
wrote on 23 Feb 2011, 14:04 last edited by
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);
@ -
wrote on 23 Feb 2011, 14:10 last edited by
Volker why is it wrong? Doesn't 1 mean true and 0 false? It does..
-
wrote on 23 Feb 2011, 14:22 last edited by
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).
-
wrote on 23 Feb 2011, 14:38 last edited by
Ok thank you Volker.. I didn't know it.
-
wrote on 23 Feb 2011, 15:45 last edited by
Besides, it is much easier to read true and false than 1 and 0, IMHO.
-
wrote on 23 Feb 2011, 15:47 last edited by
I agree!
15/16