summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-09-11 01:00:36 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-09-11 01:00:36 +0200
commit5d92f1793aa8438ea974cc2232d2aa3b1b2b2472 (patch)
treedbb78cdbbf7e03f07d616ab76eb0466c74f7767e /src
parent5ae2cbce2c4d5f319f1ddf1895d0f43f1c6ceafe (diff)
parent405e297756240b5f14e44b5fbd6a88091d2eddeb (diff)
Merge remote-tracking branch 'origin/5.12' into dev
Diffstat (limited to 'src')
-rw-r--r--src/corelib/tools/qrect.cpp8
-rw-r--r--src/corelib/tools/qstringlist.cpp9
-rw-r--r--src/corelib/tools/qstringlist.h3
-rw-r--r--src/gui/opengl/qopenglpaintengine.cpp1
-rw-r--r--src/gui/opengl/qopengltextureglyphcache_p.h5
-rw-r--r--src/network/ssl/qdtls.cpp14
-rw-r--r--src/network/ssl/qdtls.h2
-rw-r--r--src/plugins/platforms/cocoa/qcocoaglcontext.h3
-rw-r--r--src/plugins/platforms/cocoa/qcocoaglcontext.mm45
-rw-r--r--src/plugins/platforms/cocoa/qcocoaintegration.mm21
-rw-r--r--src/plugins/platforms/cocoa/qcocoanativeinterface.mm4
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.h8
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm19
-rw-r--r--src/plugins/styles/mac/qmacstyle_mac.mm56
-rw-r--r--src/tools/moc/cbordevice.h4
-rw-r--r--src/widgets/widgets/qmaccocoaviewcontainer_mac.mm5
-rw-r--r--src/xml/dom/qdom.cpp2
17 files changed, 99 insertions, 110 deletions
diff --git a/src/corelib/tools/qrect.cpp b/src/corelib/tools/qrect.cpp
index 40d6c8b7c3..ad1885e8ce 100644
--- a/src/corelib/tools/qrect.cpp
+++ b/src/corelib/tools/qrect.cpp
@@ -73,7 +73,7 @@ QT_BEGIN_NAMESPACE
The QRect class provides a collection of functions that return the
various rectangle coordinates, and enable manipulation of
- these. QRect also provide functions to move the rectangle relative
+ these. QRect also provides functions to move the rectangle relative
to the various coordinates. In addition there is a moveTo()
function that moves the rectangle, leaving its top left corner at
the given coordinates. Alternatively, the translate() function
@@ -155,7 +155,7 @@ QT_BEGIN_NAMESPACE
The QRect class provides a collection of functions that return the
various rectangle coordinates, and enable manipulation of
- these. QRect also provide functions to move the rectangle relative
+ these. QRect also provides functions to move the rectangle relative
to the various coordinates.
For example the left(), setLeft() and moveLeft() functions as an
@@ -1335,7 +1335,7 @@ QDebug operator<<(QDebug dbg, const QRect &r)
The QRectF class provides a collection of functions that return
the various rectangle coordinates, and enable manipulation of
- these. QRectF also provide functions to move the rectangle
+ these. QRectF also provides functions to move the rectangle
relative to the various coordinates. In addition there is a
moveTo() function that moves the rectangle, leaving its top left
corner at the given coordinates. Alternatively, the translate()
@@ -1418,7 +1418,7 @@ QDebug operator<<(QDebug dbg, const QRect &r)
The QRectF class provides a collection of functions that return
the various rectangle coordinates, and enable manipulation of
- these. QRectF also provide functions to move the rectangle
+ these. QRectF also provides functions to move the rectangle
relative to the various coordinates.
For example: the bottom(), setBottom() and moveBottom() functions:
diff --git a/src/corelib/tools/qstringlist.cpp b/src/corelib/tools/qstringlist.cpp
index c85a4f41dd..cf150c2a1b 100644
--- a/src/corelib/tools/qstringlist.cpp
+++ b/src/corelib/tools/qstringlist.cpp
@@ -335,6 +335,15 @@ static bool stringList_contains(const QStringList &stringList, const T &str, Qt:
*/
#endif
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+/// Not really needed anymore, but kept for binary compatibility
+bool QtPrivate::QStringList_contains(const QStringList *that, const QString &str,
+ Qt::CaseSensitivity cs)
+{
+ return stringList_contains(*that, str, cs);
+}
+#endif
+
/*!
\fn bool QStringList::contains(QStringView str, Qt::CaseSensitivity cs) const
\overload
diff --git a/src/corelib/tools/qstringlist.h b/src/corelib/tools/qstringlist.h
index b04b7c0bc8..10cbad04d6 100644
--- a/src/corelib/tools/qstringlist.h
+++ b/src/corelib/tools/qstringlist.h
@@ -164,6 +164,9 @@ namespace QtPrivate {
QStringList Q_CORE_EXPORT QStringList_filter(const QStringList *that, const QString &str,
Qt::CaseSensitivity cs);
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+ bool Q_CORE_EXPORT QStringList_contains(const QStringList *that, const QString &str, Qt::CaseSensitivity cs);
+#endif
bool Q_CORE_EXPORT QStringList_contains(const QStringList *that, QStringView str, Qt::CaseSensitivity cs);
bool Q_CORE_EXPORT QStringList_contains(const QStringList *that, QLatin1String str, Qt::CaseSensitivity cs);
void Q_CORE_EXPORT QStringList_replaceInStrings(QStringList *that, const QString &before, const QString &after,
diff --git a/src/gui/opengl/qopenglpaintengine.cpp b/src/gui/opengl/qopenglpaintengine.cpp
index 3680b3c3c2..001cb839fa 100644
--- a/src/gui/opengl/qopenglpaintengine.cpp
+++ b/src/gui/opengl/qopenglpaintengine.cpp
@@ -1817,6 +1817,7 @@ void QOpenGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngine::GlyphFormat gly
// we may have to re-bind brush textures after filling in the cache.
brushTextureDirty = (QT_BRUSH_TEXTURE_UNIT == glypchCacheTextureUnit);
}
+ cache->setPaintEnginePrivate(nullptr);
}
if (cache->width() == 0 || cache->height() == 0)
diff --git a/src/gui/opengl/qopengltextureglyphcache_p.h b/src/gui/opengl/qopengltextureglyphcache_p.h
index 0b7b5f6082..598cb00ee5 100644
--- a/src/gui/opengl/qopengltextureglyphcache_p.h
+++ b/src/gui/opengl/qopengltextureglyphcache_p.h
@@ -152,6 +152,11 @@ public:
void clear();
+ QOpenGL2PaintEngineExPrivate *paintEnginePrivate() const
+ {
+ return pex;
+ }
+
private:
void setupVertexAttribs();
diff --git a/src/network/ssl/qdtls.cpp b/src/network/ssl/qdtls.cpp
index da37951de2..bbb22aa527 100644
--- a/src/network/ssl/qdtls.cpp
+++ b/src/network/ssl/qdtls.cpp
@@ -454,6 +454,13 @@ QDtlsClientVerifier::QDtlsClientVerifier(QObject *parent)
}
/*!
+ Destroys the QDtlsClientVerifier object.
+*/
+QDtlsClientVerifier::~QDtlsClientVerifier()
+{
+}
+
+/*!
Sets the secret and the cryptographic hash algorithm from \a params. This
QDtlsClientVerifier will use these to generate cookies. If the new secret
has size zero, this function returns \c false and does not change the
@@ -577,6 +584,13 @@ QDtls::QDtls(QSslSocket::SslMode mode, QObject *parent)
}
/*!
+ Destroys the QDtls object.
+*/
+QDtls::~QDtls()
+{
+}
+
+/*!
Sets the peer's address, \a port, and host name and returns \c true
if successful. \a address must not be null, multicast, or broadcast.
\a verificationName is the host name used for the certificate validation.
diff --git a/src/network/ssl/qdtls.h b/src/network/ssl/qdtls.h
index 9288fd3440..8505b00d5e 100644
--- a/src/network/ssl/qdtls.h
+++ b/src/network/ssl/qdtls.h
@@ -78,6 +78,7 @@ class Q_NETWORK_EXPORT QDtlsClientVerifier : public QObject
public:
explicit QDtlsClientVerifier(QObject *parent = nullptr);
+ ~QDtlsClientVerifier();
struct Q_NETWORK_EXPORT GeneratorParameters
{
@@ -125,6 +126,7 @@ public:
};
explicit QDtls(QSslSocket::SslMode mode, QObject *parent = nullptr);
+ ~QDtls();
bool setPeer(const QHostAddress &address, quint16 port,
const QString &verificationName = {});
diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.h b/src/plugins/platforms/cocoa/qcocoaglcontext.h
index 9d827289f7..cef5892989 100644
--- a/src/plugins/platforms/cocoa/qcocoaglcontext.h
+++ b/src/plugins/platforms/cocoa/qcocoaglcontext.h
@@ -65,8 +65,6 @@ public:
bool isSharing() const override;
bool isValid() const override;
- void windowWasHidden();
-
NSOpenGLContext *nativeContext() const;
QFunctionPointer getProcAddress(const char *procName) override;
@@ -80,7 +78,6 @@ private:
NSOpenGLContext *m_context = nil;
NSOpenGLContext *m_shareContext = nil;
QSurfaceFormat m_format;
- QPointer<QWindow> m_currentWindow;
bool m_didCheckForSoftwareContext = false;
};
diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.mm b/src/plugins/platforms/cocoa/qcocoaglcontext.mm
index cf4ecd335c..f11016679a 100644
--- a/src/plugins/platforms/cocoa/qcocoaglcontext.mm
+++ b/src/plugins/platforms/cocoa/qcocoaglcontext.mm
@@ -318,9 +318,6 @@ void QCocoaGLContext::updateSurfaceFormat()
QCocoaGLContext::~QCocoaGLContext()
{
- if (m_currentWindow && m_currentWindow.data()->handle())
- static_cast<QCocoaWindow *>(m_currentWindow.data()->handle())->setCurrentContext(0);
-
[m_context release];
}
@@ -366,26 +363,26 @@ bool QCocoaGLContext::makeCurrent(QPlatformSurface *surface)
*/
bool QCocoaGLContext::setDrawable(QPlatformSurface *surface)
{
+ // Make sure any surfaces released during this process are deallocated
+ // straight away, otherwise we may run out of surfaces when spinning a
+ // render-loop that doesn't return to one of the outer pools.
+ QMacAutoReleasePool pool;
+
if (!surface || surface->surface()->surfaceClass() == QSurface::Offscreen) {
// Clear the current drawable and reset the active window, so that GL
// commands that don't target a specific FBO will not end up stomping
// on the previously set drawable.
qCDebug(lcQpaOpenGLContext) << "Clearing current drawable" << m_context.view << "for" << m_context;
[m_context clearDrawable];
- m_currentWindow.clear();
return true;
}
Q_ASSERT(surface->surface()->surfaceClass() == QSurface::Window);
- QWindow *window = static_cast<QCocoaWindow *>(surface)->window();
+ QNSView *view = qnsview_cast(static_cast<QCocoaWindow *>(surface)->view());
- if (window == m_currentWindow.data())
+ if (view == m_context.view)
return true;
- Q_ASSERT(window->handle());
- QCocoaWindow *cocoaWindow = static_cast<QCocoaWindow *>(window->handle());
- NSView *view = cocoaWindow->view();
-
if ((m_context.view = view) != view) {
qCInfo(lcQpaOpenGLContext) << "Failed to set" << view << "as drawable for" << m_context;
return false;
@@ -393,12 +390,6 @@ bool QCocoaGLContext::setDrawable(QPlatformSurface *surface)
qCInfo(lcQpaOpenGLContext) << "Set drawable for" << m_context << "to" << m_context.view;
- if (m_currentWindow && m_currentWindow.data()->handle())
- static_cast<QCocoaWindow *>(m_currentWindow.data()->handle())->setCurrentContext(0);
-
- m_currentWindow = window;
-
- cocoaWindow->setCurrentContext(this);
return true;
}
@@ -407,6 +398,11 @@ static QMutex s_contextMutex;
void QCocoaGLContext::update()
{
+ // Make sure any surfaces released during this process are deallocated
+ // straight away, otherwise we may run out of surfaces when spinning a
+ // render-loop that doesn't return to one of the outer pools.
+ QMacAutoReleasePool pool;
+
QMutexLocker locker(&s_contextMutex);
qCInfo(lcQpaOpenGLContext) << "Updating" << m_context << "for" << m_context.view;
[m_context update];
@@ -435,24 +431,13 @@ void QCocoaGLContext::doneCurrent()
qCDebug(lcQpaOpenGLContext) << "Clearing current context"
<< [NSOpenGLContext currentContext] << "in" << QThread::currentThread();
- if (m_currentWindow && m_currentWindow.data()->handle())
- static_cast<QCocoaWindow *>(m_currentWindow.data()->handle())->setCurrentContext(nullptr);
-
- m_currentWindow.clear();
+ // Note: We do not need to clear the current drawable here.
+ // As long as there is no current context, GL calls will
+ // do nothing.
[NSOpenGLContext clearCurrentContext];
}
-void QCocoaGLContext::windowWasHidden()
-{
- // If the window is hidden, we need to unset the m_currentWindow
- // variable so that succeeding makeCurrent's will not abort prematurely
- // because of the optimization in setDrawable.
- // Doing a full doneCurrent here is not preferable, because the GL context
- // might be rendering in a different thread at this time.
- m_currentWindow.clear();
-}
-
QSurfaceFormat QCocoaGLContext::format() const
{
return m_format;
diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm
index 0f87109ada..612290c9bd 100644
--- a/src/plugins/platforms/cocoa/qcocoaintegration.mm
+++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm
@@ -72,12 +72,6 @@
#include <IOKit/graphics/IOGraphicsLib.h>
-#if !QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_14)
-@interface NSApplication (MojaveForwardDeclarations)
-@property (strong) NSAppearance *appearance NS_AVAILABLE_MAC(10_14);
-@end
-#endif
-
static void initResources()
{
Q_INIT_RESOURCE(qcocoaresources);
@@ -139,21 +133,6 @@ QCocoaIntegration::QCocoaIntegration(const QStringList &paramList)
NSApplication *cocoaApplication = [QNSApplication sharedApplication];
qt_redirectNSApplicationSendEvent();
- if (__builtin_available(macOS 10.14, *)) {
- // Disable dark appearance, unless the Info.plist or environment requests that it should be enabled
- bool plistEnablesDarkAppearance = [[[NSBundle mainBundle] objectForInfoDictionaryKey:
- @"NSRequiresAquaSystemAppearance"] boolValue];
-
- bool hasEnvironmentRequiresAquaAppearance;
- int environmentRequiresAquaAppearance = qEnvironmentVariableIntValue(
- "QT_MAC_REQUIRES_AQUA_SYSTEM_APPEARANCE", &hasEnvironmentRequiresAquaAppearance);
- bool environmentEnablesDarkAppearance = hasEnvironmentRequiresAquaAppearance
- && environmentRequiresAquaAppearance == 0;
-
- if (!(plistEnablesDarkAppearance || environmentEnablesDarkAppearance))
- NSApp.appearance = [NSAppearance appearanceNamed:NSAppearanceNameAqua];
- }
-
if (qEnvironmentVariableIsEmpty("QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM")) {
// Applications launched from plain executables (without an app
// bundle) are "background" applications that does not take keybaord
diff --git a/src/plugins/platforms/cocoa/qcocoanativeinterface.mm b/src/plugins/platforms/cocoa/qcocoanativeinterface.mm
index 228df50d86..7979e430ac 100644
--- a/src/plugins/platforms/cocoa/qcocoanativeinterface.mm
+++ b/src/plugins/platforms/cocoa/qcocoanativeinterface.mm
@@ -102,10 +102,6 @@ void *QCocoaNativeInterface::nativeResourceForWindow(const QByteArray &resourceS
if (resourceString == "nsview") {
return static_cast<QCocoaWindow *>(window->handle())->m_view;
-#ifndef QT_NO_OPENGL
- } else if (resourceString == "nsopenglcontext") {
- return static_cast<QCocoaWindow *>(window->handle())->currentContext()->nativeContext();
-#endif
} else if (resourceString == "nswindow") {
return static_cast<QCocoaWindow *>(window->handle())->nativeWindow();
#if QT_CONFIG(vulkan)
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/cocoa/qcocoawindow.h
index 225c7eda84..8f1bdb8af0 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.h
+++ b/src/plugins/platforms/cocoa/qcocoawindow.h
@@ -169,11 +169,6 @@ public:
NSUInteger windowStyleMask(Qt::WindowFlags flags);
void setWindowZoomButton(Qt::WindowFlags flags);
-#ifndef QT_NO_OPENGL
- void setCurrentContext(QCocoaGLContext *context);
- QCocoaGLContext *currentContext() const;
-#endif
-
bool setWindowModified(bool modified) override;
void setFrameStrutEventsEnabled(bool enabled) override;
@@ -253,9 +248,6 @@ public: // for QNSView
bool m_inSetVisible;
bool m_inSetGeometry;
bool m_inSetStyleMask;
-#ifndef QT_NO_OPENGL
- QCocoaGLContext *m_glContext;
-#endif
QCocoaMenuBar *m_menubar;
bool m_needsInvalidateShadow;
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index 2178f3bf23..1de8577ebe 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -151,9 +151,6 @@ QCocoaWindow::QCocoaWindow(QWindow *win, WId nativeHandle)
, m_inSetVisible(false)
, m_inSetGeometry(false)
, m_inSetStyleMask(false)
-#ifndef QT_NO_OPENGL
- , m_glContext(nullptr)
-#endif
, m_menubar(nullptr)
, m_needsInvalidateShadow(false)
, m_hasModalSession(false)
@@ -405,10 +402,6 @@ void QCocoaWindow::setVisible(bool visible)
[m_view setHidden:NO];
} else {
// qDebug() << "close" << this;
-#ifndef QT_NO_OPENGL
- if (m_glContext)
- m_glContext->windowWasHidden();
-#endif
QCocoaEventDispatcher *cocoaEventDispatcher = qobject_cast<QCocoaEventDispatcher *>(QGuiApplication::instance()->eventDispatcher());
QCocoaEventDispatcherPrivate *cocoaEventDispatcherPrivate = nullptr;
if (cocoaEventDispatcher)
@@ -1336,18 +1329,6 @@ bool QCocoaWindow::windowIsPopupType(Qt::WindowType type) const
return ((type & Qt::Popup) == Qt::Popup);
}
-#ifndef QT_NO_OPENGL
-void QCocoaWindow::setCurrentContext(QCocoaGLContext *context)
-{
- m_glContext = context;
-}
-
-QCocoaGLContext *QCocoaWindow::currentContext() const
-{
- return m_glContext;
-}
-#endif
-
/*!
Checks if the window is the content view of its immediate NSWindow.
diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm
index c70d1729c0..2a21673054 100644
--- a/src/plugins/styles/mac/qmacstyle_mac.mm
+++ b/src/plugins/styles/mac/qmacstyle_mac.mm
@@ -253,33 +253,50 @@ QVector<QPointer<QObject> > QMacStylePrivate::scrollBars;
static QLinearGradient titlebarGradientActive()
{
- static QLinearGradient gradient;
- if (gradient == QLinearGradient()) {
+ static QLinearGradient darkGradient = [](){
+ QLinearGradient gradient;
+ // FIXME: colors are chosen somewhat arbitrarily and could be fine-tuned,
+ // or ideally determined by calling a native API.
+ gradient.setColorAt(0, QColor(47, 47, 47));
+ return gradient;
+ }();
+ static QLinearGradient lightGradient = [](){
+ QLinearGradient gradient;
gradient.setColorAt(0, QColor(235, 235, 235));
gradient.setColorAt(0.5, QColor(210, 210, 210));
gradient.setColorAt(0.75, QColor(195, 195, 195));
gradient.setColorAt(1, QColor(180, 180, 180));
- }
- return gradient;
+ return gradient;
+ }();
+ return qt_mac_applicationIsInDarkMode() ? darkGradient : lightGradient;
}
static QLinearGradient titlebarGradientInactive()
{
- static QLinearGradient gradient;
- if (gradient == QLinearGradient()) {
+ static QLinearGradient darkGradient = [](){
+ QLinearGradient gradient;
+ gradient.setColorAt(1, QColor(42, 42, 42));
+ return gradient;
+ }();
+ static QLinearGradient lightGradient = [](){
+ QLinearGradient gradient;
gradient.setColorAt(0, QColor(250, 250, 250));
gradient.setColorAt(1, QColor(225, 225, 225));
- }
- return gradient;
+ return gradient;
+ }();
+ return qt_mac_applicationIsInDarkMode() ? darkGradient : lightGradient;
}
static const QColor titlebarSeparatorLineActive(111, 111, 111);
static const QColor titlebarSeparatorLineInactive(131, 131, 131);
+static const QColor darkModeSeparatorLine(88, 88, 88);
// Gradient colors used for the dock widget title bar and
// non-unifed tool bar bacground.
-static const QColor mainWindowGradientBegin(240, 240, 240);
-static const QColor mainWindowGradientEnd(200, 200, 200);
+static const QColor lightMainWindowGradientBegin(240, 240, 240);
+static const QColor lightMainWindowGradientEnd(200, 200, 200);
+static const QColor darkMainWindowGradientBegin(47, 47, 47);
+static const QColor darkMainWindowGradientEnd(47, 47, 47);
static const int DisclosureOffset = 4;
@@ -4233,12 +4250,13 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
#ifndef QT_NO_TOOLBAR
case CE_ToolBar: {
const QStyleOptionToolBar *toolBar = qstyleoption_cast<const QStyleOptionToolBar *>(opt);
+ const bool isDarkMode = qt_mac_applicationIsInDarkMode();
// Unified title and toolbar drawing. In this mode the cocoa platform plugin will
// fill the top toolbar area part with a background gradient that "unifies" with
// the title bar. The following code fills the toolBar area with transparent pixels
// to make that gradient visible.
- if (w) {
+ if (w) {
#if QT_CONFIG(mainwindow)
if (QMainWindow * mainWindow = qobject_cast<QMainWindow *>(w->window())) {
if (toolBar && toolBar->toolBarArea == Qt::TopToolBarArea && mainWindow->unifiedTitleAndToolBarOnMac()) {
@@ -4248,7 +4266,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
p->fillRect(opt->rect, Qt::transparent);
p->restore();
- // Drow a horizontal separator line at the toolBar bottom if the "unified" area ends here.
+ // Draw a horizontal separator line at the toolBar bottom if the "unified" area ends here.
// There might be additional toolbars or other widgets such as tab bars in document
// mode below. Determine this by making a unified toolbar area test for the row below
// this toolbar.
@@ -4257,7 +4275,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
if (isEndOfUnifiedArea) {
const int margin = qt_mac_aqua_get_metric(SeparatorSize);
const auto separatorRect = QRect(opt->rect.left(), opt->rect.bottom(), opt->rect.width(), margin);
- p->fillRect(separatorRect, opt->palette.dark().color());
+ p->fillRect(separatorRect, isDarkMode ? darkModeSeparatorLine : opt->palette.dark().color());
}
break;
}
@@ -4272,21 +4290,23 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
else
linearGrad = QLinearGradient(opt->rect.left(), 0, opt->rect.right(), 0);
+ QColor mainWindowGradientBegin = isDarkMode ? darkMainWindowGradientBegin : lightMainWindowGradientBegin;
+ QColor mainWindowGradientEnd = isDarkMode ? darkMainWindowGradientEnd : lightMainWindowGradientEnd;
+
linearGrad.setColorAt(0, mainWindowGradientBegin);
linearGrad.setColorAt(1, mainWindowGradientEnd);
p->fillRect(opt->rect, linearGrad);
p->save();
if (opt->state & State_Horizontal) {
- p->setPen(mainWindowGradientBegin.lighter(114));
+ p->setPen(isDarkMode ? darkModeSeparatorLine : mainWindowGradientBegin.lighter(114));
p->drawLine(opt->rect.topLeft(), opt->rect.topRight());
- p->setPen(mainWindowGradientEnd.darker(114));
+ p->setPen(isDarkMode ? darkModeSeparatorLine :mainWindowGradientEnd.darker(114));
p->drawLine(opt->rect.bottomLeft(), opt->rect.bottomRight());
-
} else {
- p->setPen(mainWindowGradientBegin.lighter(114));
+ p->setPen(isDarkMode ? darkModeSeparatorLine : mainWindowGradientBegin.lighter(114));
p->drawLine(opt->rect.topLeft(), opt->rect.bottomLeft());
- p->setPen(mainWindowGradientEnd.darker(114));
+ p->setPen(isDarkMode ? darkModeSeparatorLine : mainWindowGradientEnd.darker(114));
p->drawLine(opt->rect.topRight(), opt->rect.bottomRight());
}
p->restore();
diff --git a/src/tools/moc/cbordevice.h b/src/tools/moc/cbordevice.h
index 25b75b79eb..dbfc537dd2 100644
--- a/src/tools/moc/cbordevice.h
+++ b/src/tools/moc/cbordevice.h
@@ -82,8 +82,10 @@ private:
void putChar(char c)
{
putNewline();
- if (c < 0x20 || c >= 0x7f)
+ if (uchar(c) < 0x20)
fprintf(out, " '\\x%x',", uint8_t(c));
+ else if (uchar(c) >= 0x7f)
+ fprintf(out, " uchar('\\x%x'),", uint8_t(c));
else if (c == '\'' || c == '\\')
fprintf(out, " '\\%c',", c);
else
diff --git a/src/widgets/widgets/qmaccocoaviewcontainer_mac.mm b/src/widgets/widgets/qmaccocoaviewcontainer_mac.mm
index 98ee90deb7..0b64b2a2bb 100644
--- a/src/widgets/widgets/qmaccocoaviewcontainer_mac.mm
+++ b/src/widgets/widgets/qmaccocoaviewcontainer_mac.mm
@@ -165,6 +165,11 @@ void QMacCocoaViewContainer::setCocoaView(NSView *view)
Q_ASSERT(window->handle());
[oldView release];
+
+ // The QWindow::destroy()) call above will explicitly hide this widget.
+ // Clear the hidden state here so it can be implicitly shown again.
+ setAttribute(Qt::WA_WState_Hidden, false);
+
}
QT_END_NAMESPACE
diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp
index 17f87804e9..91796106a2 100644
--- a/src/xml/dom/qdom.cpp
+++ b/src/xml/dom/qdom.cpp
@@ -6666,8 +6666,6 @@ bool QDomDocument::setContent(const QString& text, bool namespaceProcessing, QSt
}
/*!
- \nonreentrant
-
This function parses the XML document from the byte array \a
data and sets it as the content of the document. It tries to
detect the encoding of the document as required by the XML