diff options
author | Liang Qi <liang.qi@qt.io> | 2017-11-30 12:57:22 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2017-11-30 12:57:22 +0000 |
commit | c35342ffeba10deecb2d8c0ce30a3a1a4ec1ee8d (patch) | |
tree | 0b7782b3d8973d20ee4db36f768367b94e3d3394 /src/gui | |
parent | 7200572b393534a2f503b810180276d2ae809c7a (diff) | |
parent | 87204c856ae3d8495c41af998ac196a12fe1c779 (diff) |
Merge "Merge remote-tracking branch 'origin/5.10' into dev" into refs/staging/dev
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/image/qimage.h | 2 | ||||
-rw-r--r-- | src/gui/image/qplatformpixmap.cpp | 3 | ||||
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface.cpp | 4 | ||||
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface.h | 1 |
4 files changed, 7 insertions, 3 deletions
diff --git a/src/gui/image/qimage.h b/src/gui/image/qimage.h index 11ad9b7510..5f2965042f 100644 --- a/src/gui/image/qimage.h +++ b/src/gui/image/qimage.h @@ -215,7 +215,7 @@ public: const uchar *constBits() const; #if QT_DEPRECATED_SINCE(5, 10) - QT_DEPRECATED int byteCount() const; + QT_DEPRECATED_X("Use sizeInBytes") int byteCount() const; #endif qssize_t sizeInBytes() const; diff --git a/src/gui/image/qplatformpixmap.cpp b/src/gui/image/qplatformpixmap.cpp index b123afb4db..2209c3de4d 100644 --- a/src/gui/image/qplatformpixmap.cpp +++ b/src/gui/image/qplatformpixmap.cpp @@ -58,6 +58,9 @@ QT_BEGIN_NAMESPACE */ QPlatformPixmap *QPlatformPixmap::create(int w, int h, PixelType type) { + if (Q_UNLIKELY(!QGuiApplicationPrivate::platformIntegration())) + qFatal("QPlatformPixmap: QGuiApplication required"); + QPlatformPixmap *data = QGuiApplicationPrivate::platformIntegration()->createPlatformPixmap(static_cast<QPlatformPixmap::PixelType>(type)); data->resize(w, h); return data; diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp index a065e254df..a47bac8f39 100644 --- a/src/gui/kernel/qwindowsysteminterface.cpp +++ b/src/gui/kernel/qwindowsysteminterface.cpp @@ -265,12 +265,12 @@ void QWindowSystemInterface::handleWindowScreenChanged(QWindow *window, QScreen QWindowSystemInterfacePrivate::handleWindowSystemEvent(e); } -void QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationState newState, bool forcePropagate) +QT_DEFINE_QPA_EVENT_HANDLER(void, handleApplicationStateChanged, Qt::ApplicationState newState, bool forcePropagate) { Q_ASSERT(QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::ApplicationState)); QWindowSystemInterfacePrivate::ApplicationStateChangedEvent *e = new QWindowSystemInterfacePrivate::ApplicationStateChangedEvent(newState, forcePropagate); - QWindowSystemInterfacePrivate::handleWindowSystemEvent(e); + QWindowSystemInterfacePrivate::handleWindowSystemEvent<Delivery>(e); } QWindowSystemInterfacePrivate::GeometryChangeEvent::GeometryChangeEvent(QWindow *window, const QRect &newGeometry) diff --git a/src/gui/kernel/qwindowsysteminterface.h b/src/gui/kernel/qwindowsysteminterface.h index e027157fac..960f79b5ba 100644 --- a/src/gui/kernel/qwindowsysteminterface.h +++ b/src/gui/kernel/qwindowsysteminterface.h @@ -207,6 +207,7 @@ public: static void handleWindowStateChanged(QWindow *window, Qt::WindowStates newState, int oldState = -1); static void handleWindowScreenChanged(QWindow *window, QScreen *newScreen); + template<typename Delivery = QWindowSystemInterface::DefaultDelivery> static void handleApplicationStateChanged(Qt::ApplicationState newState, bool forcePropagate = false); #ifndef QT_NO_DRAGANDDROP |