PDA

View Full Version : QMenu does not show icons from QAction



eumel1990
11th June 2011, 12:38
Hello,
I created some QAction objects like this:


moveFractalUp = new QAction(QIcon(":/img/res/img/go-up.svg"), "Move up", this);
connect(moveFractalUp, SIGNAL(triggered()), this, SLOT(MoveFractalUp()));

And I added this actions to my toolbar, like this:

navigationToolBar = addToolBar("Navigation");
navigationToolBar->addAction(moveFractalDown);

This works well. The actions-icons are shown in the toolbar. But now I create a menu like this:

fractalNavigationMenu = menuBar()->addMenu("Fractal &navigation");
fractalNavigationMenu->addAction(moveFractalDown);

The menu entries are created and they are functional, but the icons are not shown.
What am I doing wrong?

greeting eumel1990

wysota
11th June 2011, 12:54
Do the icons show up if you run your application with "-style plastique" parameters?

eumel1990
11th June 2011, 20:48
Hi, thanks for your reply. No the icons won't be shown up, even when a set the -style plastique parameter. But it looks sweet :D

Greetings eumel1990

eumel1990
16th June 2011, 20:16
Does anybody have an idea?

wysota
16th June 2011, 21:20
Please prepare a minimal compilable example reproducing the problem. Check if the icons show up if you use png instead of svg.

eumel1990
10th September 2011, 11:57
Sorry for the late answer, I didn't worked on this program...
I changed my Qt framework to 4.7.4 desktop and now it works. I think my old Qt compilation was bad.
Greetings eumel1990