ein alt bekanntes Problem. Mein Programm ladet das Icon nicht. Ich habe es mit Icon Composer erstellt. Meine Ordnerstruktur sieht folgend aus:
myapp.pro
images/myicon.icns
myapp.pro:
Code: Alles auswählen
# -------------------------------------------------
# Project created by QtCreator 2010-04-04T14:10:13
# -------------------------------------------------
QT += network \
sql
TARGET = pixCRU
ICON = images/myicon.icns
TEMPLATE = app
SOURCES += main.cpp \
mainwindow.cpp \Code: Alles auswählen
:/icons/myicon
In der main.cpp habe ich dann folgenden Code:
Code: Alles auswählen
int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(pixcollection);
QApplication a(argc, argv);
MainWindow w;
//w.setWindowIcon(QIcon(":/icons/pixc"));
a.setWindowIcon(QIcon(QPixmap(":/icons/pixc")));
w.show();
return a.exec();
}