summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-04-26 01:00:13 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-04-26 01:00:13 +0200
commit0dff40adf81d0bc2023c109abf266053431bfcd0 (patch)
tree85776cb125584759b706f45f1465bd5d3d9ccfe4
parent7db9e02ad11c391c1d616defd11e7deb2718d60a (diff)
parent913dd26c92f406e3da83ed83701ce47e659bcc48 (diff)
Merge remote-tracking branch 'origin/5.12' into 5.13
-rw-r--r--doc/global/externalsites/external-resources.qdoc11
-rw-r--r--mkspecs/features/toolchain.prf10
-rw-r--r--qmake/doc/src/qmake-manual.qdoc2
-rw-r--r--src/3rdparty/tinycbor/src/cborparser.c9
-rw-r--r--src/corelib/kernel/qjnihelpers.cpp16
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp2
-rw-r--r--src/gui/painting/qstroker.cpp4
-rw-r--r--src/gui/painting/qstroker_p.h1
-rw-r--r--src/platformsupport/linuxaccessibility/bridge.cpp10
-rw-r--r--src/plugins/imageformats/ico/qicohandler.cpp24
-rw-r--r--src/plugins/styles/mac/qmacstyle_mac.mm39
-rw-r--r--src/tools/androiddeployqt/main.cpp2
-rw-r--r--tests/auto/other/lancelot/scripts/thinlines.qps79
13 files changed, 183 insertions, 26 deletions
diff --git a/doc/global/externalsites/external-resources.qdoc b/doc/global/externalsites/external-resources.qdoc
index 6019f5013f..01c6939dca 100644
--- a/doc/global/externalsites/external-resources.qdoc
+++ b/doc/global/externalsites/external-resources.qdoc
@@ -62,28 +62,27 @@
*/
/*!
- \externalpage http://www.cmake.org/cmake/help/v2.8.11/cmake.html#command:find_package
+ \externalpage https://cmake.org/cmake/help/latest/command/find_package.html
\title CMake find_package Documentation
*/
/*!
- \externalpage http://www.cmake.org/cmake/help/v2.8.11/cmake.html#prop_tgt:AUTOMOC
+ \externalpage https://cmake.org/cmake/help/latest/manual/cmake-qt.7.html#automoc
\title CMake AUTOMOC Documentation
*/
-
/*!
- \externalpage http://www.cmake.org/cmake/help/v2.8.11/cmake.html#prop_tgt:LOCATION
+ \externalpage https://cmake.org/cmake/help/latest/prop_tgt/LOCATION.html
\title CMake LOCATION Documentation
*/
/*!
- \externalpage http://www.cmake.org/cmake/help/v2.8.11/cmake.html#prop_tgt:POSITION_INDEPENDENT_CODE
+ \externalpage https://cmake.org/cmake/help/latest/prop_tgt/POSITION_INDEPENDENT_CODE.html
\title CMake POSITION_INDEPENDENT_CODE Documentation
*/
/*!
- \externalpage http://www.cmake.org/cmake/help/v2.8.11/cmake.html#command:target_link_libraries
+ \externalpage https://cmake.org/cmake/help/latest/command/target_link_libraries.html
\title CMake target_link_libraries Documentation
*/
diff --git a/mkspecs/features/toolchain.prf b/mkspecs/features/toolchain.prf
index 9c3a64aa8b..03612e5689 100644
--- a/mkspecs/features/toolchain.prf
+++ b/mkspecs/features/toolchain.prf
@@ -267,9 +267,13 @@ isEmpty($${target_prefix}.INCDIRS) {
for (line, output) {
contains(line, "^libraries: .*") {
line ~= s,^libraries: ,,
- # clang (7.x) on Windows uses the wrong path list separator ...
- equals(QMAKE_HOST.os, Windows): line ~= s,:(?![/\\\\]),;,
- paths = $$split(line, $$QMAKE_DIRLIST_SEP)
+ equals(QMAKE_HOST.os, Windows) {
+ # clang (7.x) on Windows uses the wrong path list separator ...
+ line ~= s,:(?![/\\\\]),;,
+ paths = $$split(line, ;)
+ } else {
+ paths = $$split(line, $$QMAKE_DIRLIST_SEP)
+ }
for (path, paths): \
QMAKE_DEFAULT_LIBDIRS += $$clean_path($$replace(path, ^=, $$[SYSROOT]))
}
diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc
index b293792bd1..ffd68adb7b 100644
--- a/qmake/doc/src/qmake-manual.qdoc
+++ b/qmake/doc/src/qmake-manual.qdoc
@@ -1105,6 +1105,8 @@
\header \li Option \li Description
\row \li app_bundle \li Puts the executable into a bundle (this is the default).
\row \li lib_bundle \li Puts the library into a library bundle.
+ \row \li plugin_bundle \li Puts the plugin into a plugin bundle. This value
+ is not supported by the Xcode project generator.
\endtable
The build process for bundles is also influenced by
diff --git a/src/3rdparty/tinycbor/src/cborparser.c b/src/3rdparty/tinycbor/src/cborparser.c
index 90a7d2ced6..2019e7b808 100644
--- a/src/3rdparty/tinycbor/src/cborparser.c
+++ b/src/3rdparty/tinycbor/src/cborparser.c
@@ -203,10 +203,13 @@ static CborError preparse_value(CborValue *it)
it->extra = 0;
/* read up to 16 bits into it->extra */
- if (bytesNeeded <= 2) {
+ if (bytesNeeded == 1) {
+ uint8_t extra;
+ read_bytes_unchecked(it, &extra, 1, bytesNeeded);
+ it->extra = extra;
+ } else if (bytesNeeded == 2) {
read_bytes_unchecked(it, &it->extra, 1, bytesNeeded);
- if (bytesNeeded == 2)
- it->extra = cbor_ntohs(it->extra);
+ it->extra = cbor_ntohs(it->extra);
} else {
cbor_static_assert(CborIteratorFlag_IntegerValueTooLarge == (Value32Bit & 3));
cbor_static_assert((CborIteratorFlag_IntegerValueIs64Bit |
diff --git a/src/corelib/kernel/qjnihelpers.cpp b/src/corelib/kernel/qjnihelpers.cpp
index 712e8bbcab..7d278c69f2 100644
--- a/src/corelib/kernel/qjnihelpers.cpp
+++ b/src/corelib/kernel/qjnihelpers.cpp
@@ -45,6 +45,7 @@
#include "qsharedpointer.h"
#include "qvector.h"
#include "qthread.h"
+#include "qcoreapplication.h"
#include <QtCore/qrunnable.h>
#include <deque>
@@ -474,6 +475,17 @@ void QtAndroidPrivate::runOnAndroidThread(const QtAndroidPrivate::Runnable &runn
env->CallStaticVoidMethod(g_jNativeClass, g_runPendingCppRunnablesMethodID);
}
+static bool waitForSemaphore(int timeoutMs, QSharedPointer<QSemaphore> sem)
+{
+ while (timeoutMs > 0) {
+ if (sem->tryAcquire(1, 10))
+ return true;
+ timeoutMs -= 10;
+ QCoreApplication::processEvents();
+ }
+ return false;
+}
+
void QtAndroidPrivate::runOnAndroidThreadSync(const QtAndroidPrivate::Runnable &runnable, JNIEnv *env, int timeoutMs)
{
QSharedPointer<QSemaphore> sem(new QSemaphore);
@@ -481,7 +493,7 @@ void QtAndroidPrivate::runOnAndroidThreadSync(const QtAndroidPrivate::Runnable &
runnable();
sem->release();
}, env);
- sem->tryAcquire(1, timeoutMs);
+ waitForSemaphore(timeoutMs, sem);
}
void QtAndroidPrivate::requestPermissions(JNIEnv *env, const QStringList &permissions, const QtAndroidPrivate::PermissionsResultFunc &callbackFunc, bool directCall)
@@ -524,7 +536,7 @@ QtAndroidPrivate::PermissionsHash QtAndroidPrivate::requestPermissionsSync(JNIEn
*res = result;
sem->release();
}, true);
- if (sem->tryAcquire(1, timeoutMs))
+ if (waitForSemaphore(timeoutMs, sem))
return std::move(*res);
else // mustn't touch *res
return QHash<QString, QtAndroidPrivate::PermissionsResult>();
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index d3404c6575..65319c0804 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -796,7 +796,7 @@ void QRasterPaintEngine::updatePen(const QPen &pen)
s->flags.fast_pen = pen_style > Qt::NoPen
&& s->penData.blend
&& ((cosmetic && penWidth <= 1)
- || (!cosmetic && s->flags.tx_noshear && penWidth * s->txscale <= 1));
+ || (!cosmetic && (s->flags.tx_noshear || !s->flags.antialiased) && penWidth * s->txscale <= 1));
s->flags.non_complex_pen = qpen_capStyle(s->lastPen) <= Qt::SquareCap && s->flags.tx_noshear;
diff --git a/src/gui/painting/qstroker.cpp b/src/gui/painting/qstroker.cpp
index c01531caf2..327190b678 100644
--- a/src/gui/painting/qstroker.cpp
+++ b/src/gui/painting/qstroker.cpp
@@ -1151,6 +1151,8 @@ void QDashStroker::processCurrentSubpath()
QSubpathFlatIterator it(&m_elements, m_dashThreshold);
qfixed2d prev = it.next();
+ if (!prev.isFinite())
+ return;
bool clipping = !m_clip_rect.isEmpty();
qfixed2d move_to_pos = prev;
@@ -1166,6 +1168,8 @@ void QDashStroker::processCurrentSubpath()
bool hasMoveTo = false;
while (it.hasNext()) {
QStrokerOps::Element e = it.next();
+ if (!qfixed2d(e).isFinite())
+ continue;
Q_ASSERT(e.isLineTo());
cline = QLineF(qt_fixed_to_real(prev.x),
diff --git a/src/gui/painting/qstroker_p.h b/src/gui/painting/qstroker_p.h
index 722a0904f3..f107b6eb20 100644
--- a/src/gui/painting/qstroker_p.h
+++ b/src/gui/painting/qstroker_p.h
@@ -104,6 +104,7 @@ struct qfixed2d
qfixed x;
qfixed y;
+ bool isFinite() { return qIsFinite(x) && qIsFinite(y); }
bool operator==(const qfixed2d &other) const { return qFuzzyCompare(x, other.x)
&& qFuzzyCompare(y, other.y); }
};
diff --git a/src/platformsupport/linuxaccessibility/bridge.cpp b/src/platformsupport/linuxaccessibility/bridge.cpp
index 9b02d44aa5..a96fe258df 100644
--- a/src/platformsupport/linuxaccessibility/bridge.cpp
+++ b/src/platformsupport/linuxaccessibility/bridge.cpp
@@ -261,6 +261,10 @@ static RoleMapping map[] = {
//: Role of an accessible object
{ QAccessible::ComplementaryContent, ATSPI_ROLE_SECTION, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "complementary content") },
//: Role of an accessible object
+ { QAccessible::Terminal, ATSPI_ROLE_TERMINAL, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "terminal") },
+ //: Role of an accessible object
+ { QAccessible::Desktop, ATSPI_ROLE_DESKTOP_FRAME, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "desktop") },
+ //: Role of an accessible object
{ QAccessible::UserRole, ATSPI_ROLE_UNKNOWN, QT_TRANSLATE_NOOP("QSpiAccessibleBridge", "unknown") }
};
@@ -268,6 +272,12 @@ void QSpiAccessibleBridge::initializeConstantMappings()
{
for (uint i = 0; i < sizeof(map) / sizeof(RoleMapping); ++i)
qSpiRoleMapping.insert(map[i].role, RoleNames(map[i].spiRole, QLatin1String(map[i].name), tr(map[i].name)));
+
+ // -1 because we have button duplicated, as PushButton and Button.
+ Q_ASSERT_X(qSpiRoleMapping.size() ==
+ QAccessible::staticMetaObject.enumerator(
+ QAccessible::staticMetaObject.indexOfEnumerator("Role")).keyCount() - 1,
+ "", "Handle all QAccessible::Role members in qSpiRoleMapping");
}
QT_END_NAMESPACE
diff --git a/src/plugins/imageformats/ico/qicohandler.cpp b/src/plugins/imageformats/ico/qicohandler.cpp
index 30935cacda..4908850cc5 100644
--- a/src/plugins/imageformats/ico/qicohandler.cpp
+++ b/src/plugins/imageformats/ico/qicohandler.cpp
@@ -523,17 +523,21 @@ QImage ICOReader::iconAt(int index)
if (!image.isNull()) {
readBMP(image);
if (!image.isNull()) {
- QImage mask(image.width(), image.height(), QImage::Format_Mono);
- if (!mask.isNull()) {
- mask.setColorCount(2);
- mask.setColor(0, qRgba(255,255,255,0xff));
- mask.setColor(1, qRgba(0 ,0 ,0 ,0xff));
- read1BitBMP(mask);
+ if (icoAttrib.depth == 32) {
+ img = std::move(image).convertToFormat(QImage::Format_ARGB32_Premultiplied);
+ } else {
+ QImage mask(image.width(), image.height(), QImage::Format_Mono);
if (!mask.isNull()) {
- img = image;
- img.setAlphaChannel(mask);
- // (Luckily, it seems that setAlphaChannel() does not ruin the alpha values
- // of partially transparent pixels in those icons that have that)
+ mask.setColorCount(2);
+ mask.setColor(0, qRgba(255,255,255,0xff));
+ mask.setColor(1, qRgba(0 ,0 ,0 ,0xff));
+ read1BitBMP(mask);
+ if (!mask.isNull()) {
+ img = image;
+ img.setAlphaChannel(mask);
+ // (Luckily, it seems that setAlphaChannel() does not ruin the alpha values
+ // of partially transparent pixels in those icons that have that)
+ }
}
}
}
diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm
index 6d6648c1fa..288e4cd29a 100644
--- a/src/plugins/styles/mac/qmacstyle_mac.mm
+++ b/src/plugins/styles/mac/qmacstyle_mac.mm
@@ -447,6 +447,42 @@ static const int toolButtonArrowMargin = 2;
static const qreal focusRingWidth = 3.5;
+// An application can force 'Aqua' theme while the system theme is one of
+// the 'Dark' variants. Since in Qt we sometimes use NSControls and even
+// NSCells directly without attaching them to any view hierarchy, we have
+// to set NSAppearance.currentAppearance to 'Aqua' manually, to make sure
+// the correct rendering path is triggered. Apple recommends us to un-set
+// the current appearance back after we finished with drawing. This is what
+// AppearanceSync is for.
+
+class AppearanceSync {
+public:
+ AppearanceSync()
+ {
+#if QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_14)
+ if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::MacOSMojave
+ && !qt_mac_applicationIsInDarkMode()) {
+ auto requiredAppearanceName = NSApplication.sharedApplication.effectiveAppearance.name;
+ if (![NSAppearance.currentAppearance.name isEqualToString:requiredAppearanceName]) {
+ previous = NSAppearance.currentAppearance;
+ NSAppearance.currentAppearance = [NSAppearance appearanceNamed:requiredAppearanceName];
+ }
+ }
+#endif // QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_14)
+ }
+
+ ~AppearanceSync()
+ {
+ if (previous)
+ NSAppearance.currentAppearance = previous;
+ }
+
+private:
+ NSAppearance *previous = nil;
+
+ Q_DISABLE_COPY(AppearanceSync)
+};
+
static bool setupScroller(NSScroller *scroller, const QStyleOptionSlider *sb)
{
const qreal length = sb->maximum - sb->minimum + sb->pageStep;
@@ -2918,6 +2954,7 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
const QWidget *w) const
{
Q_D(const QMacStyle);
+ const AppearanceSync appSync;
QMacCGContext cg(p);
QWindow *window = w && w->window() ? w->window()->windowHandle() : nullptr;
d->resolveCurrentNSView(window);
@@ -3443,6 +3480,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
const QWidget *w) const
{
Q_D(const QMacStyle);
+ const AppearanceSync sync;
QMacCGContext cg(p);
QWindow *window = w && w->window() ? w->window()->windowHandle() : nullptr;
d->resolveCurrentNSView(window);
@@ -5033,6 +5071,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
const QWidget *widget) const
{
Q_D(const QMacStyle);
+ const AppearanceSync sync;
QMacCGContext cg(p);
QWindow *window = widget && widget->window() ? widget->window()->windowHandle() : nullptr;
d->resolveCurrentNSView(window);
diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp
index 3af5237f3d..fd7f72eebf 100644
--- a/src/tools/androiddeployqt/main.cpp
+++ b/src/tools/androiddeployqt/main.cpp
@@ -900,7 +900,7 @@ bool readInputFile(Options *options)
options->extraPlugins = extraPlugins.toString().split(QLatin1Char(','));
}
- if (!options->auxMode) {
+ {
const QJsonValue stdcppPath = jsonObject.value(QStringLiteral("stdcpp-path"));
if (stdcppPath.isUndefined()) {
fprintf(stderr, "No stdcpp-path defined in json file.\n");
diff --git a/tests/auto/other/lancelot/scripts/thinlines.qps b/tests/auto/other/lancelot/scripts/thinlines.qps
new file mode 100644
index 0000000000..dddfff4538
--- /dev/null
+++ b/tests/auto/other/lancelot/scripts/thinlines.qps
@@ -0,0 +1,79 @@
+# Version: 1
+# CheckVsReference: 5%
+
+drawRect 0 0 800 800
+
+path_addRect p 0 0 75 75
+path_addEllipse p 25 25 75 75
+
+translate -500 -500
+
+begin_block drawing
+ save
+ drawLine 0 0 100 100
+
+ translate 0 100
+ drawPath p
+
+ translate 0 110
+ drawRect 0 0 100 100
+
+ translate 0 110
+ drawPolyline [0 0 100 0 50 50]
+
+ drawPoint 40 40
+ drawPoint 41 40
+ drawPoint 42 40
+ drawPoint 43 40
+ drawPoint 44 40
+ drawPoint 45 40
+ drawPoint 46 40
+ drawPoint 47 40
+ drawPoint 48 40
+ drawPoint 49 40
+ drawPoint 50 40
+
+ restore
+end_block
+
+begin_block univsnonuni
+ save
+
+ save
+ scale 0.7 0.7
+ repeat_block drawing
+ restore
+
+ translate 100 0
+ save
+ scale 0.7 0.8
+ repeat_block drawing
+ restore
+
+ restore
+end_block
+
+resetMatrix
+translate 20.5 20.5
+
+begin_block row
+save
+ repeat_block univsnonuni
+
+ translate 240 0
+ save
+ rotate 10
+ repeat_block univsnonuni
+ restore
+
+ translate 220 0
+ save
+ rotate_y 30
+ repeat_block univsnonuni
+ restore
+restore
+end_block
+
+translate 0 320
+setRenderHint AntiAliasing
+repeat_block row