summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-06-28 01:00:23 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-06-28 01:00:23 +0200
commit7265fb0597a52692ffeb455a3da1271903b8cd58 (patch)
tree096426673daaac690735a86b10a26c2e625cd424 /src
parent0d6b4b519272915c2690ee12d1834823747233ab (diff)
parent2a756e294e2efa4bcb2b51afd1c20822df251f29 (diff)
Merge remote-tracking branch 'origin/5.12' into 5.13
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp4
-rw-r--r--src/angle/patches/0015-ANGLE-Invalidate-client-window-area-when-resizing-sw.patch37
-rw-r--r--src/corelib/serialization/qjsonwriter.cpp6
-rw-r--r--src/gui/image/qpnghandler.cpp2
-rw-r--r--src/gui/kernel/qguiapplication.cpp5
-rw-r--r--src/gui/kernel/qhighdpiscaling.cpp50
-rw-r--r--src/gui/kernel/qhighdpiscaling_p.h37
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp12
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp7
-rw-r--r--src/platformsupport/vkconvenience/qvkconvenience.cpp215
-rw-r--r--src/platformsupport/vkconvenience/qvkconvenience_p.h67
-rw-r--r--src/platformsupport/vkconvenience/vkconvenience.pro2
-rw-r--r--src/plugins/platforms/android/qandroidplatformtheme.cpp2
-rw-r--r--src/plugins/platforms/cocoa/qcocoaintegration.mm19
-rw-r--r--src/widgets/kernel/qshortcut.cpp13
15 files changed, 419 insertions, 59 deletions
diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp
index dcfd06484d..e8f13b388f 100644
--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp
+++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp
@@ -504,6 +504,10 @@ EGLint SwapChain11::resize(const gl::Context *context,
ASSERT(SUCCEEDED(result));
if (SUCCEEDED(result))
{
+#ifndef ANGLE_ENABLE_WINDOWS_STORE
+ if (mNativeWindow->getNativeWindow())
+ InvalidateRect(mNativeWindow->getNativeWindow(), nullptr, FALSE);
+#endif
const auto &format =
d3d11::Format::Get(mOffscreenRenderTargetFormat, mRenderer->getRenderer11DeviceCaps());
mBackBufferTexture.set(backbufferTexture, format);
diff --git a/src/angle/patches/0015-ANGLE-Invalidate-client-window-area-when-resizing-sw.patch b/src/angle/patches/0015-ANGLE-Invalidate-client-window-area-when-resizing-sw.patch
new file mode 100644
index 0000000000..9380437761
--- /dev/null
+++ b/src/angle/patches/0015-ANGLE-Invalidate-client-window-area-when-resizing-sw.patch
@@ -0,0 +1,37 @@
+From 7d300c6e7d05f4e31c966f1298d11da3eae9d679 Mon Sep 17 00:00:00 2001
+From: Val Doroshchuk <valentyn.doroshchuk@qt.io>
+Date: Fri, 21 Jun 2019 11:24:06 +0200
+Subject: [PATCH] ANGLE: Invalidate client window area when resizing swap chain
+
+Inspired by:
+https://codereview.appspot.com/6812076/
+Resizing a window larger results in the newly exposed region being invalidated
+but the old region is treated as valid.
+This can result in the old region no longer updating.
+Was added to D3D9.
+
+Improving a fix from Filippo Cucchetto:
+https://codereview.qt-project.org/c/qt/qtbase/+/195336
+and pushing to D3D11.
+
+ifndef protects against compilation error for WinRT.
+Invalidate() should be used only for desktop apps.
+
+diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp
+index dcfd06484d..e8f13b388f 100644
+--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp
++++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp
+@@ -504,6 +504,10 @@ EGLint SwapChain11::resize(const gl::Context *context,
+ ASSERT(SUCCEEDED(result));
+ if (SUCCEEDED(result))
+ {
++#ifndef ANGLE_ENABLE_WINDOWS_STORE
++ if (mNativeWindow->getNativeWindow())
++ InvalidateRect(mNativeWindow->getNativeWindow(), nullptr, FALSE);
++#endif
+ const auto &format =
+ d3d11::Format::Get(mOffscreenRenderTargetFormat, mRenderer->getRenderer11DeviceCaps());
+ mBackBufferTexture.set(backbufferTexture, format);
+--
+2.14.2.windows.1
+
diff --git a/src/corelib/serialization/qjsonwriter.cpp b/src/corelib/serialization/qjsonwriter.cpp
index 5b246837d2..012d3bea86 100644
--- a/src/corelib/serialization/qjsonwriter.cpp
+++ b/src/corelib/serialization/qjsonwriter.cpp
@@ -43,6 +43,7 @@
#include "qjsonwriter_p.h"
#include "qjson_p.h"
#include "private/qutfcodec_p.h"
+#include <private/qnumeric_p.h>
QT_BEGIN_NAMESPACE
@@ -135,8 +136,9 @@ static void valueToJson(const QJsonPrivate::Base *b, const QJsonPrivate::Value &
case QJsonValue::Double: {
const double d = v.toDouble(b);
if (qIsFinite(d)) { // +2 to format to ensure the expected precision
- const double abs = std::abs(d);
- json += QByteArray::number(d, abs == static_cast<quint64>(abs) ? 'f' : 'g', QLocale::FloatingPointShortest);
+ quint64 absInt;
+ json += QByteArray::number(d, convertDoubleTo(std::abs(d), &absInt) ? 'f' : 'g',
+ QLocale::FloatingPointShortest);
} else {
json += "null"; // +INF || -INF || NaN (see RFC4627#section2.4)
}
diff --git a/src/gui/image/qpnghandler.cpp b/src/gui/image/qpnghandler.cpp
index 1c269213e2..f1b25f07a7 100644
--- a/src/gui/image/qpnghandler.cpp
+++ b/src/gui/image/qpnghandler.cpp
@@ -406,7 +406,7 @@ void setup_qt(QImage& image, png_structp png_ptr, png_infop info_ptr, QSize scal
}
QSize outSize(width,height);
if (!scaledSize.isEmpty() && quint32(scaledSize.width()) <= width &&
- quint32(scaledSize.height()) <= height && interlace_method == PNG_INTERLACE_NONE) {
+ quint32(scaledSize.height()) <= height && scaledSize != outSize && interlace_method == PNG_INTERLACE_NONE) {
// Do inline downscaling
outSize = scaledSize;
if (doScaledRead)
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index e88fcdb55a..f6e67e05d0 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -3206,9 +3206,12 @@ void QGuiApplication::setPalette(const QPalette &pal)
QGuiApplicationPrivate::app_pal = new QPalette(pal);
else
*QGuiApplicationPrivate::app_pal = pal;
+
applicationResourceFlags |= ApplicationPaletteExplicitlySet;
QCoreApplication::setAttribute(Qt::AA_SetPalette);
- emit qGuiApp->paletteChanged(*QGuiApplicationPrivate::app_pal);
+
+ if (qGuiApp)
+ emit qGuiApp->paletteChanged(*QGuiApplicationPrivate::app_pal);
}
void QGuiApplicationPrivate::applyWindowGeometrySpecificationTo(QWindow *window)
diff --git a/src/gui/kernel/qhighdpiscaling.cpp b/src/gui/kernel/qhighdpiscaling.cpp
index 93fcb1a216..0fea416404 100644
--- a/src/gui/kernel/qhighdpiscaling.cpp
+++ b/src/gui/kernel/qhighdpiscaling.cpp
@@ -452,52 +452,30 @@ QDpi QHighDpiScaling::logicalDpi()
return m_logicalDpi;
}
-qreal QHighDpiScaling::factor(const QScreen *screen)
+QHighDpiScaling::ScaleAndOrigin QHighDpiScaling::scaleAndOrigin(const QPlatformScreen *platformScreen, QPoint *nativePosition)
{
- // Fast path for when scaling in Qt is not used at all.
if (!m_active)
- return qreal(1.0);
-
- // The effective factor for a given screen is the product of the
- // screen and global sub-factors
- qreal factor = m_factor;
- if (screen)
- factor *= screenSubfactor(screen->handle());
- return factor;
+ return { qreal(1), QPoint() };
+ const QPlatformScreen *actualScreen = nativePosition ?
+ platformScreen->screenForPosition(*nativePosition) : platformScreen;
+ return { m_factor * screenSubfactor(actualScreen), actualScreen->geometry().topLeft() };
}
-qreal QHighDpiScaling::factor(const QPlatformScreen *platformScreen)
+QHighDpiScaling::ScaleAndOrigin QHighDpiScaling::scaleAndOrigin(const QScreen *screen, QPoint *nativePosition)
{
if (!m_active)
- return qreal(1.0);
-
- return m_factor * screenSubfactor(platformScreen);
+ return { qreal(1), QPoint() };
+ if (!screen)
+ return { m_factor, QPoint() }; // the global factor
+ return scaleAndOrigin(screen->handle(), nativePosition);
}
-qreal QHighDpiScaling::factor(const QWindow *window)
+QHighDpiScaling::ScaleAndOrigin QHighDpiScaling::scaleAndOrigin(const QWindow *window, QPoint *nativePosition)
{
if (!m_active)
- return qreal(1.0);
-
- return factor(window ? window->screen() : QGuiApplication::primaryScreen());
-}
-
-QPoint QHighDpiScaling::origin(const QScreen *screen)
-{
- return screen->geometry().topLeft();
-}
-
-QPoint QHighDpiScaling::origin(const QPlatformScreen *platformScreen)
-{
- return platformScreen->geometry().topLeft();
-}
-
-QPoint QHighDpiScaling::origin(const QWindow *window)
-{
- if (window && window->isTopLevel() && window->screen())
- return window->screen()->geometry().topLeft();
-
- return QPoint(0, 0);
+ return { qreal(1), QPoint() };
+ QScreen *screen = window ? window->screen() : QGuiApplication::primaryScreen();
+ return scaleAndOrigin(screen, nativePosition);
}
#endif //QT_NO_HIGHDPISCALING
diff --git a/src/gui/kernel/qhighdpiscaling_p.h b/src/gui/kernel/qhighdpiscaling_p.h
index 525e3fe78e..3410c1d345 100644
--- a/src/gui/kernel/qhighdpiscaling_p.h
+++ b/src/gui/kernel/qhighdpiscaling_p.h
@@ -78,14 +78,23 @@ public:
static void setScreenFactor(QScreen *window, qreal factor);
static bool isActive() { return m_active; }
- static qreal factor(const QWindow *window);
- static qreal factor(const QScreen *screen);
- static qreal factor(const QPlatformScreen *platformScreen);
- static QPoint origin(const QScreen *screen);
- static QPoint origin(const QPlatformScreen *platformScreen);
- static QPoint origin(const QWindow *window);
- static QPoint mapPositionToNative(const QPoint &pos, const QPlatformScreen *platformScreen);
+
+ struct ScaleAndOrigin
+ {
+ qreal factor;
+ QPoint origin;
+ };
+ static ScaleAndOrigin scaleAndOrigin(const QPlatformScreen *platformScreen, QPoint *nativePosition = nullptr);
+ static ScaleAndOrigin scaleAndOrigin(const QScreen *screen, QPoint *nativePosition = nullptr);
+ static ScaleAndOrigin scaleAndOrigin(const QWindow *platformScreen, QPoint *nativePosition = nullptr);
+
+ template<typename C>
+ static qreal factor(C *context, QPoint *nativePosition = nullptr) {
+ return scaleAndOrigin(context, nativePosition).factor;
+ }
+
static QPoint mapPositionFromNative(const QPoint &pos, const QPlatformScreen *platformScreen);
+ static QPoint mapPositionToNative(const QPoint &pos, const QPlatformScreen *platformScreen);
static QPoint mapPositionToGlobal(const QPoint &pos, const QPoint &windowGlobalPosition, const QWindow *window);
static QPoint mapPositionFromGlobal(const QPoint &pos, const QPoint &windowGlobalPosition, const QWindow *window);
static QDpi logicalDpi();
@@ -166,16 +175,26 @@ inline QRegion scale(const QRegion &region, qreal scaleFactor, QPoint origin = Q
return scaled;
}
+template <typename T>
+inline QPoint position(T) { return QPoint(); }
+inline QPoint position(QPoint point) { return point; }
+inline QPoint position(QPointF point) { return point.toPoint(); }
+inline QPoint position(QRect rect) { return rect.center(); }
+inline QPoint position(QRectF rect) { return rect.center().toPoint(); }
+
template <typename T, typename C>
T fromNativePixels(const T &value, const C *context)
{
- return scale(value, qreal(1) / QHighDpiScaling::factor(context), QHighDpiScaling::origin(context));
+ QPoint nativePosition = position(value);
+ QHighDpiScaling::ScaleAndOrigin so = QHighDpiScaling::scaleAndOrigin(context, &nativePosition);
+ return scale(value, qreal(1) / so.factor, so.origin);
}
template <typename T, typename C>
T toNativePixels(const T &value, const C *context)
{
- return scale(value, QHighDpiScaling::factor(context), QHighDpiScaling::origin(context));
+ QHighDpiScaling::ScaleAndOrigin so = QHighDpiScaling::scaleAndOrigin(context);
+ return scale(value, so.factor, so.origin);
}
template <typename T, typename C>
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
index 681d84fee8..9b1e63520d 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
@@ -1540,19 +1540,21 @@ void QHttpNetworkConnectionPrivate::emitProxyAuthenticationRequired(const QHttpN
// dialog is displaying
pauseConnection();
QHttpNetworkReply *reply;
-#ifndef QT_NO_SSL
- if (connectionType == QHttpNetworkConnection::ConnectionTypeSPDY) {
+ if (connectionType == QHttpNetworkConnection::ConnectionTypeHTTP2
+ || connectionType == QHttpNetworkConnection::ConnectionTypeHTTP2Direct
+#if QT_CONFIG(ssl)
+ || connectionType == QHttpNetworkConnection::ConnectionTypeSPDY
+#endif
+ ) {
+
// we choose the reply to emit the proxyAuth signal from somewhat arbitrarily,
// but that does not matter because the signal will ultimately be emitted
// by the QNetworkAccessManager.
Q_ASSERT(chan->spdyRequestsToSend.count() > 0);
reply = chan->spdyRequestsToSend.cbegin().value().second;
} else { // HTTP
-#endif // QT_NO_SSL
reply = chan->reply;
-#ifndef QT_NO_SSL
}
-#endif // QT_NO_SSL
Q_ASSERT(reply);
emit reply->proxyAuthenticationRequired(proxy, auth);
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index f79a4d1dc6..2e9ec2d35b 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -207,6 +207,9 @@ void QHttpNetworkConnectionChannel::init()
void QHttpNetworkConnectionChannel::close()
{
+ if (state == QHttpNetworkConnectionChannel::ClosingState)
+ return;
+
if (!socket)
state = QHttpNetworkConnectionChannel::IdleState;
else if (socket->state() == QAbstractSocket::UnconnectedState)
@@ -1113,11 +1116,13 @@ void QHttpNetworkConnectionChannel::_q_error(QAbstractSocket::SocketError socket
void QHttpNetworkConnectionChannel::_q_proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator* auth)
{
if (connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2
+ || connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2Direct
#ifndef QT_NO_SSL
|| connection->connectionType() == QHttpNetworkConnection::ConnectionTypeSPDY
#endif
) {
- connection->d_func()->emitProxyAuthenticationRequired(this, proxy, auth);
+ if (spdyRequestsToSend.count() > 0)
+ connection->d_func()->emitProxyAuthenticationRequired(this, proxy, auth);
} else { // HTTP
// Need to dequeue the request before we can emit the error.
if (!reply)
diff --git a/src/platformsupport/vkconvenience/qvkconvenience.cpp b/src/platformsupport/vkconvenience/qvkconvenience.cpp
new file mode 100644
index 0000000000..462cdc9e0d
--- /dev/null
+++ b/src/platformsupport/vkconvenience/qvkconvenience.cpp
@@ -0,0 +1,215 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qvkconvenience_p.h"
+
+#include <QOpenGLTexture>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QVkConvenience
+ \brief A collection of static helper functions for Vulkan support
+ \since 5.14
+ \internal
+ \ingroup qpa
+ */
+
+VkFormat QVkConvenience::vkFormatFromGlFormat(uint glFormat)
+{
+ using GlFormat = QOpenGLTexture::TextureFormat;
+ switch (glFormat) {
+ case GlFormat::NoFormat: return VK_FORMAT_UNDEFINED; // GL_NONE
+
+ // Unsigned normalized formats
+ case GlFormat::R8_UNorm: return VK_FORMAT_R8_UNORM; // GL_R8
+ case GlFormat::RG8_UNorm: return VK_FORMAT_R8G8_UNORM; // GL_RG8
+ case GlFormat::RGB8_UNorm: return VK_FORMAT_R8G8B8_UNORM; // GL_RGB8
+ case GlFormat::RGBA8_UNorm: return VK_FORMAT_R8G8B8A8_UNORM; // GL_RGBA8
+
+ case GlFormat::R16_UNorm: return VK_FORMAT_R16_UNORM; // GL_R16
+ case GlFormat::RG16_UNorm: return VK_FORMAT_R16G16_UNORM; // GL_RG16
+ case GlFormat::RGB16_UNorm: return VK_FORMAT_R16G16B16_UNORM; // GL_RGB16
+ case GlFormat::RGBA16_UNorm: return VK_FORMAT_R16G16B16A16_UNORM; // GL_RGBA16
+
+ // Signed normalized formats
+ case GlFormat::R8_SNorm: return VK_FORMAT_R8_SNORM; // GL_R8_SNORM
+ case GlFormat::RG8_SNorm: return VK_FORMAT_R8G8_SNORM; // GL_RG8_SNORM
+ case GlFormat::RGB8_SNorm: return VK_FORMAT_R8G8B8_SNORM; // GL_RGB8_SNORM
+ case GlFormat::RGBA8_SNorm: return VK_FORMAT_R8G8B8A8_SNORM; // GL_RGBA8_SNORM
+
+ case GlFormat::R16_SNorm: return VK_FORMAT_R16_SNORM; // GL_R16_SNORM
+ case GlFormat::RG16_SNorm: return VK_FORMAT_R16G16_SNORM; // GL_RG16_SNORM
+ case GlFormat::RGB16_SNorm: return VK_FORMAT_R16G16B16_SNORM; // GL_RGB16_SNORM
+ case GlFormat::RGBA16_SNorm: return VK_FORMAT_R16G16B16A16_SNORM; // GL_RGBA16_SNORM
+
+ // Unsigned integer formats
+ case GlFormat::R8U: return VK_FORMAT_R8_UINT; // GL_R8UI
+ case GlFormat::RG8U: return VK_FORMAT_R8G8_UINT; // GL_RG8UI
+ case GlFormat::RGB8U: return VK_FORMAT_R8G8B8_UINT; // GL_RGB8UI
+ case GlFormat::RGBA8U: return VK_FORMAT_R8G8B8A8_UINT; // GL_RGBA8UI
+
+ case GlFormat::R16U: return VK_FORMAT_R16_UINT; // GL_R16UI
+ case GlFormat::RG16U: return VK_FORMAT_R16G16_UINT; // GL_RG16UI
+ case GlFormat::RGB16U: return VK_FORMAT_R16G16B16_UINT; // GL_RGB16UI
+ case GlFormat::RGBA16U: return VK_FORMAT_R16G16B16A16_UINT; // GL_RGBA16UI
+
+ case GlFormat::R32U: return VK_FORMAT_R32_UINT; // GL_R32UI
+ case GlFormat::RG32U: return VK_FORMAT_R32G32_UINT; // GL_RG32UI
+ case GlFormat::RGB32U: return VK_FORMAT_R32G32B32_UINT; // GL_RGB32UI
+ case GlFormat::RGBA32U: return VK_FORMAT_R32G32B32A32_UINT; // GL_RGBA32UI
+
+ // Signed integer formats
+ case GlFormat::R8I: return VK_FORMAT_R8_SINT; // GL_R8I
+ case GlFormat::RG8I: return VK_FORMAT_R8G8_SINT; // GL_RG8I
+ case GlFormat::RGB8I: return VK_FORMAT_R8G8B8_SINT; // GL_RGB8I
+ case GlFormat::RGBA8I: return VK_FORMAT_R8G8B8A8_SINT; // GL_RGBA8I
+
+ case GlFormat::R16I: return VK_FORMAT_R16_SINT; // GL_R16I
+ case GlFormat::RG16I: return VK_FORMAT_R16G16_SINT; // GL_RG16I
+ case GlFormat::RGB16I: return VK_FORMAT_R16G16B16_SINT; // GL_RGB16I
+ case GlFormat::RGBA16I: return VK_FORMAT_R16G16B16A16_SINT; // GL_RGBA16I
+
+ case GlFormat::R32I: return VK_FORMAT_R32_SINT; // GL_R32I
+ case GlFormat::RG32I: return VK_FORMAT_R32G32_SINT; // GL_RG32I
+ case GlFormat::RGB32I: return VK_FORMAT_R32G32B32_SINT; // GL_RGB32I
+ case GlFormat::RGBA32I: return VK_FORMAT_R32G32B32A32_SINT; // GL_RGBA32I
+
+ // Floating point formats
+ case GlFormat::R16F: return VK_FORMAT_R16_SFLOAT; // GL_R16F
+ case GlFormat::RG16F: return VK_FORMAT_R16G16_SFLOAT; // GL_RG16F
+ case GlFormat::RGB16F: return VK_FORMAT_R16G16B16_SFLOAT; // GL_RGB16F
+ case GlFormat::RGBA16F: return VK_FORMAT_R16G16B16A16_SFLOAT; // GL_RGBA16F
+
+ case GlFormat::R32F: return VK_FORMAT_R32_SFLOAT; // GL_R32F
+ case GlFormat::RG32F: return VK_FORMAT_R32G32_SFLOAT; // GL_RG32F
+ case GlFormat::RGB32F: return VK_FORMAT_R32G32B32_SFLOAT; // GL_RGB32F
+ case GlFormat::RGBA32F: return VK_FORMAT_R32G32B32A32_SFLOAT; // GL_RGBA32F
+
+ // Packed formats
+ case GlFormat::RGB9E5: return VK_FORMAT_E5B9G9R9_UFLOAT_PACK32; // GL_RGB9_E5
+ case GlFormat::RG11B10F: return VK_FORMAT_B10G11R11_UFLOAT_PACK32; // GL_R11F_G11F_B10F
+// case GlFormat::RG3B2: return VK_FORMAT_R3_G3_B2; // GL_R3_G3_B2
+ case GlFormat::R5G6B5: return VK_FORMAT_R5G6B5_UNORM_PACK16; // GL_RGB565
+ case GlFormat::RGB5A1: return VK_FORMAT_R5G5B5A1_UNORM_PACK16; // GL_RGB5_A1
+ case GlFormat::RGBA4: return VK_FORMAT_R4G4B4A4_UNORM_PACK16; // GL_RGBA4
+ case GlFormat::RGB10A2: return VK_FORMAT_A2R10G10B10_UINT_PACK32; // GL_RGB10_A2UI
+
+ // Depth formats
+// case Format::D16: return VK_FORMAT_DEPTH_COMPONENT16; // GL_DEPTH_COMPONENT16
+// case Format::D24: return VK_FORMAT_DEPTH_COMPONENT24; // GL_DEPTH_COMPONENT24
+// case Format::D24S8: return VK_FORMAT_DEPTH24_STENCIL8; // GL_DEPTH24_STENCIL8
+// case Format::D32: return VK_FORMAT_DEPTH_COMPONENT32; // GL_DEPTH_COMPONENT32
+// case Format::D32F: return VK_FORMAT_DEPTH_COMPONENT32F; // GL_DEPTH_COMPONENT32F
+// case Format::D32FS8X24: return VK_FORMAT_DEPTH32F_STENCIL8; // GL_DEPTH32F_STENCIL8
+// case Format::S8: return VK_FORMAT_STENCIL_INDEX8; // GL_STENCIL_INDEX8
+
+ // Compressed formats
+ case GlFormat::RGB_DXT1: return VK_FORMAT_BC1_RGB_UNORM_BLOCK; // GL_COMPRESSED_RGB_S3TC_DXT1_EXT
+ case GlFormat::RGBA_DXT1: return VK_FORMAT_BC1_RGBA_UNORM_BLOCK; // GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
+ case GlFormat::RGBA_DXT3: return VK_FORMAT_BC2_UNORM_BLOCK; // GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
+ case GlFormat::RGBA_DXT5: return VK_FORMAT_BC3_UNORM_BLOCK; // GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
+ case GlFormat::R_ATI1N_UNorm: return VK_FORMAT_BC4_UNORM_BLOCK; // GL_COMPRESSED_RED_RGTC1
+ case GlFormat::R_ATI1N_SNorm: return VK_FORMAT_BC4_SNORM_BLOCK; // GL_COMPRESSED_SIGNED_RED_RGTC1
+ case GlFormat::RG_ATI2N_UNorm: return VK_FORMAT_BC5_UNORM_BLOCK; // GL_COMPRESSED_RG_RGTC2
+ case GlFormat::RG_ATI2N_SNorm: return VK_FORMAT_BC5_SNORM_BLOCK; // GL_COMPRESSED_SIGNED_RG_RGTC2
+ case GlFormat::RGB_BP_UNSIGNED_FLOAT: return VK_FORMAT_BC6H_UFLOAT_BLOCK; // GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB
+ case GlFormat::RGB_BP_SIGNED_FLOAT: return VK_FORMAT_BC6H_SFLOAT_BLOCK; // GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB
+ case GlFormat::RGB_BP_UNorm: return VK_FORMAT_BC7_UNORM_BLOCK; // GL_COMPRESSED_RGBA_BPTC_UNORM_ARB
+ case GlFormat::R11_EAC_UNorm: return VK_FORMAT_EAC_R11_UNORM_BLOCK; // GL_COMPRESSED_R11_EAC
+ case GlFormat::R11_EAC_SNorm: return VK_FORMAT_EAC_R11_SNORM_BLOCK; // GL_COMPRESSED_SIGNED_R11_EAC
+ case GlFormat::RG11_EAC_UNorm: return VK_FORMAT_EAC_R11G11_UNORM_BLOCK; // GL_COMPRESSED_RG11_EAC
+ case GlFormat::RG11_EAC_SNorm: return VK_FORMAT_EAC_R11G11_SNORM_BLOCK; // GL_COMPRESSED_SIGNED_RG11_EAC
+ case GlFormat::RGB8_ETC2: return VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK; // GL_COMPRESSED_RGB8_ETC2
+ case GlFormat::SRGB8_ETC2: return VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK; // GL_COMPRESSED_SRGB8_ETC2
+ case GlFormat::RGB8_PunchThrough_Alpha1_ETC2: return VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK; // GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2
+ case GlFormat::SRGB8_PunchThrough_Alpha1_ETC2: return VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK; // GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2
+ case GlFormat::RGBA8_ETC2_EAC: return VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK; // GL_COMPRESSED_RGBA8_ETC2_EAC
+ case GlFormat::SRGB8_Alpha8_ETC2_EAC: return VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK; // GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC
+// case GlFormat::RGB8_ETC1: return VK_FORMAT_ETC1_RGB8_OES; // GL_ETC1_RGB8_OES
+ case GlFormat::RGBA_ASTC_4x4: return VK_FORMAT_ASTC_4x4_UNORM_BLOCK; // GL_COMPRESSED_RGBA_ASTC_4x4_KHR
+ case GlFormat::RGBA_ASTC_5x4: return VK_FORMAT_ASTC_5x4_UNORM_BLOCK; // GL_COMPRESSED_RGBA_ASTC_5x4_KHR
+ case GlFormat::RGBA_ASTC_5x5: return VK_FORMAT_ASTC_5x5_UNORM_BLOCK; // GL_COMPRESSED_RGBA_ASTC_5x5_KHR
+ case GlFormat::RGBA_ASTC_6x5: return VK_FORMAT_ASTC_6x5_UNORM_BLOCK; // GL_COMPRESSED_RGBA_ASTC_6x5_KHR
+ case GlFormat::RGBA_ASTC_6x6: return VK_FORMAT_ASTC_6x6_UNORM_BLOCK; // GL_COMPRESSED_RGBA_ASTC_6x6_KHR
+ case GlFormat::RGBA_ASTC_8x5: return VK_FORMAT_ASTC_8x5_UNORM_BLOCK; // GL_COMPRESSED_RGBA_ASTC_8x5_KHR
+ case GlFormat::RGBA_ASTC_8x6: return VK_FORMAT_ASTC_8x6_UNORM_BLOCK; // GL_COMPRESSED_RGBA_ASTC_8x6_KHR
+ case GlFormat::RGBA_ASTC_8x8: return VK_FORMAT_ASTC_8x8_UNORM_BLOCK; // GL_COMPRESSED_RGBA_ASTC_8x8_KHR
+ case GlFormat::RGBA_ASTC_10x5: return VK_FORMAT_ASTC_10x5_UNORM_BLOCK; // GL_COMPRESSED_RGBA_ASTC_10x5_KHR
+ case GlFormat::RGBA_ASTC_10x6: return VK_FORMAT_ASTC_10x6_UNORM_BLOCK; // GL_COMPRESSED_RGBA_ASTC_10x6_KHR
+ case GlFormat::RGBA_ASTC_10x8: return VK_FORMAT_ASTC_10x8_UNORM_BLOCK; // GL_COMPRESSED_RGBA_ASTC_10x8_KHR
+ case GlFormat::RGBA_ASTC_10x10: return VK_FORMAT_ASTC_10x10_UNORM_BLOCK; // GL_COMPRESSED_RGBA_ASTC_10x10_KHR
+ case GlFormat::RGBA_ASTC_12x10: return VK_FORMAT_ASTC_12x10_UNORM_BLOCK; // GL_COMPRESSED_RGBA_ASTC_12x10_KHR
+ case GlFormat::RGBA_ASTC_12x12: return VK_FORMAT_ASTC_12x12_UNORM_BLOCK; // GL_COMPRESSED_RGBA_ASTC_12x12_KHR
+ case GlFormat::SRGB8_Alpha8_ASTC_4x4: return VK_FORMAT_ASTC_4x4_SRGB_BLOCK; // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR
+ case GlFormat::SRGB8_Alpha8_ASTC_5x4: return VK_FORMAT_ASTC_5x4_SRGB_BLOCK; // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR
+ case GlFormat::SRGB8_Alpha8_ASTC_5x5: return VK_FORMAT_ASTC_5x5_SRGB_BLOCK; // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR
+ case GlFormat::SRGB8_Alpha8_ASTC_6x5: return VK_FORMAT_ASTC_6x5_SRGB_BLOCK; // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR
+ case GlFormat::SRGB8_Alpha8_ASTC_6x6: return VK_FORMAT_ASTC_6x6_SRGB_BLOCK; // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR
+ case GlFormat::SRGB8_Alpha8_ASTC_8x5: return VK_FORMAT_ASTC_8x5_SRGB_BLOCK; // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR
+ case GlFormat::SRGB8_Alpha8_ASTC_8x6: return VK_FORMAT_ASTC_8x6_SRGB_BLOCK; // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR
+ case GlFormat::SRGB8_Alpha8_ASTC_8x8: return VK_FORMAT_ASTC_8x8_SRGB_BLOCK; // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR
+ case GlFormat::SRGB8_Alpha8_ASTC_10x5: return VK_FORMAT_ASTC_10x5_SRGB_BLOCK; // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR
+ case GlFormat::SRGB8_Alpha8_ASTC_10x6: return VK_FORMAT_ASTC_10x6_SRGB_BLOCK; // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR
+ case GlFormat::SRGB8_Alpha8_ASTC_10x8: return VK_FORMAT_ASTC_10x8_SRGB_BLOCK; // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR
+ case GlFormat::SRGB8_Alpha8_ASTC_10x10: return VK_FORMAT_ASTC_10x10_SRGB_BLOCK; // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR
+ case GlFormat::SRGB8_Alpha8_ASTC_12x10: return VK_FORMAT_ASTC_12x10_SRGB_BLOCK; // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR
+ case GlFormat::SRGB8_Alpha8_ASTC_12x12: return VK_FORMAT_ASTC_12x12_SRGB_BLOCK; // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR
+
+ // sRGB formats
+ case GlFormat::SRGB8: return VK_FORMAT_R8G8B8_SRGB; // GL_SRGB8
+ case GlFormat::SRGB8_Alpha8: return VK_FORMAT_R8G8B8A8_SRGB; // GL_SRGB8_ALPHA8
+ case GlFormat::SRGB_DXT1: return VK_FORMAT_BC1_RGB_SRGB_BLOCK; // GL_COMPRESSED_SRGB_S3TC_DXT1_EXT
+ case GlFormat::SRGB_Alpha_DXT1: return VK_FORMAT_BC1_RGBA_SRGB_BLOCK; // GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT
+ case GlFormat::SRGB_Alpha_DXT3: return VK_FORMAT_BC2_SRGB_BLOCK; // GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT
+ case GlFormat::SRGB_Alpha_DXT5: return VK_FORMAT_BC3_SRGB_BLOCK; // GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT
+ case GlFormat::SRGB_BP_UNorm: return VK_FORMAT_BC7_SRGB_BLOCK; // GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB
+
+ // ES 2 formats
+// case GlFormat::DepthFormat: return VK_FORMAT_DEPTH_COMPONENT; // GL_DEPTH_COMPONENT
+// case GlFormat::AlphaFormat: return VK_FORMAT_ALPHA; // GL_ALPHA
+// case GlFormat::RGBFormat: return VK_FORMAT_RGB; // GL_RGB
+// case GlFormat::RGBAFormat: return VK_FORMAT_RGBA; // GL_RGBA
+// case GlFormat::LuminanceFormat: return VK_FORMAT_LUMINANCE; // GL_LUMINANCE
+// case GlFormat::LuminanceAlphaFormat: return VK_FORMAT;
+ default: return VK_FORMAT_UNDEFINED;
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/platformsupport/vkconvenience/qvkconvenience_p.h b/src/platformsupport/vkconvenience/qvkconvenience_p.h
new file mode 100644
index 0000000000..1dd1dfc4a7
--- /dev/null
+++ b/src/platformsupport/vkconvenience/qvkconvenience_p.h
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QVKCONVENIENCE_P_H
+#define QVKCONVENIENCE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qglobal.h>
+#include <qvulkaninstance.h>
+
+QT_BEGIN_NAMESPACE
+
+class QVkConvenience
+{
+public:
+ static VkFormat vkFormatFromGlFormat(uint glFormat);
+};
+
+QT_END_NAMESPACE
+
+#endif // QVKCONVENIENCE_P_H
diff --git a/src/platformsupport/vkconvenience/vkconvenience.pro b/src/platformsupport/vkconvenience/vkconvenience.pro
index 7a4cdb041d..ee540024cf 100644
--- a/src/platformsupport/vkconvenience/vkconvenience.pro
+++ b/src/platformsupport/vkconvenience/vkconvenience.pro
@@ -8,9 +8,11 @@ DEFINES += QT_NO_CAST_FROM_ASCII
PRECOMPILED_HEADER = ../../corelib/global/qt_pch.h
SOURCES += \
+ qvkconvenience.cpp \
qbasicvulkanplatforminstance.cpp
HEADERS += \
+ qvkconvenience_p.h \
qbasicvulkanplatforminstance_p.h
load(qt_module)
diff --git a/src/plugins/platforms/android/qandroidplatformtheme.cpp b/src/plugins/platforms/android/qandroidplatformtheme.cpp
index a78a62337f..7fc68c3d7c 100644
--- a/src/plugins/platforms/android/qandroidplatformtheme.cpp
+++ b/src/plugins/platforms/android/qandroidplatformtheme.cpp
@@ -489,6 +489,8 @@ QVariant QAndroidPlatformTheme::themeHint(ThemeHint hint) const
Q_FALLTHROUGH();
}
+ case DialogButtonBoxLayout:
+ return QVariant(QPlatformDialogHelper::AndroidLayout);
default:
return QPlatformTheme::themeHint(hint);
}
diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm
index 300082d694..08e7447a75 100644
--- a/src/plugins/platforms/cocoa/qcocoaintegration.mm
+++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm
@@ -215,6 +215,25 @@ QCocoaIntegration::QCocoaIntegration(const QStringList &paramList)
connect(qGuiApp, &QGuiApplication::focusWindowChanged,
this, &QCocoaIntegration::focusWindowChanged);
+
+ static auto splashScreenHider = QMacKeyValueObserver(NSApp, @"modalWindow", []{
+ const QWindowList allWindows = QGuiApplication::topLevelWindows();
+ for (QWindow *window : allWindows) {
+ if ((window->flags() & Qt::SplashScreen) == Qt::SplashScreen) {
+ QCocoaWindow *platformWindow = static_cast<QCocoaWindow*>(window->handle());
+ NSWindow *splashWindow = platformWindow->view().window;
+ if (!splashWindow)
+ continue;
+ if (NSApp.modalWindow) {
+ NSInteger originalLevel = splashWindow.level;
+ splashWindow.level = NSNormalWindowLevel;
+ window->setProperty("_q_levelBeforeModalSession", (qlonglong)originalLevel);
+ } else if (NSInteger originalLevel = window->property("_q_levelBeforeModalSession").toLongLong()) {
+ splashWindow.level = originalLevel;
+ }
+ }
+ }
+ });
}
QCocoaIntegration::~QCocoaIntegration()
diff --git a/src/widgets/kernel/qshortcut.cpp b/src/widgets/kernel/qshortcut.cpp
index a680ff7913..b7857e2b74 100644
--- a/src/widgets/kernel/qshortcut.cpp
+++ b/src/widgets/kernel/qshortcut.cpp
@@ -189,10 +189,15 @@ static bool correctWidgetContext(Qt::ShortcutContext context, QWidget *w, QWidge
}
#endif
- /* if a floating tool window is active, keep shortcuts on the
- * parent working */
- if (active_window != tlw && active_window && active_window->windowType() == Qt::Tool && active_window->parentWidget()) {
- active_window = active_window->parentWidget()->window();
+ if (active_window && active_window != tlw) {
+ /* if a floating tool window is active, keep shortcuts on the parent working.
+ * and if a popup window is active (f.ex a completer), keep shortcuts on the
+ * focus proxy working */
+ if (active_window->windowType() == Qt::Tool && active_window->parentWidget()) {
+ active_window = active_window->parentWidget()->window();
+ } else if (active_window->windowType() == Qt::Popup && active_window->focusProxy()) {
+ active_window = active_window->focusProxy()->window();
+ }
}
if (active_window != tlw) {