From 456f0e0f1a4fb422b029c5abd30e2e622435f76a Mon Sep 17 00:00:00 2001 From: Vyacheslav Koscheev Date: Thu, 27 Oct 2016 11:06:09 +0700 Subject: Compilation fix If qreal is float, then android-clang compilation was breaking here Change-Id: Ieccc357ecbbea5cbb22a5808dd0791795240a985 Reviewed-by: Marc Mutz --- src/gui/text/qfontengine_ft.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index 1711865e59..199e207578 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -1790,7 +1790,7 @@ void QFontEngineFT::unlockAlphaMapForGlyph() static inline bool is2dRotation(const QTransform &t) { return qFuzzyCompare(t.m11(), t.m22()) && qFuzzyCompare(t.m12(), -t.m21()) - && qFuzzyCompare(t.m11()*t.m22() - t.m12()*t.m21(), 1.0); + && qFuzzyCompare(t.m11()*t.m22() - t.m12()*t.m21(), qreal(1.0)); } QFontEngineFT::Glyph *QFontEngineFT::loadGlyphFor(glyph_t g, -- cgit v1.2.3 From 1bd53131d83cdf595f95f82f0c049d2d68957159 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 27 Oct 2016 12:51:43 +0200 Subject: configure: Determine MSVC version by evaluating macro _MSC_FULL_VER The previously used regular expression failed for messages in local languages, particularly for the French message containing a non-breaking space. Task-number: QTBUG-56388 Change-Id: Ie757617f1b3a31820d0ed274c4b157d544ac1ea6 Reviewed-by: Oswald Buddenhagen --- tools/configure/environment.cpp | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/tools/configure/environment.cpp b/tools/configure/environment.cpp index 60616f35e7..153a141d7a 100644 --- a/tools/configure/environment.cpp +++ b/tools/configure/environment.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -172,25 +173,23 @@ QString Environment::gccVersion() QString Environment::msvcVersion() { int returnValue = 0; - // Extract version from standard error output of "cl /?" - const QString command = QFile::decodeName(qgetenv("ComSpec")) - + QLatin1String(" /c ") + QLatin1String(compilerInfo(CC_MSVC2015)->executable) - + QLatin1String(" /? 2>&1"); - SetEnvironmentVariable(L"CL", NULL); // May contain /nologo, which suppresses the version. - QString version = execute(command, &returnValue); - if (returnValue != 0) { - cout << "Could not get cl version" << returnValue << qPrintable(version) << '\n';; - version.clear(); - } else { - QRegExp versionRegexp(QStringLiteral("^.*\\b(\\d{2,2}\\.\\d{2,2}\\.\\d{5,5})\\b.*$")); - Q_ASSERT(versionRegexp.isValid()); - if (versionRegexp.exactMatch(version)) { - version = versionRegexp.cap(1); - } else { - cout << "Unable to determine cl version from the output of \"" - << qPrintable(command) << "\"\n"; - } + QString tempSourceName; + { // QTemporaryFile needs to go out of scope, otherwise cl.exe refuses to open it. + QTemporaryFile tempSource(QDir::tempPath() + QLatin1String("/XXXXXX.cpp")); + tempSource.setAutoRemove(false); + if (!tempSource.open()) + return QString(); + tempSource.write("_MSC_FULL_VER\n"); + tempSourceName = tempSource.fileName(); } + QString version = execute(QLatin1String("cl /nologo /EP \"") + + QDir::toNativeSeparators(tempSourceName) + QLatin1Char('"'), + &returnValue).trimmed(); + QFile::remove(tempSourceName); + if (returnValue || version.size() < 9 || !version.at(0).isDigit()) + return QString(); + version.insert(4, QLatin1Char('.')); + version.insert(2, QLatin1Char('.')); return version; } -- cgit v1.2.3 From d19f01acbf9547762150a479793b84898f1a115e Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Tue, 18 Oct 2016 13:02:34 +0200 Subject: nsphotolibrarysupport: add missing namespace macros Change-Id: Ib2014dc64dfcc1ea8de63a1668907ace6d26c530 Reviewed-by: Jake Petroules --- .../ios/optional/nsphotolibrarysupport/qiosfileengineassetslibrary.h | 5 +++++ .../optional/nsphotolibrarysupport/qiosfileengineassetslibrary.mm | 4 ++++ .../ios/optional/nsphotolibrarysupport/qiosfileenginefactory.h | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileengineassetslibrary.h b/src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileengineassetslibrary.h index 89696751c6..d4dc77b1a3 100644 --- a/src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileengineassetslibrary.h +++ b/src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileengineassetslibrary.h @@ -37,6 +37,9 @@ #include Q_FORWARD_DECLARE_OBJC_CLASS(ALAsset); + +QT_BEGIN_NAMESPACE + class QIOSAssetData; class QIOSFileEngineAssetsLibrary : public QAbstractFileEngine @@ -72,5 +75,7 @@ private: ALAsset *loadAsset() const; }; +QT_END_NAMESPACE + #endif // QIOSFILEENGINEASSETSLIBRARY_H diff --git a/src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileengineassetslibrary.mm b/src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileengineassetslibrary.mm index 2e88c37c01..110348d32b 100644 --- a/src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileengineassetslibrary.mm +++ b/src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileengineassetslibrary.mm @@ -42,6 +42,8 @@ #include #include +QT_BEGIN_NAMESPACE + static QThreadStorage g_iteratorCurrentUrl; static QThreadStorage > g_assetDataCache; @@ -466,4 +468,6 @@ QAbstractFileEngine::Iterator *QIOSFileEngineAssetsLibrary::endEntryList() return 0; } +QT_END_NAMESPACE + #endif diff --git a/src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileenginefactory.h b/src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileenginefactory.h index 29f543caae..f41de5f8ec 100644 --- a/src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileenginefactory.h +++ b/src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileenginefactory.h @@ -38,6 +38,8 @@ #include #include "qiosfileengineassetslibrary.h" +QT_BEGIN_NAMESPACE + class QIOSFileEngineFactory : public QAbstractFileEngineHandler { public: @@ -52,4 +54,6 @@ public: } }; +QT_END_NAMESPACE + #endif // QIOSFILEENGINEFACTORY_H -- cgit v1.2.3 From 0e2d38b4477ffec6941d0f88cfa7bf92a8b79843 Mon Sep 17 00:00:00 2001 From: Alex Trotsenko Date: Mon, 24 Oct 2016 19:16:13 +0300 Subject: QAbstractSocket: avoid unspecified behavior in writing on TCP Passing zero as size parameter to QAbstractSocketEngine::write() has unspecified behavior, at least for TCP sockets. This could happen on flush() when writeBuffer is empty or on writeData() with size 0. Avoid by explicitly checking against zero size. Change-Id: I070630d244ce6c3de3da94f84c2cded2c7a4b081 Reviewed-by: Edward Welbourne --- src/network/socket/qabstractsocket.cpp | 4 ++-- src/network/socket/qnativesocketengine.cpp | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index 3d665270fd..f28dc6698a 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -881,7 +881,7 @@ bool QAbstractSocketPrivate::flush() const char *ptr = writeBuffer.readPointer(); // Attempt to write it all in one chunk. - qint64 written = socketEngine->write(ptr, nextSize); + qint64 written = nextSize ? socketEngine->write(ptr, nextSize) : Q_INT64_C(0); if (written < 0) { #if defined (QABSTRACTSOCKET_DEBUG) qDebug() << "QAbstractSocketPrivate::flush() write error, aborting." << socketEngine->errorString(); @@ -2477,7 +2477,7 @@ qint64 QAbstractSocket::writeData(const char *data, qint64 size) if (!d->isBuffered && d->socketType == TcpSocket && d->socketEngine && d->writeBuffer.isEmpty()) { // This code is for the new Unbuffered QTcpSocket use case - qint64 written = d->socketEngine->write(data, size); + qint64 written = size ? d->socketEngine->write(data, size) : Q_INT64_C(0); if (written < 0) { d->setError(d->socketEngine->error(), d->socketEngine->errorString()); return written; diff --git a/src/network/socket/qnativesocketengine.cpp b/src/network/socket/qnativesocketengine.cpp index 805acde860..86d13d82a2 100644 --- a/src/network/socket/qnativesocketengine.cpp +++ b/src/network/socket/qnativesocketengine.cpp @@ -846,6 +846,10 @@ qint64 QNativeSocketEngine::writeDatagram(const char *data, qint64 size, const Q /*! Writes a block of \a size bytes from \a data to the socket. Returns the number of bytes written, or -1 if an error occurred. + + Passing zero as the \a size parameter on a connected UDP socket + will send an empty datagram. For other socket types results are + unspecified. */ qint64 QNativeSocketEngine::write(const char *data, qint64 size) { -- cgit v1.2.3 From af3e697ad60358d5a68b8692ee4d2e4f92ab65f8 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 13 Sep 2016 08:34:06 +0200 Subject: QWindowsXPStyle: Use qreal scale factors in theme drawing helpers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This improves support for fractional scale factors. Task-number: QTBUG-49374 Change-Id: Ied6579ee831f3ea29f238baaffa67374ea6823d9 Reviewed-by: Morten Johan Sørvig --- src/widgets/styles/qwindowsxpstyle.cpp | 36 ++++++++++++++++---------------- src/widgets/styles/qwindowsxpstyle_p_p.h | 4 ++-- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/widgets/styles/qwindowsxpstyle.cpp b/src/widgets/styles/qwindowsxpstyle.cpp index 3017707117..e85d0360f9 100644 --- a/src/widgets/styles/qwindowsxpstyle.cpp +++ b/src/widgets/styles/qwindowsxpstyle.cpp @@ -803,7 +803,7 @@ bool QWindowsXPStylePrivate::drawBackground(XPThemeData &themeData) bool translucentToplevel = false; const QPaintDevice *paintDevice = painter->device(); - const qreal aditionalDevicePixelRatio = themeData.widget ? themeData.widget->devicePixelRatio() : 1; + const qreal aditionalDevicePixelRatio = themeData.widget ? themeData.widget->devicePixelRatioF() : qreal(1); if (paintDevice->devType() == QInternal::Widget) { const QWidget *window = static_cast(paintDevice)->window(); translucentToplevel = window->testAttribute(Qt::WA_TranslucentBackground); @@ -832,28 +832,28 @@ bool QWindowsXPStylePrivate::drawBackground(XPThemeData &themeData) const HDC dc = canDrawDirectly ? hdcForWidgetBackingStore(themeData.widget) : HDC(0); const bool result = dc - ? drawBackgroundDirectly(dc, themeData, qRound(aditionalDevicePixelRatio)) - : drawBackgroundThruNativeBuffer(themeData, qRound(aditionalDevicePixelRatio)); + ? drawBackgroundDirectly(dc, themeData, aditionalDevicePixelRatio) + : drawBackgroundThruNativeBuffer(themeData, aditionalDevicePixelRatio); painter->restore(); return result; } -static inline QRect scaleRect(const QRect &r, int factor) +static inline QRectF scaleRect(const QRectF &r, qreal factor) { return r.isValid() && factor > 1 - ? QRect(r.topLeft() * factor, r.size() * factor) + ? QRectF(r.topLeft() * factor, r.size() * factor) : r; } -static QRegion scaleRegion(const QRegion ®ion, int factor) +static QRegion scaleRegion(const QRegion ®ion, qreal factor) { - if (region.isEmpty() || factor == 1) + if (region.isEmpty() || qFuzzyCompare(factor, qreal(1))) return region; if (region.rectCount() == 1) - return QRegion(scaleRect(region.boundingRect(), factor)); + return QRegion(scaleRect(QRectF(region.boundingRect()), factor).toRect()); QRegion result; foreach (const QRect &rect, region.rects()) - result += QRect(rect.topLeft() * factor, rect.size() * factor); + result += QRectF(QPointF(rect.topLeft()) * factor, QSizeF(rect.size() * factor)).toRect(); return result; } @@ -862,13 +862,12 @@ static QRegion scaleRegion(const QRegion ®ion, int factor) Do not use this if you need to perform other transformations on the resulting data. */ -bool QWindowsXPStylePrivate::drawBackgroundDirectly(HDC dc, XPThemeData &themeData, int additionalDevicePixelRatio) +bool QWindowsXPStylePrivate::drawBackgroundDirectly(HDC dc, XPThemeData &themeData, qreal additionalDevicePixelRatio) { QPainter *painter = themeData.painter; - QPoint redirectionDelta(int(painter->deviceMatrix().dx()), - int(painter->deviceMatrix().dy())); - QRect area = scaleRect(themeData.rect, additionalDevicePixelRatio).translated(redirectionDelta); + const QPointF redirectionDelta(painter->deviceMatrix().dx(), painter->deviceMatrix().dy()); + const QRect area = scaleRect(QRectF(themeData.rect), additionalDevicePixelRatio).translated(redirectionDelta).toRect(); QRegion sysRgn = painter->paintEngine()->systemClip(); if (sysRgn.isEmpty()) @@ -876,7 +875,7 @@ bool QWindowsXPStylePrivate::drawBackgroundDirectly(HDC dc, XPThemeData &themeDa else sysRgn &= area; if (painter->hasClipping()) - sysRgn &= scaleRegion(painter->clipRegion(), additionalDevicePixelRatio).translated(redirectionDelta); + sysRgn &= scaleRegion(painter->clipRegion(), additionalDevicePixelRatio).translated(redirectionDelta.toPoint()); HRGN hrgn = qt_hrgn_from_qregion(sysRgn); SelectClipRgn(dc, hrgn); @@ -948,15 +947,16 @@ bool QWindowsXPStylePrivate::drawBackgroundDirectly(HDC dc, XPThemeData &themeDa engine). */ bool QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(XPThemeData &themeData, - int additionalDevicePixelRatio) + qreal additionalDevicePixelRatio) { QPainter *painter = themeData.painter; - QRect rect = scaleRect(themeData.rect, additionalDevicePixelRatio); + QRectF rectF = scaleRect(QRectF(themeData.rect), additionalDevicePixelRatio); if ((themeData.rotate + 90) % 180 == 0) { // Catch 90,270,etc.. degree flips. - rect = QRect(0, 0, rect.height(), rect.width()); + rectF = QRectF(0, 0, rectF.height(), rectF.width()); } - rect.moveTo(0,0); + rectF.moveTo(0, 0); + QRect rect = rectF.toRect(); int partId = themeData.partId; int stateId = themeData.stateId; int w = rect.width(); diff --git a/src/widgets/styles/qwindowsxpstyle_p_p.h b/src/widgets/styles/qwindowsxpstyle_p_p.h index 51541ed218..5a6a23511f 100644 --- a/src/widgets/styles/qwindowsxpstyle_p_p.h +++ b/src/widgets/styles/qwindowsxpstyle_p_p.h @@ -388,8 +388,8 @@ public: void setTransparency(QWidget *widget, XPThemeData &themeData); bool drawBackground(XPThemeData &themeData); - bool drawBackgroundThruNativeBuffer(XPThemeData &themeData, int aditionalDevicePixelRatio); - bool drawBackgroundDirectly(HDC dc, XPThemeData &themeData, int aditionalDevicePixelRatio); + bool drawBackgroundThruNativeBuffer(XPThemeData &themeData, qreal aditionalDevicePixelRatio); + bool drawBackgroundDirectly(HDC dc, XPThemeData &themeData, qreal aditionalDevicePixelRatio); bool hasAlphaChannel(const QRect &rect); bool fixAlphaChannel(const QRect &rect); -- cgit v1.2.3 From f9280ba45ed6e492871cd25026a1bce7a17042dc Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Mon, 24 Oct 2016 13:49:41 -0700 Subject: QNSColorPanelDelegate: Don't restore stolen view on dealloc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We may not be playing nice with Cocoa's internals when we decide to reparent NSColorPanel's contents to add QColorDialog's own OK/Cancel buttons. In order to reduce issues, we should avoid poking at things during the application's shutdown sequence. Simply releasing the stolen view should be enough at that point. A similar pattern exists in QNSFontPanelDelegate. Change-Id: I678c236e0c57c4d08a1109a479d965f924288c54 Task-number: QTBUG-56448 Reviewed-by: Tor Arne Vestbø Reviewed-by: Timur Pocheptsov Reviewed-by: Erik Verbruggen --- src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm | 2 +- src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm index ed17ef8fe9..3c924bec94 100644 --- a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm @@ -116,7 +116,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate); - (void)dealloc { - [self restoreOriginalContentView]; + [mStolenContentView release]; [mColorPanel setDelegate:nil]; [[NSNotificationCenter defaultCenter] removeObserver:self]; diff --git a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm index d1802fe4f9..5b27dc1da9 100644 --- a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm @@ -144,7 +144,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSFontPanelDelegate); - (void)dealloc { - [self restoreOriginalContentView]; + [mStolenContentView release]; [mFontPanel setDelegate:nil]; [[NSFontManager sharedFontManager] setDelegate:nil]; [[NSNotificationCenter defaultCenter] removeObserver:self]; -- cgit v1.2.3 From d245db2f8350a949a83a75ff36f5d9d8ec75db9a Mon Sep 17 00:00:00 2001 From: Anton Kudryavtsev Date: Wed, 12 Oct 2016 18:29:40 +0300 Subject: QWidgetPrivate: remove unused declarations of methods ... such as beginSharedPainter() and endSharedPainter() Change-Id: I0e76dd172c2f3bce169f58e4c62bd47c73c99dcd Reviewed-by: Edward Welbourne Reviewed-by: Marc Mutz Reviewed-by: Thiago Macieira --- src/widgets/kernel/qwidget_p.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h index 37f2c0e5c7..dbc9d86172 100644 --- a/src/widgets/kernel/qwidget_p.h +++ b/src/widgets/kernel/qwidget_p.h @@ -395,9 +395,6 @@ public: const QRegion &rgn, const QPoint &offset, int flags, QPainter *sharedPainter, QWidgetBackingStore *backingStore); - - QPainter *beginSharedPainter(); - bool endSharedPainter(); #ifndef QT_NO_GRAPHICSVIEW static QGraphicsProxyWidget * nearestGraphicsProxyWidget(const QWidget *origin); #endif -- cgit v1.2.3 From 431bc3321f85a23ae41944a53df3934ce4c3a381 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Mon, 24 Oct 2016 11:12:03 +0200 Subject: Doc: CSS: Add styling for content generated with \legalese command Even though the \legalese command is no longer used in Qt 5 documentation as it doesn't support collating legalese texts across modules, it may still be useful for stand-alone doc projects. Add CSS rules so the \legalese text is styled similarly to code blocks, to make it stand out from the rest of the content. Change-Id: I533d8e2375ea2f8054c0671ff34dfa6f0dfe01d1 Reviewed-by: Leena Miettinen Reviewed-by: Venugopal Shivashankar --- doc/global/template/style/offline-simple.css | 2 +- doc/global/template/style/offline.css | 8 ++++++-- doc/global/template/style/online.css | 6 +++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/doc/global/template/style/offline-simple.css b/doc/global/template/style/offline-simple.css index 84d206b2d0..a805b924a3 100644 --- a/doc/global/template/style/offline-simple.css +++ b/doc/global/template/style/offline-simple.css @@ -1,4 +1,4 @@ -pre { +pre, .LegaleseLeft { background-color: #f0f0f0; font-family: Courier, monospace; font-weight: 600; diff --git a/doc/global/template/style/offline.css b/doc/global/template/style/offline.css index 612c1087d5..b943dbb7ac 100644 --- a/doc/global/template/style/offline.css +++ b/doc/global/template/style/offline.css @@ -424,7 +424,7 @@ table styles /* table with border alternative colours*/ -table, pre { +table, pre, .LegaleseLeft { -moz-border-radius: 7px 7px 7px 7px; -webkit-border-radius: 7px 7px 7px 7px; border-radius: 7px 7px 7px 7px; @@ -481,6 +481,10 @@ table, pre { margin: 0px } +.LegaleseLeft { + font-family: monospace; + white-space: pre-wrap; +} /* table bodless & white*/ .borderless { @@ -543,7 +547,7 @@ ol.a > li{ text-align: left } -.cpp { +.cpp, .LegaleseLeft { display: block; margin: 10px; overflow: auto; diff --git a/doc/global/template/style/online.css b/doc/global/template/style/online.css index be278a27da..c0caa84027 100644 --- a/doc/global/template/style/online.css +++ b/doc/global/template/style/online.css @@ -1364,7 +1364,7 @@ div.qt_commercial { border-top:5px solid #5caa15; margin-bottom:50px } -pre { +pre, .LegaleseLeft { background-color:#404244; color:#fff; display:block; @@ -1375,6 +1375,10 @@ pre { padding:25px; margin-top:0.75em } +.mainContent .LegaleseLeft p { + color:#fff; + white-space: pre-wrap +} .copy_text { background-color:#46a2da; color:#fff; -- cgit v1.2.3 From dbf35d75714fac1e836e697650e32365a2a3493e Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Thu, 7 Apr 2016 11:05:04 +0200 Subject: Doc: Fix a typo in QtConcurrent example snippet And use different wording to describe QtConcurrent::filtered(), as it doesn't modify the sequence it operates on. Change-Id: I768c0d121e027c5de36ba7bd548c2d4c2a7f1bd9 Reviewed-by: Martin Smith --- .../doc/snippets/code/src_concurrent_qtconcurrentfilter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentfilter.cpp b/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentfilter.cpp index 86ca09a421..77233bdbf7 100644 --- a/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentfilter.cpp +++ b/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentfilter.cpp @@ -103,9 +103,9 @@ QSet dictionary = QtConcurrent::blockingFilteredReduced(strings, allLow //! [7] // keep only images with an alpha channel QList images = ...; -QFuture alphaImages = QtConcurrent::filter(strings, &QImage::hasAlphaChannel); +QFuture alphaImages = QtConcurrent::filter(images, &QImage::hasAlphaChannel); -// keep only gray scale images +// retrieve gray scale images QList images = ...; QFuture grayscaleImages = QtConcurrent::filtered(images, &QImage::isGrayscale); -- cgit v1.2.3 From 4c00246fea63c348a2992f5a54499f2928bf0605 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Somers?= Date: Tue, 25 Oct 2016 16:27:58 +0200 Subject: Fixed crash taking null central widget When no central widget has been set, calling takeCentralWidget should just return a null pointer instead of crashing. [ChangeLog][QtWidgets][QMainWindow] Fixed crash using takeCentralWidget when the central widget was not set. Task-number: QTBUG-56628 Change-Id: I240ccf4caa41d2716a78851571fbfbf444a4922e Reviewed-by: Giuseppe D'Angelo --- src/widgets/widgets/qmainwindow.cpp | 6 ++++-- tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/widgets/widgets/qmainwindow.cpp b/src/widgets/widgets/qmainwindow.cpp index 50ba7f97ec..e454e3e991 100644 --- a/src/widgets/widgets/qmainwindow.cpp +++ b/src/widgets/widgets/qmainwindow.cpp @@ -664,8 +664,10 @@ QWidget *QMainWindow::takeCentralWidget() { Q_D(QMainWindow); QWidget *oldcentralwidget = d->layout->centralWidget(); - oldcentralwidget->setParent(0); - d->layout->setCentralWidget(0); + if (oldcentralwidget) { + oldcentralwidget->setParent(0); + d->layout->setCentralWidget(0); + } return oldcentralwidget; } diff --git a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp index 6282028746..ece011d145 100644 --- a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp +++ b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp @@ -864,6 +864,10 @@ void tst_QMainWindow::takeCentralWidget() { QVERIFY(!mw.centralWidget()); + // verify that we don't crash when trying to take a non-set + // central widget but just return a null pointer instead + QVERIFY(!mw.takeCentralWidget()); + mw.setCentralWidget(w1); QWidget *oldCentralWidget = mw.takeCentralWidget(); -- cgit v1.2.3 From d16d56a05ee9219ba6b7985b56a7bd69fb248875 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 28 Oct 2016 15:38:59 +0200 Subject: MSVC: Fix installation of PDB files for static libraries Commit 3d3d65f5 separated the PDB files for compiling and linking. Only the PDB file the linker produces would be installed. However, this does not work for static libraries as the LIB tool does not create a PDB file from the compiler's PDB file. This patch turns the separation between PDB files off for static libraries. Task-number: QTBUG-56594 Change-Id: I08dcb7889c67b2f6370efa1ee19be8558355bbc9 Reviewed-by: Oswald Buddenhagen --- qmake/generators/win32/msvc_nmake.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp index ae139c23be..41bec4c36d 100644 --- a/qmake/generators/win32/msvc_nmake.cpp +++ b/qmake/generators/win32/msvc_nmake.cpp @@ -409,14 +409,21 @@ void NmakeMakefileGenerator::init() project->values("QMAKE_DISTCLEAN").append(tgt + ".lib"); } if (project->isActiveConfig("debug_info")) { - // Add the compiler's PDB file. - QString pdbfile = var("OBJECTS_DIR") + project->first("TARGET") + ".vc.pdb"; + QString pdbfile; + QString distPdbFile = tgt + ".pdb"; + if (project->isActiveConfig("staticlib")) { + // For static libraries, the compiler's pdb file and the dist pdb file are the same. + pdbfile = distPdbFile; + } else { + // Use $${TARGET}.vc.pdb in the OBJECTS_DIR for the compiler and + // $${TARGET}.pdb (the default) for the linker. + pdbfile = var("OBJECTS_DIR") + project->first("TARGET") + ".vc.pdb"; + } QString escapedPdbFile = escapeFilePath(pdbfile); project->values("QMAKE_CFLAGS").append("/Fd" + escapedPdbFile); project->values("QMAKE_CXXFLAGS").append("/Fd" + escapedPdbFile); project->values("QMAKE_CLEAN").append(pdbfile); - // Add the linker's PDB file to the distclean target. - project->values("QMAKE_DISTCLEAN").append(tgt + ".pdb"); + project->values("QMAKE_DISTCLEAN").append(distPdbFile); } if (project->isActiveConfig("debug")) { project->values("QMAKE_CLEAN").append(tgt + ".ilk"); -- cgit v1.2.3 From 401172a1986f834cf2010c3af988b3234c47abe2 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Thu, 6 Oct 2016 11:52:36 +0200 Subject: Doc: Fix typos: handing > handling Change-Id: Iecc64cba620ec639d06684e30264171052f21e10 Reviewed-by: Nico Vertriest --- examples/widgets/doc/src/calculator.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/widgets/doc/src/calculator.qdoc b/examples/widgets/doc/src/calculator.qdoc index 8d00bc7512..ea5051ce0a 100644 --- a/examples/widgets/doc/src/calculator.qdoc +++ b/examples/widgets/doc/src/calculator.qdoc @@ -261,7 +261,7 @@ \snippet widgets/calculator/calculator.cpp 20 - Like in \c additiveOperatorClicked(), we start by handing any + Like in \c additiveOperatorClicked(), we start by handling any pending multiplicative and additive operators. Then we display \c sumSoFar and reset the variable to zero. Resetting the variable to zero is necessary to avoid counting the value twice. -- cgit v1.2.3 From f9ec707e4960bf7d5298ee2ba8f22d7506ef54a7 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 18 Oct 2016 10:56:11 -0700 Subject: windows: Disable OpenGL proper on Intel 945 Change-Id: I77fbf5bafcd6b0fe5040513ef6b0d049600f9b33 Task-number: QTBUG-40991 Reviewed-by: Friedemann Kleint --- src/plugins/platforms/windows/openglblacklists/default.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/plugins/platforms/windows/openglblacklists/default.json b/src/plugins/platforms/windows/openglblacklists/default.json index 1e00da52eb..dd99e674ec 100644 --- a/src/plugins/platforms/windows/openglblacklists/default.json +++ b/src/plugins/platforms/windows/openglblacklists/default.json @@ -102,6 +102,18 @@ "features": [ "disable_desktopgl", "disable_d3d11", "disable_d3d9" ] + }, + { + "id": 9, + "description": "Intel 945 crash (QTBUG-40991)", + "vendor_id": "0x8086", + "device_id": [ "0x27A2" ], + "os": { + "type": "win" + }, + "features": [ + "disable_desktopgl" + ] } ] } -- cgit v1.2.3 From ca5d4137aa352d61d796c82b06e2d8f19a07cf10 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 27 Oct 2016 12:37:02 +0200 Subject: minimalegl: Reorder includes to avoid EGL native type clashes Some of the qminimaleglscreen.h includes are not even necessary. With the inclusion of egl.h (or qt_egl_p.h in 5.7 and up) isolated to this header, all we need to ensure is that the sources that include it place the include at a suitable place. This is not the only possible solution, there are alternatives (each with its own caveat), but this is likely the least intrusive. Task-number: QTBUG-56559 Change-Id: I17db031c8e401d9895a417ba3568ad1e4ba30f72 Reviewed-by: Louai Al-Khanji --- src/plugins/platforms/minimalegl/qminimaleglintegration.cpp | 3 ++- src/plugins/platforms/minimalegl/qminimaleglintegration.h | 2 -- src/plugins/platforms/minimalegl/qminimaleglwindow.h | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp b/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp index 1bcb22618e..5328a8b353 100644 --- a/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp +++ b/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp @@ -52,7 +52,8 @@ #include #include -#include +// this is where EGL headers are pulled in, make sure it is last +#include "qminimaleglscreen.h" QT_BEGIN_NAMESPACE diff --git a/src/plugins/platforms/minimalegl/qminimaleglintegration.h b/src/plugins/platforms/minimalegl/qminimaleglintegration.h index 7a2c23ced4..8ceeb7b193 100644 --- a/src/plugins/platforms/minimalegl/qminimaleglintegration.h +++ b/src/plugins/platforms/minimalegl/qminimaleglintegration.h @@ -34,8 +34,6 @@ #ifndef QMINIMALEGLINTEGRATION_H #define QMINIMALEGLINTEGRATION_H -#include "qminimaleglscreen.h" - #include #include diff --git a/src/plugins/platforms/minimalegl/qminimaleglwindow.h b/src/plugins/platforms/minimalegl/qminimaleglwindow.h index ba7f999602..4edeaf4da9 100644 --- a/src/plugins/platforms/minimalegl/qminimaleglwindow.h +++ b/src/plugins/platforms/minimalegl/qminimaleglwindow.h @@ -35,7 +35,6 @@ #define QMINIMALEGLWINDOW_H #include "qminimaleglintegration.h" -#include "qminimaleglscreen.h" #include -- cgit v1.2.3 From 694702e09d9b17d91db282784f009178cfb1059b Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Fri, 14 Oct 2016 15:37:19 +0200 Subject: Mark the entire widget dirty when changing flush paths This augments 2a7cee47e5e84c73e32a6953e145771196645f1a Task-number: QTBUG-56534 Task-number: QTBUG-54241 Change-Id: I635478c43e353b0e435d3ac30e4cc608a5a2a6a5 Reviewed-by: Friedemann Kleint Reviewed-by: Paul Olav Tvete --- src/widgets/kernel/qwidgetbackingstore.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/widgets/kernel/qwidgetbackingstore.cpp b/src/widgets/kernel/qwidgetbackingstore.cpp index 557e71014e..e00dbaba14 100644 --- a/src/widgets/kernel/qwidgetbackingstore.cpp +++ b/src/widgets/kernel/qwidgetbackingstore.cpp @@ -106,6 +106,7 @@ void QWidgetBackingStore::qt_flush(QWidget *widget, const QRegion ®ion, QBack if (widget != tlw) offset += widget->mapTo(tlw, QPoint()); + QRegion effectiveRegion = region; #ifndef QT_NO_OPENGL const bool compositionWasActive = widget->d_func()->renderToTextureComposeActive; if (!widgetTextures) { @@ -119,6 +120,11 @@ void QWidgetBackingStore::qt_flush(QWidget *widget, const QRegion ®ion, QBack } else { widget->d_func()->renderToTextureComposeActive = true; } + // When changing the composition status, make sure the dirty region covers + // the entire widget. Just having e.g. the shown/hidden render-to-texture + // widget's area marked as dirty is incorrect when changing flush paths. + if (compositionWasActive != widget->d_func()->renderToTextureComposeActive) + effectiveRegion = widget->rect(); // re-test since we may have been forced to this path via the dummy texture list above if (widgetTextures) { @@ -130,12 +136,12 @@ void QWidgetBackingStore::qt_flush(QWidget *widget, const QRegion ®ion, QBack const bool translucentBackground = widget->testAttribute(Qt::WA_TranslucentBackground); // Use the tlw's context, not widget's. The difference is important with native child // widgets where tlw != widget. - backingStore->handle()->composeAndFlush(widget->windowHandle(), region, offset, widgetTextures, + backingStore->handle()->composeAndFlush(widget->windowHandle(), effectiveRegion, offset, widgetTextures, tlw->d_func()->shareContext(), translucentBackground); widget->window()->d_func()->sendComposeStatus(widget->window(), true); } else #endif - backingStore->flush(region, widget->windowHandle(), offset); + backingStore->flush(effectiveRegion, widget->windowHandle(), offset); } #ifndef QT_NO_PAINT_DEBUG -- cgit v1.2.3