c++ - icon for QT app -
i'm using qtcreator build application on mac. @ time application icon default 1 set qt creator.
i set 1 custom specific app.
what have in in .qrc file, have added
<rcc> <qresource prefix="/"> <file>main.qml</file> <file>images/logo.icns</file> </qresource> </rcc>
i have made try on main.cpp adding
qicon icon(":images/logo.icns"); qapplication app(argc, argv); app.setwindowicon(icon);
it doesn't work... have tried in class in define how window of app done
qicon icon(":images/logo.icns"); qmainwindow *window = new qmainwindow(); window->setwindowtitle(qstring::fromutf8("puls")); window->resize(600, 600); qwidget *centralwidget = new qwidget(window); centralwidget->setwindowicon(icon);
it's not working.
the icon's path may incorrect.
try change
qicon icon(":images/logo.icns");
to
qicon icon(":/images/logo.icns");
cause of .qrc
file define prefix
:
<qresource prefix="/">
Comments
Post a Comment