Set icon to qtquick application in OS X
my main.cpp is this:
@qint32 main(qint32 argc, char *argv)
QApplication app(argc, argv);
engine.rootContext()->setContextProperty("systemControler", new System); qmlRegisterType<System>("System", 1, 0, "System"); engine.load(QUrl(QStringLiteral("qrc:///qml/adviser/main.qml"))); QObject *topLevel = engine.rootObjects().value(0); QQuickWindow *win = qobject_cast<QQuickWindow*>(topLevel); app.setWindowIcon(QIcon("adviser.icns")); win->show(); return app.exec();
and I had added this line to my .pro file as the guide sad:
@ICON = adviser.icns@
I had checked inside the adviser.app file and in my Resources folder i had the icon, but in the dock it doesn't appear and the adviser.app file hasn't the icon...
where is my error guys ??
Did you try to move you icon file to folder where you .pro file is saved? Also you must check the plist file. If you want to use custom plist file you must add this line to you pro file:
QMAKE_INFO_PLIST = Info.plist
In plist file must have this lines:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<string>Created by ...</string>