<SOLVED> How to use QGuiApplication::applicationStateChanged in normal application
I'm creating an application for android device, and I want to use android activities "signals" (onPause etc.). I read that I can use QGuiApplication::applicationStateChanged() signal to check my application state, but I don't know how (and if it's possible) to use this signal in 'normal' QApplication app, not QML. Or maybe if there is some other way of getting those signals in my application?
Re: How to use QGuiApplication::applicationStateChanged in normal application
Re: How to use QGuiApplication::applicationStateChanged in normal application
When using AGuiApplication instead of QApplication, you just need to connect signal to slot, that's simple :) But...
Normally simple, created by QtCreator applications starts with main function like
Code:
int main(int argc, char *argv[])
{
MainWindow w;
w.show();
return a.exec();
}
I can not simply change QApplication to QGuiApplication because So I need to have a QApplication object to run my application, and while I'm using it, I can't create a QGuiApplication object... So it can not by solved using simple signal to slot connection.
Re: How to use QGuiApplication::applicationStateChanged in normal application
QApplication is-a QGuiApplication and has all those signals and more.
Re: How to use QGuiApplication::applicationStateChanged in normal application
Quote:
QApplication
Signals:
8 signals inherited from QGuiApplication
I don't know how I missed that... Thanks :)