diff options
author | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2015-02-24 17:19:40 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2015-02-24 21:02:08 +0100 |
commit | 34b14a8472f44f8517577756e033b92ebd4c5912 (patch) | |
tree | 66a0575156d0a17a835430137e218e2b3f04cc65 /src/corelib/kernel/qcoreapplication.cpp | |
parent | d34353a065c443aac20376cbd88323480d769183 (diff) | |
parent | edd555425a08f9e074f0a4d9333862636ccaae8d (diff) |
Merge remote-tracking branch 'origin/5.4' into 5.5
Conflicts:
examples/xml/htmlinfo/simpleexample.html
examples/xml/rsslisting/rsslisting.cpp
qmake/generators/win32/msbuild_objectmodel.cpp
src/3rdparty/harfbuzz-ng/src/hb-private.hh
src/corelib/global/qlogging.cpp
src/corelib/io/qstorageinfo_unix.cpp
src/corelib/thread/qwaitcondition_unix.cpp
src/gui/kernel/qguiapplication.cpp
src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp
src/testlib/doc/src/qt-webpages.qdoc
tests/auto/other/qaccessibility/tst_qaccessibility.cpp
Change-Id: Ib272ff0bc30a1a5d51275eb3cd2f201dc82c11ff
Diffstat (limited to 'src/corelib/kernel/qcoreapplication.cpp')
-rw-r--r-- | src/corelib/kernel/qcoreapplication.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 194c3f1cba..18a379f8b9 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -80,6 +80,11 @@ #ifdef Q_OS_WIN # ifdef Q_OS_WINRT # include "qeventdispatcher_winrt_p.h" +# include "qfunctions_winrt.h" +# include <wrl.h> +# include <Windows.ApplicationModel.core.h> + using namespace ABI::Windows::ApplicationModel::Core; + using namespace Microsoft::WRL; # else # include "qeventdispatcher_win_p.h" # endif @@ -1244,6 +1249,19 @@ void QCoreApplication::exit(int returnCode) QEventLoop *eventLoop = data->eventLoops.at(i); eventLoop->exit(returnCode); } +#ifdef Q_OS_WINRT + qWarning("QCoreApplication::exit: It is not recommended to explicitly exit an application on Windows Store Apps"); + ComPtr<ICoreApplication> app; + HRESULT hr = RoGetActivationFactory(Wrappers::HString::MakeReference(RuntimeClass_Windows_ApplicationModel_Core_CoreApplication).Get(), + IID_PPV_ARGS(&app)); + RETURN_VOID_IF_FAILED("Could not acquire ICoreApplication object"); + ComPtr<ICoreApplicationExit> appExit; + + hr = app.As(&appExit); + RETURN_VOID_IF_FAILED("Could not acquire ICoreApplicationExit object"); + hr = appExit->Exit(); + RETURN_VOID_IF_FAILED("Could not exit application"); +#endif // Q_OS_WINRT } /***************************************************************************** @@ -2405,7 +2423,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QMutex, libraryPathMutex, (QMutex::Recursive)) INSTALL/plugins, where \c INSTALL is the directory where Qt was installed). The directory of the application executable (NOT the working directory) is always added, as well as the colon separated - entries of the QT_PLUGIN_PATH environment variable. + entries of the \c QT_PLUGIN_PATH environment variable. If you want to iterate over the list, you can use the \l foreach pseudo-keyword: @@ -2550,7 +2568,7 @@ void QCoreApplication::removeLibraryPath(const QString &path) \note Native event filters will be disabled when the application the Qt::AA_MacPluginApplication attribute is set. - For maximum portability, you should always try to use QEvents + For maximum portability, you should always try to use QEvent and QObject::installEventFilter() whenever possible. \sa QObject::installEventFilter() |