diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-07-01 09:59:28 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2015-07-01 09:59:28 +0000 |
commit | 0698f876ca02b85c1e584b72cac3444796f6a355 (patch) | |
tree | 022748fb34278fb455d8e029d912dfb0b545f443 /src/corelib/kernel/qcoreapplication.cpp | |
parent | cd297f99a2ce9c53c3ac4633bdf2425af364a1bc (diff) | |
parent | 0aa2d318b1524cdab42ab9988270779ddcc1922a (diff) |
Merge "Merge remote-tracking branch 'origin/5.5' into dev" into refs/staging/dev
Diffstat (limited to 'src/corelib/kernel/qcoreapplication.cpp')
-rw-r--r-- | src/corelib/kernel/qcoreapplication.cpp | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 524bfd26cc..66481d4c87 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -1004,6 +1004,17 @@ bool QCoreApplication::notifyInternal(QObject *receiver, QEvent *event) do not change the focus widget. \endlist + \b{Future direction:} This function will not be called for objects that live + outside the main thread in Qt 6. Applications that need that functionality + should find other solutions for their event inspection needs in the meantime. + The change may be extended to the main thread, causing this function to be + deprecated. + + \warning If you override this function, you must ensure all threads that + process events stop doing so before your application object begins + destruction. This includes threads started by other libraries that you may be + using, but does not apply to Qt's own threads. + \sa QObject::event(), installNativeEventFilter() */ @@ -2053,11 +2064,13 @@ QString QCoreApplication::applicationFilePath() QCoreApplicationPrivate *d = self->d_func(); - static char *procName = d->argv[0]; - if (qstrcmp(procName, d->argv[0]) != 0) { - // clear the cache if the procname changes, so we reprocess it. - QCoreApplicationPrivate::clearApplicationFilePath(); - procName = d->argv[0]; + if (d->argc) { + static const char *procName = d->argv[0]; + if (qstrcmp(procName, d->argv[0]) != 0) { + // clear the cache if the procname changes, so we reprocess it. + QCoreApplicationPrivate::clearApplicationFilePath(); + procName = d->argv[0]; + } } if (QCoreApplicationPrivate::cachedApplicationFilePath) |