summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-06-20 14:09:00 +0200
committerLiang Qi <liang.qi@qt.io>2016-06-21 08:39:41 +0200
commitea438b2508f329698e11c6dae6994d441c6e67df (patch)
tree7a6052b98ba1ff6e0258c52cfc2726e197f53dd2 /src/corelib/kernel
parenta2f319e9fb2f7595fc16d0d79e26438463051a53 (diff)
parent5f0ec7305e4310123ddeb98d3523087e3c560d9c (diff)
Merge remote-tracking branch 'origin/5.7' into dev
Conflicts: src/corelib/global/qglobal.cpp src/corelib/global/qsysinfo.h src/corelib/kernel/qcoreapplication_win.cpp src/gui/text/qdistancefield.cpp src/gui/text/qdistancefield_p.h src/plugins/platforms/windows/qwindowsglcontext.cpp src/plugins/platforms/windows/qwindowsglcontext.h Change-Id: Ib3500acc2b28553bde06758cd9a2e19eb7fe2978
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qabstracteventdispatcher.h3
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp4
-rw-r--r--src/corelib/kernel/qcoreapplication_win.cpp55
-rw-r--r--src/corelib/kernel/qfunctions_winrt.h3
-rw-r--r--src/corelib/kernel/qmetaobject.h2
-rw-r--r--src/corelib/kernel/qppsobject.cpp4
6 files changed, 42 insertions, 29 deletions
diff --git a/src/corelib/kernel/qabstracteventdispatcher.h b/src/corelib/kernel/qabstracteventdispatcher.h
index 6e59790d5c..f92e418ebf 100644
--- a/src/corelib/kernel/qabstracteventdispatcher.h
+++ b/src/corelib/kernel/qabstracteventdispatcher.h
@@ -111,7 +111,8 @@ public:
void removeNativeEventFilter(QAbstractNativeEventFilter *filterObj);
bool filterNativeEvent(const QByteArray &eventType, void *message, long *result);
#if QT_DEPRECATED_SINCE(5, 0)
- QT_DEPRECATED bool filterEvent(void *message) { return filterNativeEvent("", message, 0); }
+ QT_DEPRECATED bool filterEvent(void *message)
+ { return filterNativeEvent("", message, Q_NULLPTR); }
#endif
Q_SIGNALS:
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index aa08a23f6b..72645b4d9b 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -2131,7 +2131,6 @@ QString QCoreApplication::applicationFilePath()
QCoreApplicationPrivate::setApplicationFilePath(fi.canonicalFilePath());
return *QCoreApplicationPrivate::cachedApplicationFilePath;
}
- return QString();
}
#endif
#if defined( Q_OS_UNIX )
@@ -2177,9 +2176,8 @@ QString QCoreApplication::applicationFilePath()
}
}
- return QString();
#endif
- Q_UNREACHABLE();
+ return QString();
}
/*!
diff --git a/src/corelib/kernel/qcoreapplication_win.cpp b/src/corelib/kernel/qcoreapplication_win.cpp
index 342e6227f2..67261645ac 100644
--- a/src/corelib/kernel/qcoreapplication_win.cpp
+++ b/src/corelib/kernel/qcoreapplication_win.cpp
@@ -55,7 +55,10 @@ QT_BEGIN_NAMESPACE
int appCmdShow = 0;
-#if defined(Q_OS_WINRT)
+// GetModuleFileName only exists for MSVC2015 and upwards for WinRT, meaning
+// Windows 10 (Mobile). Hence take the first argument passed to the
+// QCoreApplication contructor for older versions as a fallback on older platforms.
+#if defined(Q_OS_WINRT) && _MSC_VER < 1900
Q_CORE_EXPORT QString qAppFileName()
{
@@ -67,27 +70,7 @@ QString QCoreApplicationPrivate::appName() const
return QFileInfo(QCoreApplication::arguments().constFirst()).baseName();
}
-#else
-
-Q_CORE_EXPORT HINSTANCE qWinAppInst() // get Windows app handle
-{
- return GetModuleHandle(0);
-}
-
-Q_CORE_EXPORT HINSTANCE qWinAppPrevInst() // get Windows prev app handle
-{
- return 0;
-}
-
-Q_CORE_EXPORT int qWinAppCmdShow() // get main window show command
-{
- STARTUPINFO startupInfo;
- GetStartupInfo(&startupInfo);
-
- return (startupInfo.dwFlags & STARTF_USESHOWWINDOW)
- ? startupInfo.wShowWindow
- : SW_SHOWDEFAULT;
-}
+#else // !(defined(Q_OS_WINRT) && _MSC_VER < 1900)
Q_CORE_EXPORT QString qAppFileName() // get application file name
{
@@ -135,6 +118,34 @@ QString QCoreApplicationPrivate::appName() const
return QFileInfo(qAppFileName()).baseName();
}
+#endif // !(defined(Q_OS_WINRT) && _MSC_VER < 1900)
+
+#ifndef Q_OS_WINRT
+
+Q_CORE_EXPORT HINSTANCE qWinAppInst() // get Windows app handle
+{
+ return GetModuleHandle(0);
+}
+
+Q_CORE_EXPORT HINSTANCE qWinAppPrevInst() // get Windows prev app handle
+{
+ return 0;
+}
+
+Q_CORE_EXPORT int qWinAppCmdShow() // get main window show command
+{
+#if defined(Q_OS_WINCE)
+ return appCmdShow;
+#else
+ STARTUPINFO startupInfo;
+ GetStartupInfo(&startupInfo);
+
+ return (startupInfo.dwFlags & STARTF_USESHOWWINDOW)
+ ? startupInfo.wShowWindow
+ : SW_SHOWDEFAULT;
+#endif
+}
+
/*****************************************************************************
qWinMain() - Initializes Windows. Called from WinMain() in qtmain_win.cpp
*****************************************************************************/
diff --git a/src/corelib/kernel/qfunctions_winrt.h b/src/corelib/kernel/qfunctions_winrt.h
index 4012f8019c..e0777b8df8 100644
--- a/src/corelib/kernel/qfunctions_winrt.h
+++ b/src/corelib/kernel/qfunctions_winrt.h
@@ -211,6 +211,9 @@ static inline HRESULT _await_impl(const Microsoft::WRL::ComPtr<T> &asyncOp, Awai
hr = asyncInfo->get_ErrorCode(&ec);
if (FAILED(hr))
return hr;
+ hr = asyncInfo->Close();
+ if (FAILED(hr))
+ return hr;
return ec;
}
diff --git a/src/corelib/kernel/qmetaobject.h b/src/corelib/kernel/qmetaobject.h
index 4d114a5616..c2451630b1 100644
--- a/src/corelib/kernel/qmetaobject.h
+++ b/src/corelib/kernel/qmetaobject.h
@@ -183,7 +183,7 @@ private:
// signature() has been renamed to methodSignature() in Qt 5.
// Warning, that function returns a QByteArray; check the life time if
// you convert to char*.
- char *signature(struct renamedInQt5_warning_checkTheLifeTime * = 0) Q_DECL_EQ_DELETE;
+ char *signature(struct renamedInQt5_warning_checkTheLifeTime * = Q_NULLPTR) Q_DECL_EQ_DELETE;
#endif
static QMetaMethod fromSignalImpl(const QMetaObject *, void **);
diff --git a/src/corelib/kernel/qppsobject.cpp b/src/corelib/kernel/qppsobject.cpp
index f716c1a92e..dd01d48cc0 100644
--- a/src/corelib/kernel/qppsobject.cpp
+++ b/src/corelib/kernel/qppsobject.cpp
@@ -175,7 +175,7 @@ QPpsAttribute QPpsObjectPrivate::decodeNumber(pps_decoder_t *decoder)
// In order to support more number types, we have to do something stupid because the PPS
// library won't let us work any other way. Basically, we have to probe the encoded type in
// order to try to get exactly what we want.
- long long llValue;
+ int64_t llValue;
double dValue;
int iValue;
QPpsAttribute::Flags flags;
@@ -193,7 +193,7 @@ QPpsAttribute QPpsObjectPrivate::decodeNumber(pps_decoder_t *decoder)
return QPpsAttribute();
}
flags = readFlags(decoder);
- return QPpsAttributePrivate::createPpsAttribute(llValue, flags);
+ return QPpsAttributePrivate::createPpsAttribute(static_cast<long long>(llValue), flags);
default:
qWarning("QPpsObjectPrivate::decodeNumber: pps_decoder_get_int failed");
return QPpsAttribute();