PDA

View Full Version : Toolbar & Icons missing



raphaelf
27th February 2006, 20:56
Hello everybody,

QT:4.1.1

I have designed a MainWindow and a toolbar.I have created a new Action with a Image from: "D:\rapha\qtprojekte\qt4\mainwindow\images".
In the designer i can see the beautiful icon.

So i have 2 questions now:

1. After compiling and running Program i was not able to see my icon in the toolbar.
I think that ui_mainwindow.h create the false path:


actionTest->setIcon(QIcon(QString::fromUtf8("images/copy.png")));

Shouldnt be:


actionTest->setIcon(QIcon(QString::fromUtf8("../images/copy.png")));

Because my structure i am using are:
images
release (My App are here)
.
.
2. How to compile my app included the icons, so i will not need the images folder any more?

wysota
27th February 2006, 21:34
Add those icons to the resource file and use a resource path instead of file paths.

More info on resources (http://doc.trolltech.com/4.1/resources.html#resource-system)

raphaelf
27th February 2006, 22:19
Hi wyota!
It works fine...thank you to open my mind :p