[Interest] QML window icon

Mark Summerfield list at qtrac.plus.com
Tue Jan 29 13:42:57 CET 2013


Hi,

I am trying to create a "pure" QML program, so may main.cpp is simply:

    #include <QGuiApplication>
    #include <QQmlEngine>
    #include <QQuickView>
    int main(int argc, char *argv[])
    {
	QGuiApplication app(argc, argv);
	QQmlEngine engine;
	QQuickView view(&engine, 0);
	view.setSource(QUrl("qrc:/myapp.qml"));
	view.show();
	return app.exec();
    }

In myapp.qml I have:

    import QtQuick 2.0
    import QtQuick.Window 2.0
    Window {
	title: "Caption"
	...
    }

But there doesn't seem to be any API for setting the application's icon.
(I know I could use QApplication, but I am trying to avoid using
QWidget.)

Is it possible to set an application icon, and if so, how?

Thanks!

-- 
Mark Summerfield, Qtrac Ltd, www.qtrac.eu
    C++, Python, Qt, PyQt - training and consultancy
	"Advanced Qt Programming" - ISBN 0321635906
            http://www.qtrac.eu/aqpbook.html



More information about the Interest mailing list