application: Add a Starting() slot to Application
Add a slot that is invoked when the main application loop starts. This can be used to perform setup tasks after the initialization has occurred. Initial use is to hide a splash.
This commit is contained in:
parent
b40d9ed44b
commit
59864bf1b6
|
@ -252,6 +252,10 @@ void Application::MoveToThread(QObject* object, QThread* thread) {
|
||||||
|
|
||||||
void Application::AddError(const QString& message) { emit ErrorAdded(message); }
|
void Application::AddError(const QString& message) { emit ErrorAdded(message); }
|
||||||
|
|
||||||
|
void Application::Starting() {
|
||||||
|
qLog(Debug) << "Application starting";
|
||||||
|
}
|
||||||
|
|
||||||
QString Application::language_without_region() const {
|
QString Application::language_without_region() const {
|
||||||
const int underscore = language_name_.indexOf('_');
|
const int underscore = language_name_.indexOf('_');
|
||||||
if (underscore != -1) {
|
if (underscore != -1) {
|
||||||
|
|
|
@ -114,6 +114,7 @@ class Application : public QObject {
|
||||||
void MoveToThread(QObject* object, QThread* thread);
|
void MoveToThread(QObject* object, QThread* thread);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
void Starting();
|
||||||
void AddError(const QString& message);
|
void AddError(const QString& message);
|
||||||
void ReloadSettings();
|
void ReloadSettings();
|
||||||
void OpenSettingsDialogAtPage(SettingsDialog::Page page);
|
void OpenSettingsDialogAtPage(SettingsDialog::Page page);
|
||||||
|
|
|
@ -460,6 +460,10 @@ int main(int argc, char* argv[]) {
|
||||||
QObject::connect(&a, SIGNAL(messageReceived(QString)), &w,
|
QObject::connect(&a, SIGNAL(messageReceived(QString)), &w,
|
||||||
SLOT(CommandlineOptionsReceived(QString)));
|
SLOT(CommandlineOptionsReceived(QString)));
|
||||||
|
|
||||||
|
// Use a queued connection so the invokation occurs after the application
|
||||||
|
// loop starts.
|
||||||
|
QMetaObject::invokeMethod(&app, "Starting", Qt::QueuedConnection);
|
||||||
|
|
||||||
int ret = a.exec();
|
int ret = a.exec();
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in New Issue