[Interest] applicationStateChanged in QML
bo at vikingsoft.eu
Fri Aug 15 07:47:33 CEST 2014
Den 15-08-2014 03:28, mark diener skrev:
> Does anybody know how to receive application signals from
> QGuiApplication in Qt Quick 2.0 application?
> I do not want to use a binding
> The signal coming from QGuiApplication ->void *applicationStateChanged
> Inside QML, I want to use a Connections component to get the signal
> triggered in QML
> Or can I only deal with this signal inside of C++? And then use my own
> global singleton class
> to trigger a signal into QML?
> I have searched high and low.
> Maybe there is a way to use the Qt.application.active property and bind
> it so that it will call
To use a Connection object, you have to export the source object from
C++. Something like this:
Now you can access the object from QML as you would any item.
console.log("State change", state)
You can export and use any QObject like this.
I usually don't export the Qt objects directly, but instead make some
kind of backend object that holds the fundamental state of the application.
Director, Viking Software.
Qt and C++ developers for hire
More information about the Interest