IDE : QT Creator
I've added the pictures file in my project path , I can see them I read about Qt Documentation and write the following line code but it doesn't work on with the emulator why? Can someone help me
?
bouton.setIcon(QIcon( QCoreApplication::applicationDirPath() +"/blink.png"));
I also want to give ability to my second button
autreBouton.move(30, 15);
thanks folks
#include <QApplication>
#include <QtGui>
//#include <QSystemInfo> //(1)
#include <QPushButton>
//QTM_USE_NAMESPACE //(2)
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
// Création d'un widget qui servira de fenêtre
QWidget fenetre;
fenetre.setFixedSize(400, 350);
// Création du bouton, ayant pour parent la "fenetre"
QPushButton bouton("Pimp mon bouton !", &fenetre);
bouton.setToolTip("Texte D'aide"); //Texte
bouton.setFont(QFont("Courrier", 10, QFont::Bold, true)); //Font
bouton.setCursor(Qt::PointingHandCursor); //cursor de souris
//bouton.setIcon(QIcon(QCoreApplication::applicationDirPath()+"img/tux2.png")); //Icon on Button
bouton.setIcon(QIcon( QCoreApplication::applicationDirPath() +"/blink.png"));
// Création d'un autre bouton ayant pour parent le premier bouton
QPushButton autreBouton("Autre bouton", &bouton);
autreBouton.move(30, 15);
fenetre.show();
// QSystemInfo s;
// QLabel *label = new QLabel(QObject::tr("hello ").append(s.currentCountryCode()));
// label->show();
// label->resize(100,30);
#if defined(Q_WS_S60)
fenetre.showMaximized();
#else
fenetre.show();
#endif
return app.exec();
}
The Pro File
TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .
QT += network
CONFIG += mobility
MOBILITY += systeminfo
# Input
SOURCES += main.cpp
symbian {
TARGET.CAPABILITIES = LocalServices ReadUserData WriteUserData NetworkServices UserEnvironment Location ReadDeviceData
}
OTHER_FILES += \
./blink.png \
img/tux2.png \
img/tux.jpg

? Can someone help me
? 



