[Interest] QML window icon

Mark Summerfield list at qtrac.plus.com
Fri Feb 1 09:07:01 CET 2013


Hi Samuel,

On Thu, 31 Jan 2013 13:38:22 +0100
Samuel Rødal <samuel.rodal at digia.com> wrote:
> On 01/29/2013 01:42 PM, Mark Summerfield wrote:
> > 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?
> 
> The window icon? You can use view.setIcon() for that.

I did; and it didn't work.

-- 
Mark Summerfield, Qtrac Ltd, www.qtrac.eu
    C++, Python, Qt, PyQt - training and consultancy
        "Programming in Go" - ISBN 0321774639
            http://www.qtrac.eu/gobook.html



More information about the Interest mailing list