diff options
author | Liang Qi <liang.qi@qt.io> | 2017-03-28 09:23:03 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-03-28 09:28:31 +0200 |
commit | b48a13fd6843e12b5725aa3ff0d010007e7c43b4 (patch) | |
tree | 316cfe36fc67906efcd92ff806c7c0da56ed4f8e /src/gui | |
parent | 3398d9d40cb0dae2dc2a1a4f7dc3b4b9cceae903 (diff) | |
parent | 15fe60cfdada84ea519f08e905d59cc3fb6d20cd (diff) |
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts:
examples/examples.pro
tests/auto/corelib/tools/qchar/tst_qchar.cpp
tests/auto/other/qaccessibility/accessiblewidgets.h
Change-Id: I426696c40ab57d14dc295b8103152cede79f244c
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/configure.json | 5 | ||||
-rw-r--r-- | src/gui/image/qxbmhandler.cpp | 2 | ||||
-rw-r--r-- | src/gui/kernel/qguivariant.cpp | 1 | ||||
-rw-r--r-- | src/gui/kernel/qwindow.cpp | 17 | ||||
-rw-r--r-- | src/gui/kernel/qwindow_p.h | 2 |
5 files changed, 18 insertions, 9 deletions
diff --git a/src/gui/configure.json b/src/gui/configure.json index 5163045343..91e6bebc7f 100644 --- a/src/gui/configure.json +++ b/src/gui/configure.json @@ -164,7 +164,9 @@ { "libs": "-llibpng", "condition": "config.msvc" }, { "libs": "-lpng", "condition": "!config.msvc" } ], - "use": "zlib" + "use": [ + { "lib": "zlib", "condition": "features.system-zlib" } + ] }, "mirclient": { "label": "Mir client libraries", @@ -703,6 +705,7 @@ "label": " Using system libpng", "disable": "input.libpng == 'qt'", "enable": "input.libpng == 'system'", + "autoDetect": "features.system-zlib", "condition": "features.png && libs.libpng", "output": [ "privateFeature" ] }, diff --git a/src/gui/image/qxbmhandler.cpp b/src/gui/image/qxbmhandler.cpp index 19015c5dcd..155a4f88b4 100644 --- a/src/gui/image/qxbmhandler.cpp +++ b/src/gui/image/qxbmhandler.cpp @@ -143,6 +143,8 @@ static bool read_xbm_body(QIODevice *device, int w, int h, QImage *outImage) return false; } + outImage->fill(Qt::color0); // in case the image data does not cover the full image + outImage->setColorCount(2); outImage->setColor(0, qRgb(255,255,255)); // white outImage->setColor(1, qRgb(0,0,0)); // black diff --git a/src/gui/kernel/qguivariant.cpp b/src/gui/kernel/qguivariant.cpp index bde0d20ea8..090217187e 100644 --- a/src/gui/kernel/qguivariant.cpp +++ b/src/gui/kernel/qguivariant.cpp @@ -291,6 +291,7 @@ static bool convert(const QVariant::Private *d, int t, default: break; } + break; } #endif #ifndef QT_NO_ICON diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 8471102aee..3f5f71002b 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -2735,26 +2735,29 @@ void QWindowPrivate::setCursor(const QCursor *newCursor) cursor = QCursor(Qt::ArrowCursor); hasCursor = false; } - // Only attempt to set cursor and emit signal if there is an actual platform cursor - QScreen* screen = q->screen(); - if (screen && screen->handle()->cursor()) { - applyCursor(); + // Only attempt to emit signal if there is an actual platform cursor + if (applyCursor()) { QEvent event(QEvent::CursorChange); QGuiApplication::sendEvent(q, &event); } } -void QWindowPrivate::applyCursor() +// Apply the cursor and returns true iff the platform cursor exists +bool QWindowPrivate::applyCursor() { Q_Q(QWindow); - if (platformWindow) { - if (QPlatformCursor *platformCursor = q->screen()->handle()->cursor()) { + if (QScreen *screen = q->screen()) { + if (QPlatformCursor *platformCursor = screen->handle()->cursor()) { + if (!platformWindow) + return true; QCursor *c = QGuiApplication::overrideCursor(); if (!c && hasCursor) c = &cursor; platformCursor->changeCursor(c, q); + return true; } } + return false; } #endif // QT_NO_CURSOR diff --git a/src/gui/kernel/qwindow_p.h b/src/gui/kernel/qwindow_p.h index e8d5830eee..cffe5b4125 100644 --- a/src/gui/kernel/qwindow_p.h +++ b/src/gui/kernel/qwindow_p.h @@ -121,7 +121,7 @@ public: void maybeQuitOnLastWindowClosed(); #ifndef QT_NO_CURSOR void setCursor(const QCursor *c = 0); - void applyCursor(); + bool applyCursor(); #endif void deliverUpdateRequest(); |