From be2e993a9ac03a6fc43b2fa15f3df068984acd70 Mon Sep 17 00:00:00 2001 From: Alex Trotsenko Date: Thu, 22 Oct 2015 20:04:21 +0300 Subject: Fix build with 'udpsocket' feature disabled Wrap related code in QNativeSocketEngine and the tuiotouch plugin in conditionals. Change-Id: Ic6861b1c6a9e041fa8a50f96149f7280473a9fba Reviewed-by: Oswald Buddenhagen Reviewed-by: Friedemann Kleint Reviewed-by: Thiago Macieira --- src/network/socket/qnativesocketengine.cpp | 36 ++++++++++++++++-------------- src/network/socket/qnativesocketengine_p.h | 12 +++++----- src/plugins/generic/generic.pro | 6 ++++- 3 files changed, 31 insertions(+), 23 deletions(-) diff --git a/src/network/socket/qnativesocketengine.cpp b/src/network/socket/qnativesocketengine.cpp index 52e6922b5f..386e0e2cc7 100644 --- a/src/network/socket/qnativesocketengine.cpp +++ b/src/network/socket/qnativesocketengine.cpp @@ -651,6 +651,24 @@ int QNativeSocketEngine::accept() return d->nativeAccept(); } +/*! + Returns the number of bytes that are currently available for + reading. On error, -1 is returned. + + For UDP sockets, this function returns the accumulated size of all + pending datagrams, and it is therefore more useful for UDP sockets + to call hasPendingDatagrams() and pendingDatagramSize(). +*/ +qint64 QNativeSocketEngine::bytesAvailable() const +{ + Q_D(const QNativeSocketEngine); + Q_CHECK_VALID_SOCKETLAYER(QNativeSocketEngine::bytesAvailable(), -1); + Q_CHECK_NOT_STATE(QNativeSocketEngine::bytesAvailable(), QAbstractSocket::UnconnectedState, -1); + + return d->nativeBytesAvailable(); +} + +#ifndef QT_NO_UDPSOCKET #ifndef QT_NO_NETWORKINTERFACE /*! @@ -712,23 +730,6 @@ bool QNativeSocketEngine::setMulticastInterface(const QNetworkInterface &iface) #endif // QT_NO_NETWORKINTERFACE -/*! - Returns the number of bytes that are currently available for - reading. On error, -1 is returned. - - For UDP sockets, this function returns the accumulated size of all - pending datagrams, and it is therefore more useful for UDP sockets - to call hasPendingDatagrams() and pendingDatagramSize(). -*/ -qint64 QNativeSocketEngine::bytesAvailable() const -{ - Q_D(const QNativeSocketEngine); - Q_CHECK_VALID_SOCKETLAYER(QNativeSocketEngine::bytesAvailable(), -1); - Q_CHECK_NOT_STATE(QNativeSocketEngine::bytesAvailable(), QAbstractSocket::UnconnectedState, -1); - - return d->nativeBytesAvailable(); -} - /*! Returns \c true if there is at least one datagram pending. This function is only called by UDP sockets, where a datagram can have @@ -810,6 +811,7 @@ qint64 QNativeSocketEngine::writeDatagram(const char *data, qint64 size, Q_CHECK_TYPE(QNativeSocketEngine::writeDatagram(), QAbstractSocket::UdpSocket, -1); return d->nativeSendDatagram(data, size, d->adjustAddressProtocol(host), port); } +#endif // QT_NO_UDPSOCKET /*! Writes a block of \a size bytes from \a data to the socket. diff --git a/src/network/socket/qnativesocketengine_p.h b/src/network/socket/qnativesocketengine_p.h index 24909bf310..c49ef2c3ad 100644 --- a/src/network/socket/qnativesocketengine_p.h +++ b/src/network/socket/qnativesocketengine_p.h @@ -119,6 +119,12 @@ public: int accept() Q_DECL_OVERRIDE; void close() Q_DECL_OVERRIDE; + qint64 bytesAvailable() const Q_DECL_OVERRIDE; + + qint64 read(char *data, qint64 maxlen) Q_DECL_OVERRIDE; + qint64 write(const char *data, qint64 len) Q_DECL_OVERRIDE; + +#ifndef QT_NO_UDPSOCKET #ifndef QT_NO_NETWORKINTERFACE bool joinMulticastGroup(const QHostAddress &groupAddress, const QNetworkInterface &iface) Q_DECL_OVERRIDE; @@ -128,17 +134,13 @@ public: bool setMulticastInterface(const QNetworkInterface &iface) Q_DECL_OVERRIDE; #endif - qint64 bytesAvailable() const Q_DECL_OVERRIDE; - - qint64 read(char *data, qint64 maxlen) Q_DECL_OVERRIDE; - qint64 write(const char *data, qint64 len) Q_DECL_OVERRIDE; - qint64 readDatagram(char *data, qint64 maxlen, QHostAddress *addr = 0, quint16 *port = 0) Q_DECL_OVERRIDE; qint64 writeDatagram(const char *data, qint64 len, const QHostAddress &addr, quint16 port) Q_DECL_OVERRIDE; bool hasPendingDatagrams() const Q_DECL_OVERRIDE; qint64 pendingDatagramSize() const Q_DECL_OVERRIDE; +#endif // QT_NO_UDPSOCKET qint64 bytesToWrite() const Q_DECL_OVERRIDE; diff --git a/src/plugins/generic/generic.pro b/src/plugins/generic/generic.pro index 82a4ad4ce8..0c1943b7dd 100644 --- a/src/plugins/generic/generic.pro +++ b/src/plugins/generic/generic.pro @@ -1,5 +1,7 @@ TEMPLATE = subdirs +load(qfeatures) + contains(QT_CONFIG, evdev) { SUBDIRS += evdevmouse evdevtouch evdevkeyboard evdevtablet } @@ -8,7 +10,9 @@ contains(QT_CONFIG, tslib) { SUBDIRS += tslib } -SUBDIRS += tuiotouch +!contains(QT_DISABLED_FEATURES, udpsocket) { + SUBDIRS += tuiotouch +} contains(QT_CONFIG, libinput) { SUBDIRS += libinput -- cgit v1.2.3 From bc7d0da741d1bc2ab2d36227d40d255c692a6fa5 Mon Sep 17 00:00:00 2001 From: Andrew McCann Date: Sun, 15 Nov 2015 16:29:47 -0800 Subject: OS X: Fix QStandardPaths::standardLocations() Task-number: QTBUG-49443 Change-Id: I0699dfd3cb4c710ab96c324219444c6294c9d732 Reviewed-by: Jake Petroules Reviewed-by: Milian Wolff --- src/corelib/io/qstandardpaths_mac.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/io/qstandardpaths_mac.mm b/src/corelib/io/qstandardpaths_mac.mm index d6126ce1c3..7b97a03db2 100644 --- a/src/corelib/io/qstandardpaths_mac.mm +++ b/src/corelib/io/qstandardpaths_mac.mm @@ -204,7 +204,7 @@ QStringList QStandardPaths::standardLocations(StandardLocation type) CFRelease(bundleUrl); CFURLRef resourcesUrl = CFBundleCopyResourcesDirectoryURL(mainBundle); - CFStringRef cfResourcesPath = CFURLCopyPath(bundleUrl); + CFStringRef cfResourcesPath = CFURLCopyPath(resourcesUrl); QString resourcesPath = QCFString::toQString(cfResourcesPath); CFRelease(cfResourcesPath); CFRelease(resourcesUrl); -- cgit v1.2.3 From fe4ab7edce3863a23d5871634d93f0b855aa93ac Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Mon, 16 Nov 2015 12:07:15 +0100 Subject: iOS: always flush spontaneous key press events MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When we changed sending key events through QPA instead of directly to the focus object, we only flushed from deleteBackward (06be9f026). The reason was to avoid unnecessary flushes, as this in general can be a source to recursion problems. It turns out that this is also needed when sending Qt::Key_Return. The reason is that we sometimes resign first responder when the return key is pressed, which will also change the focus object in Qt. And without flushing the key event first, it will be processed after the change and therefore end up at the wrong object. It seems like the most sensible thing is to always flush upon receiving spontaneous key/text events from iOS, which is also how it was before. Task-number: QTBUG-49021 Change-Id: I44885a11275dee5039ef6a8abbcbdadc092695e7 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/ios/qiostextresponder.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/ios/qiostextresponder.mm b/src/plugins/platforms/ios/qiostextresponder.mm index c9120e848c..f3ea68cdc4 100644 --- a/src/plugins/platforms/ios/qiostextresponder.mm +++ b/src/plugins/platforms/ios/qiostextresponder.mm @@ -329,6 +329,7 @@ { QWindowSystemInterface::handleKeyEvent(qApp->focusWindow(), QEvent::KeyPress, key, modifiers); QWindowSystemInterface::handleKeyEvent(qApp->focusWindow(), QEvent::KeyRelease, key, modifiers); + QWindowSystemInterface::flushWindowSystemEvents(); } #ifndef QT_NO_SHORTCUT @@ -875,7 +876,6 @@ // UITextInput selects the text to be deleted before calling this method. To avoid // drawing the selection, we flush after posting the key press/release. [self sendKeyPressRelease:Qt::Key_Backspace modifiers:Qt::NoModifier]; - QWindowSystemInterface::flushWindowSystemEvents(); } @end -- cgit v1.2.3 From 5a48d1d164ba507469ee1a8a682a3c194d733890 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 12 Nov 2015 17:26:21 +0100 Subject: Do not leak textures from the backing stores Neither the default nor the eglfs-specific backingstore release the OpenGL textures that are in use when render-to-texture widgets are involved. The result can be fatal on embedded devices that run out of GPU memory at after showing and closing dialogs and popups a certain number of times. Task-number: QTBUG-49363 Task-number: QTBUG-49399 Change-Id: Ia7471b037f147bcca0a4f1db5808ca348e230547 Reviewed-by: Lars Knoll Reviewed-by: Andy Nichols --- src/gui/painting/qplatformbackingstore.cpp | 4 ++ .../qopenglcompositorbackingstore.cpp | 11 ++++++ .../qopenglcompositorbackingstore_p.h | 1 + src/widgets/kernel/qwidget.cpp | 46 ++++++++++++++++------ 4 files changed, 51 insertions(+), 11 deletions(-) diff --git a/src/gui/painting/qplatformbackingstore.cpp b/src/gui/painting/qplatformbackingstore.cpp index 62492980de..70ab9825e9 100644 --- a/src/gui/painting/qplatformbackingstore.cpp +++ b/src/gui/painting/qplatformbackingstore.cpp @@ -65,6 +65,10 @@ public: ~QPlatformBackingStorePrivate() { #ifndef QT_NO_OPENGL + QOpenGLContext *ctx = QOpenGLContext::currentContext(); + Q_ASSERT(ctx); + if (textureId) + ctx->functions()->glDeleteTextures(1, &textureId); if (blitter) blitter->destroy(); delete blitter; diff --git a/src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp b/src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp index 8ce1ed2d2b..55f8ea160c 100644 --- a/src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp +++ b/src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp @@ -67,6 +67,7 @@ QOpenGLCompositorBackingStore::QOpenGLCompositorBackingStore(QWindow *window) : QPlatformBackingStore(window), m_window(window), m_bsTexture(0), + m_bsTextureContext(0), m_textures(new QPlatformTextureList), m_lockedWidgetTextures(0) { @@ -74,6 +75,14 @@ QOpenGLCompositorBackingStore::QOpenGLCompositorBackingStore(QWindow *window) QOpenGLCompositorBackingStore::~QOpenGLCompositorBackingStore() { + if (m_bsTexture) { + QOpenGLContext *ctx = QOpenGLContext::currentContext(); + if (ctx && m_bsTextureContext && ctx->shareGroup() == m_bsTextureContext->shareGroup()) + glDeleteTextures(1, &m_bsTexture); + else + qWarning("QOpenGLCompositorBackingStore: Texture is not valid in the current context"); + } + delete m_textures; } @@ -85,6 +94,8 @@ QPaintDevice *QOpenGLCompositorBackingStore::paintDevice() void QOpenGLCompositorBackingStore::updateTexture() { if (!m_bsTexture) { + m_bsTextureContext = QOpenGLContext::currentContext(); + Q_ASSERT(m_bsTextureContext); glGenTextures(1, &m_bsTexture); glBindTexture(GL_TEXTURE_2D, m_bsTexture); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); diff --git a/src/platformsupport/platformcompositor/qopenglcompositorbackingstore_p.h b/src/platformsupport/platformcompositor/qopenglcompositorbackingstore_p.h index 49d8bfd6e7..bd843e8bd9 100644 --- a/src/platformsupport/platformcompositor/qopenglcompositorbackingstore_p.h +++ b/src/platformsupport/platformcompositor/qopenglcompositorbackingstore_p.h @@ -83,6 +83,7 @@ private: QImage m_image; QRegion m_dirty; uint m_bsTexture; + QOpenGLContext *m_bsTextureContext; QPlatformTextureList *m_textures; QPlatformTextureList *m_lockedWidgetTextures; }; diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 2d7c03116b..7c3c4fe8da 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -72,6 +72,7 @@ #include #include #include +#include #include #include @@ -1817,24 +1818,47 @@ void QWidgetPrivate::deleteSysExtra() { } +static void deleteBackingStore(QWidgetPrivate *d) +{ + QTLWExtra *topData = d->topData(); + + // The context must be current when destroying the backing store as it may attempt to + // release resources like textures and shader programs. The window may not be suitable + // anymore as there will often not be a platform window underneath at this stage. Fall + // back to a QOffscreenSurface in this case. + QScopedPointer tempSurface; +#ifndef QT_NO_OPENGL + if (d->textureChildSeen && topData->shareContext) { + if (topData->window->handle()) { + topData->shareContext->makeCurrent(topData->window); + } else { + tempSurface.reset(new QOffscreenSurface); + tempSurface->setFormat(topData->shareContext->format()); + tempSurface->create(); + topData->shareContext->makeCurrent(tempSurface.data()); + } + } +#endif + + delete topData->backingStore; + topData->backingStore = 0; + +#ifndef QT_NO_OPENGL + if (d->textureChildSeen && topData->shareContext) + topData->shareContext->doneCurrent(); +#endif +} + void QWidgetPrivate::deleteTLSysExtra() { if (extra && extra->topextra) { //the qplatformbackingstore may hold a reference to the window, so the backingstore //needs to be deleted first. If the backingstore holds GL resources, we need to - // make the context current here, since the platform bs does not have a reference - // to the widget. + // make the context current here. This is taken care of by deleteBackingStore(). -#ifndef QT_NO_OPENGL - if (textureChildSeen && extra->topextra->shareContext) - extra->topextra->shareContext->makeCurrent(extra->topextra->window); -#endif extra->topextra->backingStoreTracker.destroy(); - delete extra->topextra->backingStore; - extra->topextra->backingStore = 0; + deleteBackingStore(this); #ifndef QT_NO_OPENGL - if (textureChildSeen && extra->topextra->shareContext) - extra->topextra->shareContext->doneCurrent(); delete extra->topextra->shareContext; extra->topextra->shareContext = 0; #endif @@ -11980,7 +12004,7 @@ void QWidget::setBackingStore(QBackingStore *store) return; QBackingStore *oldStore = topData->backingStore; - delete topData->backingStore; + deleteBackingStore(d); topData->backingStore = store; QWidgetBackingStore *bs = d->maybeBackingStore(); -- cgit v1.2.3 From 7cfc24f72a80656580218dccab9b24b89a273022 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Tue, 29 Sep 2015 12:38:53 +0200 Subject: Secure Transport backend - make it work on OS X 10.7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On OS X SSLCreateContext is quite recent - it requires OS X/SDK version >= 10.8. Since SecureTransport back-end is the default one in Qt 5.6, make it also work on OS X 10.7. Change-Id: I364feff9dd95772fcea926494b2d4edaffd2dde1 Reviewed-by: Morten Johan Sørvig --- src/network/ssl/qsslsocket_mac.cpp | 94 ++++++++++++++++++++++++++++++++++---- src/network/ssl/qsslsocket_mac_p.h | 22 +++++++-- 2 files changed, 103 insertions(+), 13 deletions(-) diff --git a/src/network/ssl/qsslsocket_mac.cpp b/src/network/ssl/qsslsocket_mac.cpp index b83e56c29e..6d7a26e1c0 100644 --- a/src/network/ssl/qsslsocket_mac.cpp +++ b/src/network/ssl/qsslsocket_mac.cpp @@ -51,8 +51,91 @@ #include #include +#include + +#ifdef Q_OS_OSX +#include +#endif + QT_BEGIN_NAMESPACE +static SSLContextRef qt_createSecureTransportContext(QSslSocket::SslMode mode) +{ + const bool isServer = mode == QSslSocket::SslServerMode; + SSLContextRef context = Q_NULLPTR; + +#ifndef Q_OS_OSX + const SSLProtocolSide side = isServer ? kSSLServerSide : kSSLClientSide; + // We never use kSSLDatagramType, so it's kSSLStreamType unconditionally. + context = SSLCreateContext(Q_NULLPTR, side, kSSLStreamType); + if (!context) + qCWarning(lcSsl) << "SSLCreateContext failed"; +#else // Q_OS_OSX + +#if QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_8, __IPHONE_NA) + if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_8) { + const SSLProtocolSide side = isServer ? kSSLServerSide : kSSLClientSide; + // We never use kSSLDatagramType, so it's kSSLStreamType unconditionally. + context = SSLCreateContext(Q_NULLPTR, side, kSSLStreamType); + if (!context) + qCWarning(lcSsl) << "SSLCreateContext failed"; + } else { +#else + { +#endif + const OSStatus errCode = SSLNewContext(isServer, &context); + if (errCode != noErr || !context) + qCWarning(lcSsl) << "SSLNewContext failed with error:" << errCode; + } +#endif // !Q_OS_OSX + + return context; +} + +static void qt_releaseSecureTransportContext(SSLContextRef context) +{ + if (!context) + return; + +#ifndef Q_OS_OSX + CFRelease(context); +#else + +#if QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_8, __IPHONE_NA) + if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_8) { + CFRelease(context); + } else { +#else + { +#endif + const OSStatus errCode = SSLDisposeContext(context); + if (errCode != noErr) + qCWarning(lcSsl) << "SSLDisposeContext failed with error:" << errCode; + } +#endif // !Q_OS_OSX +} + +QSecureTransportContext::QSecureTransportContext(SSLContextRef c) + : context(c) +{ +} + +QSecureTransportContext::~QSecureTransportContext() +{ + qt_releaseSecureTransportContext(context); +} + +QSecureTransportContext::operator SSLContextRef()const +{ + return context; +} + +void QSecureTransportContext::reset(SSLContextRef newContext) +{ + qt_releaseSecureTransportContext(context); + context = newContext; +} + Q_GLOBAL_STATIC_WITH_ARGS(QMutex, qt_securetransport_mutex, (QMutex::Recursive)) //#define QSSLSOCKET_DEBUG @@ -140,7 +223,7 @@ void QSslSocketPrivate::ensureInitialized() // from QSslCertificatePrivate's ctor. s_loadedCiphersAndCerts = true; - QCFType context(SSLCreateContext(Q_NULLPTR, kSSLClientSide, kSSLStreamType)); + const QSecureTransportContext context(qt_createSecureTransportContext(QSslSocket::SslClientMode)); if (context) { QList ciphers; QList defaultCiphers; @@ -167,7 +250,6 @@ void QSslSocketPrivate::ensureInitialized() if (!s_loadRootCertsOnDemand) setDefaultCaCertificates(systemCaCertificates()); } else { - qCWarning(lcSsl) << "SSLCreateContext failed"; s_loadedCiphersAndCerts = false; } @@ -652,11 +734,7 @@ bool QSslSocketBackendPrivate::initSslContext() Q_ASSERT_X(!context, Q_FUNC_INFO, "invalid socket state, context is not null"); Q_ASSERT(plainSocket); - SSLProtocolSide side = kSSLClientSide; - if (mode == QSslSocket::SslServerMode) - side = kSSLServerSide; - - context = SSLCreateContext(Q_NULLPTR, side, kSSLStreamType); + context.reset(qt_createSecureTransportContext(mode)); if (!context) { setError("SSLCreateContext failed", QAbstractSocket::SslInternalError); return false; @@ -752,7 +830,7 @@ bool QSslSocketBackendPrivate::initSslContext() void QSslSocketBackendPrivate::destroySslContext() { - context = Q_NULLPTR; + context.reset(Q_NULLPTR); } static QByteArray _q_makePkcs12(const QList &certs, const QSslKey &key, const QString &passPhrase); diff --git a/src/network/ssl/qsslsocket_mac_p.h b/src/network/ssl/qsslsocket_mac_p.h index 868b816957..0479e30d97 100644 --- a/src/network/ssl/qsslsocket_mac_p.h +++ b/src/network/ssl/qsslsocket_mac_p.h @@ -45,8 +45,6 @@ // We mean it. // -#include - #include #include #include @@ -59,6 +57,20 @@ QT_BEGIN_NAMESPACE +class QSecureTransportContext +{ +public: + explicit QSecureTransportContext(SSLContextRef context); + ~QSecureTransportContext(); + + operator SSLContextRef () const; + void reset(SSLContextRef newContext); +private: + SSLContextRef context; + + Q_DISABLE_COPY(QSecureTransportContext); +}; + class QSslSocketBackendPrivate : public QSslSocketPrivate { Q_DECLARE_PUBLIC(QSslSocket) @@ -76,8 +88,8 @@ public: void startServerEncryption() Q_DECL_OVERRIDE; void transmit() Q_DECL_OVERRIDE; - static QList (verify)(QList certificateChain, - const QString &hostName); + static QList verify(QList certificateChain, + const QString &hostName); static bool importPkcs12(QIODevice *device, QSslKey *key, QSslCertificate *cert, @@ -108,7 +120,7 @@ private: void setError(const QString &errorString, QAbstractSocket::SocketError errorCode); - mutable QCFType context; + QSecureTransportContext context; Q_DISABLE_COPY(QSslSocketBackendPrivate); }; -- cgit v1.2.3 From 2010eff9d71d90953694c322ceebd340b7adef5f Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Tue, 29 Sep 2015 14:40:48 +0200 Subject: Secure Transport - make it work on OS X 10.7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SSLSetProtocolVersionMin/Max were introduced _only_ in 10.8 and we need a workaround for 10.7 - use SSLSetProtocolVersion or SSLSetProtocolVersionEnabled. Change-Id: I4b7ed9fda21e2c374a98fd777253280e8013ffde Reviewed-by: Morten Johan Sørvig --- src/network/ssl/qsslsocket_mac.cpp | 291 +++++++++++++++++++++++++++---------- 1 file changed, 212 insertions(+), 79 deletions(-) diff --git a/src/network/ssl/qsslsocket_mac.cpp b/src/network/ssl/qsslsocket_mac.cpp index 6d7a26e1c0..aabae81eed 100644 --- a/src/network/ssl/qsslsocket_mac.cpp +++ b/src/network/ssl/qsslsocket_mac.cpp @@ -107,7 +107,7 @@ static void qt_releaseSecureTransportContext(SSLContextRef context) } else { #else { -#endif +#endif // QT_MAC_PLATFORM_... const OSStatus errCode = SSLDisposeContext(context); if (errCode != noErr) qCWarning(lcSsl) << "SSLDisposeContext failed with error:" << errCode; @@ -115,6 +115,206 @@ static void qt_releaseSecureTransportContext(SSLContextRef context) #endif // !Q_OS_OSX } +static bool qt_setSessionProtocol(SSLContextRef context, const QSslConfigurationPrivate &configuration, + QTcpSocket *plainSocket) +{ + Q_ASSERT(context); + +#ifndef QSSLSOCKET_DEBUG + Q_UNUSED(plainSocket) +#endif + + OSStatus err = noErr; + +#if QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_8, __IPHONE_5_0) + if (configuration.protocol == QSsl::SslV3) { + #ifdef QSSLSOCKET_DEBUG + qCDebug(lcSsl) << plainSocket << "requesting : SSLv3"; + #endif + err = SSLSetProtocolVersionMin(context, kSSLProtocol3); + if (err == noErr) + err = SSLSetProtocolVersionMax(context, kSSLProtocol3); + } else if (configuration.protocol == QSsl::TlsV1_0) { + #ifdef QSSLSOCKET_DEBUG + qCDebug(lcSsl) << plainSocket << "requesting : TLSv1.0"; + #endif + err = SSLSetProtocolVersionMin(context, kTLSProtocol1); + if (err == noErr) + err = SSLSetProtocolVersionMax(context, kTLSProtocol1); + } else if (configuration.protocol == QSsl::TlsV1_1) { + #ifdef QSSLSOCKET_DEBUG + qCDebug(lcSsl) << plainSocket << "requesting : TLSv1.1"; + #endif + err = SSLSetProtocolVersionMin(context, kTLSProtocol11); + if (err == noErr) + err = SSLSetProtocolVersionMax(context, kTLSProtocol11); + } else if (configuration.protocol == QSsl::TlsV1_2) { + #ifdef QSSLSOCKET_DEBUG + qCDebug(lcSsl) << plainSocket << "requesting : TLSv1.2"; + #endif + err = SSLSetProtocolVersionMin(context, kTLSProtocol12); + if (err == noErr) + err = SSLSetProtocolVersionMax(context, kTLSProtocol12); + } else if (configuration.protocol == QSsl::AnyProtocol) { + #ifdef QSSLSOCKET_DEBUG + qCDebug(lcSsl) << plainSocket << "requesting : any"; + #endif + // kSSLProtocol3, since kSSLProtocol2 is disabled: + err = SSLSetProtocolVersionMin(context, kSSLProtocol3); + if (err == noErr) + err = SSLSetProtocolVersionMax(context, kTLSProtocol12); + } else if (configuration.protocol == QSsl::TlsV1SslV3) { + #ifdef QSSLSOCKET_DEBUG + qCDebug(lcSsl) << plainSocket << "requesting : SSLv3 - TLSv1.2"; + #endif + err = SSLSetProtocolVersionMin(context, kSSLProtocol3); + if (err == noErr) + err = SSLSetProtocolVersionMax(context, kTLSProtocol12); + } else if (configuration.protocol == QSsl::SecureProtocols) { + #ifdef QSSLSOCKET_DEBUG + qCDebug(lcSsl) << plainSocket << "requesting : TLSv1 - TLSv1.2"; + #endif + err = SSLSetProtocolVersionMin(context, kTLSProtocol1); + if (err == noErr) + err = SSLSetProtocolVersionMax(context, kTLSProtocol12); + } else if (configuration.protocol == QSsl::TlsV1_0OrLater) { + #ifdef QSSLSOCKET_DEBUG + qCDebug(lcSsl) << plainSocket << "requesting : TLSv1 - TLSv1.2"; + #endif + err = SSLSetProtocolVersionMin(context, kTLSProtocol1); + if (err == noErr) + err = SSLSetProtocolVersionMax(context, kTLSProtocol12); + } else if (configuration.protocol == QSsl::TlsV1_1OrLater) { + #ifdef QSSLSOCKET_DEBUG + qCDebug(lcSsl) << plainSocket << "requesting : TLSv1.1 - TLSv1.2"; + #endif + err = SSLSetProtocolVersionMin(context, kTLSProtocol11); + if (err == noErr) + err = SSLSetProtocolVersionMax(context, kTLSProtocol12); + } else if (configuration.protocol == QSsl::TlsV1_2OrLater) { + #ifdef QSSLSOCKET_DEBUG + qCDebug(lcSsl) << plainSocket << "requesting : TLSv1.2"; + #endif + err = SSLSetProtocolVersionMin(context, kTLSProtocol12); + if (err == noErr) + err = SSLSetProtocolVersionMax(context, kTLSProtocol12); + } else { + #ifdef QSSLSOCKET_DEBUG + qCDebug(lcSsl) << plainSocket << "no protocol version found in the configuration"; + #endif + return false; + } +#endif + + return err == noErr; +} + +#ifdef Q_OS_OSX + +static bool qt_setSessionProtocolOSX(SSLContextRef context, const QSslConfigurationPrivate &configuration, + QTcpSocket *plainSocket) +{ + // This function works with (now) deprecated API that does not even exist on + // iOS but is the only API we have on OS X below 10.8 + + // Without SSLSetProtocolVersionMin/Max functions it's quite difficult + // to have the required result: + // If we use SSLSetProtocolVersion - any constant except the ones with 'Only' suffix - + // allows a negotiation and we can not set the lower limit. + // SSLSetProtocolVersionEnabled supports only a limited subset of constants, if you believe their docs: + // kSSLProtocol2 + // kSSLProtocol3 + // kTLSProtocol1 + // kSSLProtocolAll + // Here we can only have a look into the SecureTransport's code and hope that what we see there + // and what we have on 10.7 is similar: + // SSLSetProtocoLVersionEnabled actually accepts other constants also, + // called twice with two different protocols it sets a range, + // called once with a protocol (when all protocols were disabled) + // - only this protocol is enabled (without a lower limit negotiation). + + Q_ASSERT(context); + +#ifndef QSSLSOCKET_DEBUG + Q_UNUSED(plainSocket) +#endif + + OSStatus err = noErr; + + // First, disable ALL: + if (SSLSetProtocolVersionEnabled(context, kSSLProtocolAll, false) != noErr) + return false; + + if (configuration.protocol == QSsl::SslV3) { + #ifdef QSSLSOCKET_DEBUG + qCDebug(lcSsl) << plainSocket << "requesting : SSLv3"; + #endif + err = SSLSetProtocolVersion(context, kSSLProtocol3Only); + } else if (configuration.protocol == QSsl::TlsV1_0) { + #ifdef QSSLSOCKET_DEBUG + qCDebug(lcSsl) << plainSocket << "requesting : TLSv1.0"; + #endif + err = SSLSetProtocolVersion(context, kTLSProtocol1Only); + } else if (configuration.protocol == QSsl::TlsV1_1) { + #ifdef QSSLSOCKET_DEBUG + qCDebug(lcSsl) << plainSocket << "requesting : TLSv1.1"; + #endif + err = SSLSetProtocolVersionEnabled(context, kTLSProtocol11, true); + } else if (configuration.protocol == QSsl::TlsV1_2) { + #ifdef QSSLSOCKET_DEBUG + qCDebug(lcSsl) << plainSocket << "requesting : TLSv1.2"; + #endif + err = SSLSetProtocolVersionEnabled(context, kTLSProtocol12, true); + } else if (configuration.protocol == QSsl::AnyProtocol) { + #ifdef QSSLSOCKET_DEBUG + qCDebug(lcSsl) << plainSocket << "requesting : any"; + #endif + err = SSLSetProtocolVersionEnabled(context, kSSLProtocolAll, true); + } else if (configuration.protocol == QSsl::TlsV1SslV3) { + #ifdef QSSLSOCKET_DEBUG + qCDebug(lcSsl) << plainSocket << "requesting : SSLv3 - TLSv1.2"; + #endif + err = SSLSetProtocolVersionEnabled(context, kTLSProtocol12, true); + if (err == noErr) + err = SSLSetProtocolVersionEnabled(context, kSSLProtocol3, true); + } else if (configuration.protocol == QSsl::SecureProtocols) { + #ifdef QSSLSOCKET_DEBUG + qCDebug(lcSsl) << plainSocket << "requesting : TLSv1 - TLSv1.2"; + #endif + err = SSLSetProtocolVersionEnabled(context, kTLSProtocol12, true); + if (err == noErr) + err = SSLSetProtocolVersionEnabled(context, kTLSProtocol1, true); + } else if (configuration.protocol == QSsl::TlsV1_0OrLater) { + #ifdef QSSLSOCKET_DEBUG + qCDebug(lcSsl) << plainSocket << "requesting : TLSv1 - TLSv1.2"; + #endif + err = SSLSetProtocolVersionEnabled(context, kTLSProtocol12, true); + if (err == noErr) + err = SSLSetProtocolVersionEnabled(context, kTLSProtocol1, true); + } else if (configuration.protocol == QSsl::TlsV1_1OrLater) { + #ifdef QSSLSOCKET_DEBUG + qCDebug(lcSsl) << plainSocket << "requesting : TLSv1.1 - TLSv1.2"; + #endif + err = SSLSetProtocolVersionEnabled(context, kTLSProtocol12, true); + if (err == noErr) + err = SSLSetProtocolVersionEnabled(context, kTLSProtocol11, true); + } else if (configuration.protocol == QSsl::TlsV1_2OrLater) { + #ifdef QSSLSOCKET_DEBUG + qCDebug(lcSsl) << plainSocket << "requesting : TLSv1.2"; + #endif + err = SSLSetProtocolVersionEnabled(context, kTLSProtocol12, true); + } else { + #ifdef QSSLSOCKET_DEBUG + qCDebug(lcSsl) << plainSocket << "no protocol version found in the configuration"; + #endif + return false; + } + + return err == noErr; +} + +#endif // Q_OS_OSX + QSecureTransportContext::QSecureTransportContext(SSLContextRef c) : context(c) { @@ -927,8 +1127,6 @@ bool QSslSocketBackendPrivate::setSessionProtocol() { Q_ASSERT_X(context, Q_FUNC_INFO, "invalid SSL context (null)"); - OSStatus err = noErr; - // QSsl::SslV2 == kSSLProtocol2 is disabled in secure transport and // always fails with errSSLIllegalParam: // if (version < MINIMUM_STREAM_VERSION || version > MAXIMUM_STREAM_VERSION) @@ -939,85 +1137,20 @@ bool QSslSocketBackendPrivate::setSessionProtocol() return false; } - if (configuration.protocol == QSsl::SslV3) { -#ifdef QSSLSOCKET_DEBUG - qCDebug(lcSsl) << plainSocket << "requesting : SSLv3"; -#endif - err = SSLSetProtocolVersionMin(context, kSSLProtocol3); - if (err == noErr) - err = SSLSetProtocolVersionMax(context, kSSLProtocol3); - } else if (configuration.protocol == QSsl::TlsV1_0) { -#ifdef QSSLSOCKET_DEBUG - qCDebug(lcSsl) << plainSocket << "requesting : TLSv1.0"; -#endif - err = SSLSetProtocolVersionMin(context, kTLSProtocol1); - if (err == noErr) - err = SSLSetProtocolVersionMax(context, kTLSProtocol1); - } else if (configuration.protocol == QSsl::TlsV1_1) { -#ifdef QSSLSOCKET_DEBUG - qCDebug(lcSsl) << plainSocket << "requesting : TLSv1.1"; -#endif - err = SSLSetProtocolVersionMin(context, kTLSProtocol11); - if (err == noErr) - err = SSLSetProtocolVersionMax(context, kTLSProtocol11); - } else if (configuration.protocol == QSsl::TlsV1_2) { -#ifdef QSSLSOCKET_DEBUG - qCDebug(lcSsl) << plainSocket << "requesting : TLSv1.2"; -#endif - err = SSLSetProtocolVersionMin(context, kTLSProtocol12); - if (err == noErr) - err = SSLSetProtocolVersionMax(context, kTLSProtocol12); - } else if (configuration.protocol == QSsl::AnyProtocol) { -#ifdef QSSLSOCKET_DEBUG - qCDebug(lcSsl) << plainSocket << "requesting : any"; -#endif - // kSSLProtocol3, since kSSLProtocol2 is disabled: - err = SSLSetProtocolVersionMin(context, kSSLProtocol3); - if (err == noErr) - err = SSLSetProtocolVersionMax(context, kTLSProtocol12); - } else if (configuration.protocol == QSsl::TlsV1SslV3) { -#ifdef QSSLSOCKET_DEBUG - qCDebug(lcSsl) << plainSocket << "requesting : SSLv3 - TLSv1.2"; -#endif - err = SSLSetProtocolVersionMin(context, kSSLProtocol3); - if (err == noErr) - err = SSLSetProtocolVersionMax(context, kTLSProtocol12); - } else if (configuration.protocol == QSsl::SecureProtocols) { -#ifdef QSSLSOCKET_DEBUG - qCDebug(lcSsl) << plainSocket << "requesting : TLSv1 - TLSv1.2"; -#endif - err = SSLSetProtocolVersionMin(context, kTLSProtocol1); - if (err == noErr) - err = SSLSetProtocolVersionMax(context, kTLSProtocol12); - } else if (configuration.protocol == QSsl::TlsV1_0OrLater) { -#ifdef QSSLSOCKET_DEBUG - qCDebug(lcSsl) << plainSocket << "requesting : TLSv1 - TLSv1.2"; -#endif - err = SSLSetProtocolVersionMin(context, kTLSProtocol1); - if (err == noErr) - err = SSLSetProtocolVersionMax(context, kTLSProtocol12); - } else if (configuration.protocol == QSsl::TlsV1_1OrLater) { -#ifdef QSSLSOCKET_DEBUG - qCDebug(lcSsl) << plainSocket << "requesting : TLSv1.1 - TLSv1.2"; -#endif - err = SSLSetProtocolVersionMin(context, kTLSProtocol11); - if (err == noErr) - err = SSLSetProtocolVersionMax(context, kTLSProtocol12); - } else if (configuration.protocol == QSsl::TlsV1_2OrLater) { -#ifdef QSSLSOCKET_DEBUG - qCDebug(lcSsl) << plainSocket << "requesting : TLSv1.2"; -#endif - err = SSLSetProtocolVersionMin(context, kTLSProtocol12); - if (err == noErr) - err = SSLSetProtocolVersionMax(context, kTLSProtocol12); +#ifndef Q_OS_OSX + return qt_setSessionProtocol(context, configuration, plainSocket); +#else + +#if QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_8, __IPHONE_NA) + if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_8) { + return qt_setSessionProtocol(context, configuration, plainSocket); } else { -#ifdef QSSLSOCKET_DEBUG - qCDebug(lcSsl) << plainSocket << "no protocol version found in the configuration"; +#else + { #endif - return false; + return qt_setSessionProtocolOSX(context, configuration, plainSocket); } - - return err == noErr; +#endif } bool QSslSocketBackendPrivate::canIgnoreTrustVerificationFailure() const -- cgit v1.2.3 From b21c219811f2363002e3cc96c8cfef849aaa95a4 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 6 Nov 2015 11:03:15 +0100 Subject: Call setFocus() if it is a QAxHostWidget which is in a new active window The change 8c0f47cfae17a39137dec47aa0b9f3f9bedad introduced a problem where if the widget was being reparented had a valid HWND then it would cause the focus to change inside the already active window. Therefore we need to limit the times it does this to the case where we know it needs to be done which is the ActiveQt case. Change-Id: Ia85f5136661142b25952e0ebf66f8a43d9500d58 Reviewed-by: Friedemann Kleint Reviewed-by: Andy Shaw --- src/widgets/kernel/qapplication.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 647484ece1..078feb4b03 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -2248,8 +2248,10 @@ void QApplicationPrivate::notifyActiveWindowChange(QWindow *previous) QApplication::setActiveWindow(tlw); // QTBUG-37126, Active X controls may set the focus on native child widgets. if (wnd && tlw && wnd != tlw->windowHandle()) { - if (QWidgetWindow *widgetWindow = qobject_cast(wnd)) - widgetWindow->widget()->setFocus(Qt::ActiveWindowFocusReason); + if (QWidgetWindow *widgetWindow = qobject_cast(wnd)) { + if (widgetWindow->widget()->inherits("QAxHostWidget")) + widgetWindow->widget()->setFocus(Qt::ActiveWindowFocusReason); + } } } -- cgit v1.2.3 From a2f360360cbb8f567bc32d7fc1d668f238806483 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Thu, 12 Nov 2015 10:02:13 +0100 Subject: If the paper value is greater than DMPAPER_LAST then it is a custom size Ideally all printer drivers would add beyond DMPAPER_USER for their custom sizes. However some printer drivers add beyond DMPAPER_LAST instead so we need to check if the value is past DMPAPER_LAST and consider those as a custom size. Task-number: QTBUG-47272 Change-Id: I1bcb01c08fe605cc484769b0301cfcd7b8f66157 Reviewed-by: Friedemann Kleint --- src/printsupport/kernel/qprintengine_win.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/printsupport/kernel/qprintengine_win.cpp b/src/printsupport/kernel/qprintengine_win.cpp index a4209d833a..707847ba3f 100644 --- a/src/printsupport/kernel/qprintengine_win.cpp +++ b/src/printsupport/kernel/qprintengine_win.cpp @@ -1633,7 +1633,7 @@ void QWin32PrintEnginePrivate::updatePageLayout() // Update orientation first as is needed to obtain printable margins when changing page size m_pageLayout.setOrientation(devMode->dmOrientation == DMORIENT_LANDSCAPE ? QPageLayout::Landscape : QPageLayout::Portrait); - if (devMode->dmPaperSize >= DMPAPER_USER) { + if (devMode->dmPaperSize >= DMPAPER_LAST) { // Is a custom size QPageSize pageSize = QPageSize(QSizeF(devMode->dmPaperWidth / 10.0f, devMode->dmPaperLength / 10.0f), QPageSize::Millimeter); -- cgit v1.2.3 From 3811307bf125cc1140dda10af14c40418a1c967b Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 23 Nov 2015 14:00:02 +0100 Subject: ANGLE/D3D11: Suppress keyboard handling of DXGI. Set the DXGI_MWA_NO_ALT_ENTER to suppress the Alt-Enter shortcut causing the window to become full screen. Task-number: QTBUG-44904 Change-Id: Ia4156ddee37a8a3da6e9e3130022c63a674f4429 Reviewed-by: Andrew Knight --- .../renderer/d3d/d3d11/win32/NativeWindow.cpp | 8 ++++- ...-D3D11-Suppress-keyboard-handling-of-DXGI.patch | 36 ++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 src/angle/patches/0010-ANGLE-D3D11-Suppress-keyboard-handling-of-DXGI.patch diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow.cpp index 0a4f45b5b7..696dfd72f8 100644 --- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow.cpp +++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow.cpp @@ -64,7 +64,13 @@ HRESULT NativeWindow::createSwapChain(ID3D11Device* device, DXGIFactory* factory swapChainDesc.Windowed = TRUE; swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD; - return factory->CreateSwapChain(device, &swapChainDesc, swapChain); + const HRESULT result = factory->CreateSwapChain(device, &swapChainDesc, swapChain); + if (SUCCEEDED(result)) + { + const HRESULT makeWindowAssociationResult = factory->MakeWindowAssociation(mWindow, DXGI_MWA_NO_ALT_ENTER); + UNUSED_TRACE_VARIABLE(makeWindowAssociationResult); + } + return result; } #endif } diff --git a/src/angle/patches/0010-ANGLE-D3D11-Suppress-keyboard-handling-of-DXGI.patch b/src/angle/patches/0010-ANGLE-D3D11-Suppress-keyboard-handling-of-DXGI.patch new file mode 100644 index 0000000000..2927176815 --- /dev/null +++ b/src/angle/patches/0010-ANGLE-D3D11-Suppress-keyboard-handling-of-DXGI.patch @@ -0,0 +1,36 @@ +From 00f0a46199b622b05619f56e29f172fb61fe6e82 Mon Sep 17 00:00:00 2001 +From: Friedemann Kleint +Date: Mon, 23 Nov 2015 14:00:02 +0100 +Subject: [PATCH] ANGLE/D3D11: Suppress keyboard handling of DXGI. + +Set the DXGI_MWA_NO_ALT_ENTER to suppress the Alt-Enter shortcut +causing the window to become full screen. + +Task-number: QTBUG-44904 +Change-Id: Ia4156ddee37a8a3da6e9e3130022c63a674f4429 +--- + .../angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow.cpp | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow.cpp +index 0a4f45b..696dfd7 100644 +--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow.cpp ++++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow.cpp +@@ -64,7 +64,13 @@ HRESULT NativeWindow::createSwapChain(ID3D11Device* device, DXGIFactory* factory + swapChainDesc.Windowed = TRUE; + swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD; + +- return factory->CreateSwapChain(device, &swapChainDesc, swapChain); ++ const HRESULT result = factory->CreateSwapChain(device, &swapChainDesc, swapChain); ++ if (SUCCEEDED(result)) ++ { ++ const HRESULT makeWindowAssociationResult = factory->MakeWindowAssociation(mWindow, DXGI_MWA_NO_ALT_ENTER); ++ UNUSED_TRACE_VARIABLE(makeWindowAssociationResult); ++ } ++ return result; + } + #endif + } +-- +2.5.0.windows.1 + -- cgit v1.2.3 From 045abe631c3b971e212f2ca5c648b086753c47c5 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 23 Nov 2015 13:10:20 +0100 Subject: Remove arch/qatomic_mips.h from src/corelib/arch/arch.pri. Amend change 110a8c339fa078a4edd09a70239280e482b149f1, fixing: WARNING: Failure to find: arch/qatomic_mips.h Task-number: QTBUG-49168 Change-Id: I7009037d3f4c51c9ed9713b6e94ee43022fe2645 Reviewed-by: Dmitry Shachnev Reviewed-by: Thiago Macieira --- src/corelib/arch/arch.pri | 1 - 1 file changed, 1 deletion(-) diff --git a/src/corelib/arch/arch.pri b/src/corelib/arch/arch.pri index 5c3b0b78c2..16fe8b8e5c 100644 --- a/src/corelib/arch/arch.pri +++ b/src/corelib/arch/arch.pri @@ -6,7 +6,6 @@ HEADERS += \ arch/qatomic_armv7.h \ arch/qatomic_bootstrap.h \ arch/qatomic_ia64.h \ - arch/qatomic_mips.h \ arch/qatomic_x86.h \ arch/qatomic_gcc.h \ arch/qatomic_cxx11.h -- cgit v1.2.3 From e4d1bf9829c56dc446a07689758f22c58863d70d Mon Sep 17 00:00:00 2001 From: Joni Poikelin Date: Tue, 24 Nov 2015 09:51:12 +0200 Subject: Fix crash in QFileDialog::iconProvider() with native dialogs Task-number: QTBUG-49600 Change-Id: Ied28c0e7efa6b4dce25705dab98377848db5a6d3 Reviewed-by: Richard Moe Gustavsen Reviewed-by: Friedemann Kleint --- src/widgets/dialogs/qfiledialog.cpp | 2 ++ tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index 2d4ba1aeb9..4e0d70fb9a 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -1938,6 +1938,8 @@ void QFileDialog::setIconProvider(QFileIconProvider *provider) QFileIconProvider *QFileDialog::iconProvider() const { Q_D(const QFileDialog); + if (!d->model) + return Q_NULLPTR; return d->model->iconProvider(); } diff --git a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp index ffc000a418..59288bd764 100644 --- a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp +++ b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp @@ -165,6 +165,7 @@ private slots: #endif // QT_BUILD_INTERNAL #endif void rejectModalDialogs(); + void QTBUG49600_nativeIconProviderCrash(); private: void cleanupSettingsFile(); @@ -1487,5 +1488,13 @@ void tst_QFiledialog::rejectModalDialogs() QVERIFY(file.isEmpty()); } +void tst_QFiledialog::QTBUG49600_nativeIconProviderCrash() +{ + if (!QGuiApplicationPrivate::platformTheme()->usePlatformNativeDialog(QPlatformTheme::FileDialog)) + QSKIP("This platform always uses widgets to realize its QFileDialog, instead of the native file dialog."); + QFileDialog fd; + fd.iconProvider(); +} + QTEST_MAIN(tst_QFiledialog) #include "tst_qfiledialog.moc" -- cgit v1.2.3 From c83eefff976a5f2cd673f6b4a95922b13855dd29 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 24 Nov 2015 21:08:56 +0100 Subject: Remove incorrect assertion from the backingstore The ifdef gave an impression of the code path being hit only when texture-backed widgets are present and OpenGL-based compositing is active. This is false. Asserting on having a context current is wrong (as shown by autotests on the 5.6 branch). Change-Id: I2539f0aac75b26597f49f63edcd9580428be79b7 Reviewed-by: Gunnar Sletta --- src/gui/painting/qplatformbackingstore.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/gui/painting/qplatformbackingstore.cpp b/src/gui/painting/qplatformbackingstore.cpp index 70ab9825e9..22f5662c34 100644 --- a/src/gui/painting/qplatformbackingstore.cpp +++ b/src/gui/painting/qplatformbackingstore.cpp @@ -66,11 +66,14 @@ public: { #ifndef QT_NO_OPENGL QOpenGLContext *ctx = QOpenGLContext::currentContext(); - Q_ASSERT(ctx); - if (textureId) - ctx->functions()->glDeleteTextures(1, &textureId); - if (blitter) - blitter->destroy(); + if (ctx) { + if (textureId) + ctx->functions()->glDeleteTextures(1, &textureId); + if (blitter) + blitter->destroy(); + } else if (textureId || blitter) { + qWarning("No context current during QPlatformBackingStore destruction, OpenGL resources not released"); + } delete blitter; #endif } -- cgit v1.2.3 From 28beaf63cdb90e0424bcf1bf851179f822397894 Mon Sep 17 00:00:00 2001 From: Joni Poikelin Date: Tue, 17 Nov 2015 08:24:57 +0200 Subject: Do not try to connect to null object if bearer plugin is missing Warning about connecting to null object was printed when bearer plugin is missing when bearer management feature is enabled. Change-Id: Iac33081c5f301862c066eb69ec05ff6d95775c09 Reviewed-by: Markus Goetz (Woboq GmbH) --- src/network/access/qnetworkreplyimpl.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp index c73e6162d1..7961a1dbae 100644 --- a/src/network/access/qnetworkreplyimpl.cpp +++ b/src/network/access/qnetworkreplyimpl.cpp @@ -127,8 +127,10 @@ void QNetworkReplyImplPrivate::_q_startOperation() return; } else { #ifndef QT_NO_BEARERMANAGEMENT - QObject::connect(session.data(), SIGNAL(stateChanged(QNetworkSession::State)), - q, SLOT(_q_networkSessionStateChanged(QNetworkSession::State)), Qt::QueuedConnection); + if (session) { + QObject::connect(session.data(), SIGNAL(stateChanged(QNetworkSession::State)), + q, SLOT(_q_networkSessionStateChanged(QNetworkSession::State)), Qt::QueuedConnection); + } #endif } -- cgit v1.2.3 From 45f7512bf502cc3fe22c4e7f86bec4a530f7a2f6 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 27 Nov 2015 10:33:19 +0100 Subject: tst_QThreadPool::tryStartCount(): Wait until tasks have finished. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace hardcoded interval by QTRY_COMPARE() ensuring that all tasks have finished, since otherwise QThreadPool::tryStart() fails in the next run. Remove blacklisting for MSVC2012 since it is not compiler-specific. Task-number: QTBUG-49654 Change-Id: If49b6eb9ef4da4ba2911839166c397d84c175e00 Reviewed-by: Simon Hausmann Reviewed-by: Jędrzej Nowacki --- tests/auto/corelib/thread/qthreadpool/BLACKLIST | 3 --- tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/auto/corelib/thread/qthreadpool/BLACKLIST b/tests/auto/corelib/thread/qthreadpool/BLACKLIST index 684f650a72..1c392ce96c 100644 --- a/tests/auto/corelib/thread/qthreadpool/BLACKLIST +++ b/tests/auto/corelib/thread/qthreadpool/BLACKLIST @@ -1,5 +1,2 @@ [expiryTimeoutRace] osx -[tryStartCount] -windows msvc-2012 -linux diff --git a/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp b/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp index c9fdb4b718..c465a07487 100644 --- a/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp +++ b/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp @@ -821,7 +821,7 @@ void tst_QThreadPool::tryStartCount() ++count; QCOMPARE(count, QThread::idealThreadCount()); - QTest::qWait(100); + QTRY_COMPARE(threadPool.activeThreadCount(), 0); } } -- cgit v1.2.3 From c06a39f6d2b23dad0535cf364c61f2572a7023d8 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 27 Nov 2015 14:37:19 +0100 Subject: winrt: Make error messages of QNativeSocketEngine more verbose. Output function, object name and class of the socket. Example: qt.winrtrunner.app: handleReadyRead(): Could not read into socket stream buffer ("QTcpServer:40000"/QTcpServer). (A method was called at an unexpected time.) Change-Id: Ic074c2c3a01221bd77dae0715db912e830f21435 Reviewed-by: Oliver Wolff --- src/network/socket/qnativesocketengine_winrt.cpp | 35 +++++++++++++++++++----- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/src/network/socket/qnativesocketengine_winrt.cpp b/src/network/socket/qnativesocketengine_winrt.cpp index e9fa227733..173221dec0 100644 --- a/src/network/socket/qnativesocketengine_winrt.cpp +++ b/src/network/socket/qnativesocketengine_winrt.cpp @@ -78,6 +78,21 @@ typedef IAsyncOperationWithProgress IAsyncBufferOperation; QT_BEGIN_NAMESPACE +static QByteArray socketDescription(const QAbstractSocketEngine *s) +{ + QByteArray result; + if (const QObject *o = s->parent()) { + const QString name = o->objectName(); + if (!name.isEmpty()) { + result += '"'; + result += name.toLocal8Bit(); + result += "\"/"; + } + result += o->metaObject()->className(); + } + return result; +} + // Common constructs #define Q_CHECK_VALID_SOCKETLAYER(function, returnValue) do { \ if (!isValid()) { \ @@ -275,8 +290,9 @@ bool QNativeSocketEngine::connectToHostByName(const QString &name, quint16 port) else if (d->socketType == QAbstractSocket::UdpSocket) hr = d->udpSocket()->ConnectAsync(remoteHost.Get(), portReference.Get(), &d->connectOp); if (hr == E_ACCESSDENIED) { - qErrnoWarning(hr, "QNativeSocketEngine::connectToHostByName: Unable to connect to host. \ - Please check your manifest capabilities."); + qErrnoWarning(hr, "QNativeSocketEngine::connectToHostByName: Unable to connect to host (%s:%hu/%s). " + "Please check your manifest capabilities.", + qPrintable(name), port, socketDescription(this).constData()); return false; } Q_ASSERT_SUCCEEDED(hr); @@ -328,7 +344,8 @@ bool QNativeSocketEngine::bind(const QHostAddress &address, quint16 port) hr = d->udpSocket()->BindEndpointAsync(hostAddress.Get(), portString.Get(), &op); } if (hr == E_ACCESSDENIED) { - qErrnoWarning(hr, "Unable to bind socket. Please check your manifest capabilities."); + qErrnoWarning(hr, "Unable to bind socket (%s:%hu/%s). Please check your manifest capabilities.", + qPrintable(address.toString()), port, socketDescription(this).constData()); return false; } Q_ASSERT_SUCCEEDED(hr); @@ -381,12 +398,14 @@ int QNativeSocketEngine::accept() ComPtr op; hr = stream->ReadAsync(buffer.Get(), READ_BUFFER_SIZE, InputStreamOptions_Partial, &op); if (FAILED(hr)) { - qErrnoWarning(hr, "Faild to read from the socket buffer."); + qErrnoWarning(hr, "accept(): Failed to read from the socket buffer (%s).", + socketDescription(this).constData()); return -1; } hr = op->put_Completed(Callback(d, &QNativeSocketEnginePrivate::handleReadyRead).Get()); if (FAILED(hr)) { - qErrnoWarning(hr, "Failed to set socket read callback."); + qErrnoWarning(hr, "accept(): Failed to set socket read callback (%s).", + socketDescription(this).constData()); return -1; } d->currentConnections.append(socket); @@ -1272,12 +1291,14 @@ HRESULT QNativeSocketEnginePrivate::handleReadyRead(IAsyncBufferOperation *async ComPtr op; hr = stream->ReadAsync(buffer.Get(), bufferLength, InputStreamOptions_Partial, &op); if (FAILED(hr)) { - qErrnoWarning(hr, "Could not read into socket stream buffer."); + qErrnoWarning(hr, "handleReadyRead(): Could not read into socket stream buffer (%s).", + socketDescription(q).constData()); return S_OK; } hr = op->put_Completed(Callback(this, &QNativeSocketEnginePrivate::handleReadyRead).Get()); if (FAILED(hr)) { - qErrnoWarning(hr, "Failed to set socket read callback."); + qErrnoWarning(hr, "handleReadyRead(): Failed to set socket read callback (%s).", + socketDescription(q).constData()); return S_OK; } return S_OK; -- cgit v1.2.3 From 1dd1e48e7328db9d17de3e5f1bd6ca257f4ccee2 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 26 Nov 2015 17:15:38 +0100 Subject: Simplify tests whether to run header checks Turn lists into hashes and check for existence of an element using key lookup. This leads to simpler testing code and is potentially faster. Change-Id: Ibbf4f03ec64d6c295cc5e1664dfa73cd0ce8c272 Reviewed-by: Oswald Buddenhagen --- bin/syncqt.pl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/syncqt.pl b/bin/syncqt.pl index 83e8350f81..25c129f268 100755 --- a/bin/syncqt.pl +++ b/bin/syncqt.pl @@ -81,6 +81,8 @@ our @qpa_headers = (); # will be derived from sync.profile our %reverse_classnames = (); +my %ignore_for_include_check = (); +my %ignore_for_qt_begin_namespace_check = (); # global variables (modified by options) my $isunix = 0; @@ -801,6 +803,8 @@ loadSyncProfile(\$basedir, \$out_basedir); @modules_to_sync = keys(%modules) if($#modules_to_sync == -1); my %allmoduleheadersprivate = map { $_ => 1 } @allmoduleheadersprivate; +%ignore_for_include_check = map { $_ => 1 } @ignore_for_include_check; +%ignore_for_qt_begin_namespace_check = map { $_ => 1 } @ignore_for_qt_begin_namespace_check; $isunix = checkUnix; #cache checkUnix @@ -1157,12 +1161,8 @@ if($check_includes) { $public_header = 0 if($header eq $_); } if($public_header) { - foreach (@ignore_for_include_check) { - $public_header = 0 if($header eq $_); - } - foreach(@ignore_for_qt_begin_namespace_check) { - $header_skip_qt_begin_namespace_test = 1 if ($header eq $_); - } + $public_header = 0 if ($ignore_for_include_check{$header}); + $header_skip_qt_begin_namespace_test = 1 if ($ignore_for_qt_begin_namespace_check{$header}); } } -- cgit v1.2.3 From 779d2aa5fcd82c4236c1d86a510adcb88e077775 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 26 Nov 2015 17:33:04 +0100 Subject: Factor header check out into a separate function Another step towards the removal of the duplicated loop over header files. Change-Id: I542782627d8742a515a42034264e4569a2355823 Reviewed-by: Oswald Buddenhagen --- bin/syncqt.pl | 135 ++++++++++++++++++++++++++++++---------------------------- 1 file changed, 70 insertions(+), 65 deletions(-) diff --git a/bin/syncqt.pl b/bin/syncqt.pl index 25c129f268..6b8d847a78 100755 --- a/bin/syncqt.pl +++ b/bin/syncqt.pl @@ -321,6 +321,75 @@ sub classNames { return @ret; } +sub check_header { + my ($lib, $header, $iheader, $public_header, $private_header) = @_; + my $header_skip_qt_begin_namespace_test = 0; + + if ($public_header) { + return if ($ignore_for_include_check{$header}); + $header_skip_qt_begin_namespace_test = 1 if ($ignore_for_qt_begin_namespace_check{$header}); + } + + open(F, "<$iheader") or return; + my $qt_begin_namespace_found = 0; + my $qt_end_namespace_found = 0; + my $qt_namespace_suffix = ""; + my $line; + my $stop_processing = 0; + my $we_mean_it = 0; + while ($line = ) { + chomp $line; + my $output_line = 1; + if ($line =~ /^ *\# *pragma (qt_no_included_check|qt_sync_stop_processing)/) { + $stop_processing = 1; + last; + } + if ($line =~ /^ *\# *include/) { + my $include = $line; + if ($line =~ /<.*>/) { + $include =~ s,.*<(.*)>.*,$1,; + } elsif ($line =~ /".*"/) { + $include =~ s,.*"(.*)".*,$1,; + } else { + $include = 0; + } + if ($include && $public_header) { + print STDERR "$lib: ERROR: $iheader includes private header $include\n" if ($include =~ /_p.h$/); + for my $trylib (keys(%modules)) { + if (-e "$out_basedir/include/$trylib/$include") { + print "$lib: WARNING: $iheader includes $include when it should include $trylib/$include\n"; + } + } + } + } elsif (!$private_header) { + if ($header_skip_qt_begin_namespace_test == 0 and $line =~ /^QT_BEGIN_NAMESPACE(_[A-Z_]+)?\s*$/) { + $qt_namespace_suffix = defined($1) ? $1 : ""; + $qt_begin_namespace_found = 1; + } elsif ($header_skip_qt_begin_namespace_test == 0 and $line =~ /^QT_END_NAMESPACE$qt_namespace_suffix\s*$/) { + $qt_end_namespace_found = 1; + } + } elsif ($line =~ "^// We mean it.") { + ++$we_mean_it; + } + } + + if ($public_header) { + if ($header_skip_qt_begin_namespace_test == 0 and $stop_processing == 0) { + if ($qt_begin_namespace_found == 0) { + print "$lib: WARNING: $iheader does not include QT_BEGIN_NAMESPACE\n"; + } + + if ($qt_begin_namespace_found && $qt_end_namespace_found == 0) { + print "$lib: WARNING: $iheader has QT_BEGIN_NAMESPACE$qt_namespace_suffix but no QT_END_NAMESPACE$qt_namespace_suffix\n"; + } + } + } elsif ($private_header) { + print "$lib: WARNING: $iheader does not have the \"We mean it.\" warning\n" if (!$we_mean_it); + } + + close(F); +} + sub make_path { my ($dir, $lib, $be_verbose) = @_; unless(-e $dir) { @@ -1141,7 +1210,6 @@ if($check_includes) { foreach my $subdir (@subdirs) { my @headers = findFiles($subdir, "^[-a-z0-9_]*\\.h\$" , 0); foreach my $header (@headers) { - my $header_skip_qt_begin_namespace_test = 0; $header = 0 if($header =~ /^ui_.*.h/); $header = 0 if ($header eq lc($lib)."version.h"); foreach (@ignore_headers) { @@ -1160,73 +1228,10 @@ if($check_includes) { foreach (@ignore_for_master_contents) { $public_header = 0 if($header eq $_); } - if($public_header) { - $public_header = 0 if ($ignore_for_include_check{$header}); - $header_skip_qt_begin_namespace_test = 1 if ($ignore_for_qt_begin_namespace_check{$header}); - } } my $iheader = $subdir . "/" . $header; - if (open(F, "<$iheader")) { - my $qt_begin_namespace_found = 0; - my $qt_end_namespace_found = 0; - my $qt_namespace_suffix = ""; - my $line; - my $stop_processing = 0; - my $we_mean_it = 0; - while ($line = ) { - chomp $line; - my $output_line = 1; - if ($line =~ /^ *\# *pragma (qt_no_included_check|qt_sync_stop_processing)/) { - $stop_processing = 1; - last; - } elsif ($line =~ /^ *\# *include/) { - my $include = $line; - if ($line =~ /<.*>/) { - $include =~ s,.*<(.*)>.*,$1,; - } elsif ($line =~ /".*"/) { - $include =~ s,.*"(.*)".*,$1,; - } else { - $include = 0; - } - if ($include) { - if ($public_header) { - print STDERR "$lib: ERROR: $iheader includes private header $include\n" if ($include =~ /_p.h$/); - for my $trylib (keys(%modules)) { - if(-e "$out_basedir/include/$trylib/$include") { - print "$lib: WARNING: $iheader includes $include when it should include $trylib/$include\n"; - } - } - } - } - } elsif (!$private_header) { - if ($header_skip_qt_begin_namespace_test == 0 and $line =~ /^QT_BEGIN_NAMESPACE(_[A-Z_]+)?\s*$/) { - $qt_namespace_suffix = defined($1) ? $1 : ""; - $qt_begin_namespace_found = 1; - } elsif ($header_skip_qt_begin_namespace_test == 0 and $line =~ /^QT_END_NAMESPACE$qt_namespace_suffix\s*$/) { - $qt_end_namespace_found = 1; - } - } elsif ($line =~ "^// We mean it.") { - ++$we_mean_it; - } - } - - if ($public_header) { - if ($header_skip_qt_begin_namespace_test == 0 and $stop_processing == 0) { - if ($qt_begin_namespace_found == 0) { - print "$lib: WARNING: $iheader does not include QT_BEGIN_NAMESPACE\n"; - } - - if ($qt_begin_namespace_found && $qt_end_namespace_found == 0) { - print "$lib: WARNING: $iheader has QT_BEGIN_NAMESPACE$qt_namespace_suffix but no QT_END_NAMESPACE$qt_namespace_suffix\n"; - } - } - } elsif ($private_header) { - print "$lib: WARNING: $iheader does not have the \"We mean it.\" warning\n" if (!$we_mean_it); - } - - close(F); - } + check_header($lib, $header, $iheader, $public_header, $private_header); } } } -- cgit v1.2.3 From eddb938c39d03e163ef47c965ea07ab19250eeed Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 27 Nov 2015 12:19:33 +0100 Subject: Remove duplicated header iteration code Do not iterate separately over all header files. This removes duplicated header iteration code which already was out of sync. As a side-effect, we do run the header check only on header files that are considered part of the module, if moduleheaders is set in sync.profile. Change-Id: Iec4c8febe9128139d2f377a1da8ce08c24110a77 Reviewed-by: Oswald Buddenhagen --- bin/syncqt.pl | 40 +++------------------------------------- 1 file changed, 3 insertions(+), 37 deletions(-) diff --git a/bin/syncqt.pl b/bin/syncqt.pl index 6b8d847a78..faa39aa351 100755 --- a/bin/syncqt.pl +++ b/bin/syncqt.pl @@ -1004,6 +1004,9 @@ foreach my $lib (@modules_to_sync) { my $clean_header; my $iheader = $subdir . "/" . $header; $iheader =~ s/^\Q$basedir\E/$out_basedir/ if ($shadow); + if ($check_includes) { + check_header($lib, $header, $iheader, $public_header, !$public_header && !$qpa_header); + } my @classes = $public_header && (!$minimal && $is_qt) ? classNames($iheader, \$clean_header) : (); if($showonly) { print "$header [$lib]\n"; @@ -1201,41 +1204,4 @@ foreach my $lib (@modules_to_sync) { } } -if($check_includes) { - foreach my $lib (@modules_to_sync) { - next if ($modules{$lib} =~ /^!/); - #calc subdirs - my @subdirs = listSubdirs(map { s/^\^//; $_ } split(/;/, $modules{$lib})); - - foreach my $subdir (@subdirs) { - my @headers = findFiles($subdir, "^[-a-z0-9_]*\\.h\$" , 0); - foreach my $header (@headers) { - $header = 0 if($header =~ /^ui_.*.h/); - $header = 0 if ($header eq lc($lib)."version.h"); - foreach (@ignore_headers) { - $header = 0 if($header eq $_); - } - if($header) { - # We need both $public_header and $private_header because QPA headers count as neither - my $public_header = $header; - my $private_header = 0; - if($public_header =~ /_p.h$/ || $public_header =~ /_pch.h$/) { - $public_header = 0; - $private_header = $header =~ /_p.h$/ && $subdir !~ /3rdparty/ - } elsif (isQpaHeader($public_header)) { - $public_header = 0; - } else { - foreach (@ignore_for_master_contents) { - $public_header = 0 if($header eq $_); - } - } - - my $iheader = $subdir . "/" . $header; - check_header($lib, $header, $iheader, $public_header, $private_header); - } - } - } - } -} - exit 0; -- cgit v1.2.3 From 4aedfcc4b949bd0ae0e361738e142051e1ba9b21 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 25 Nov 2015 11:44:04 +0100 Subject: Clean up tst_qlabel Remove unused ctors and dtor, add Q_OBJECT, indent, privatize slots, don't check for nullptr before delete'ing a pointer, and add one override keyword. Setting test_box (a QPointer) to nullptr is already done by the variable's default ctor. Change-Id: I13f06dc8104ef1c0ac08a25c960641c076f10499 Reviewed-by: Friedemann Kleint --- tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp | 28 +++++------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp b/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp index 789a280e80..d76dbf6b46 100644 --- a/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp +++ b/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp @@ -47,13 +47,12 @@ class Widget : public QWidget { + Q_OBJECT public: - Widget() { } - QList events; protected: - bool event(QEvent *ev) { + bool event(QEvent *ev) Q_DECL_OVERRIDE { events.append(ev->type()); return QWidget::event(ev); } @@ -62,19 +61,14 @@ protected: class tst_QLabel : public QObject { -Q_OBJECT - -public: - tst_QLabel(); - virtual ~tst_QLabel(); - + Q_OBJECT -public slots: +private Q_SLOTS: void initTestCase(); void cleanupTestCase(); void init(); void cleanup(); -private slots: + void getSetCheck(); void setText_data(); void setText(); @@ -143,15 +137,6 @@ void tst_QLabel::getSetCheck() delete var3; } - -tst_QLabel::tst_QLabel(): test_box(0) -{ -} - -tst_QLabel::~tst_QLabel() -{ -} - void tst_QLabel::initTestCase() { // Create the test class @@ -164,8 +149,7 @@ void tst_QLabel::cleanupTestCase() { delete testWidget; testWidget = 0; - if (test_box) - delete test_box; + delete test_box; } void tst_QLabel::init() -- cgit v1.2.3 From e5ca416e2f2f17d6a4213094b547ccb6d44d4e56 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 23 Nov 2015 11:39:20 +0100 Subject: Windows QPA: Add API for setting the application orientation preference. Dynamically load the Win32 API functions for setting the rotation preference and map this to static functions taking a Qt::ScreenOrientation in QWindowsScreen. Task-number: QTBUG-49541 Change-Id: I1c81cf6274d79a023a2ee755dd7c085ffd7cc015 Reviewed-by: Laszlo Agocs --- src/plugins/platforms/windows/qwindowscontext.cpp | 5 +- src/plugins/platforms/windows/qwindowscontext.h | 6 ++ src/plugins/platforms/windows/qwindowsscreen.cpp | 68 +++++++++++++++++++++++ src/plugins/platforms/windows/qwindowsscreen.h | 3 + 4 files changed, 81 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index 5cda6379de..f2f6402889 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -177,7 +177,8 @@ QWindowsUser32DLL::QWindowsUser32DLL() : isHungAppWindow(0), isTouchWindow(0), registerTouchWindow(0), unregisterTouchWindow(0), getTouchInputInfo(0), closeTouchInputHandle(0), setProcessDPIAware(0), - addClipboardFormatListener(0), removeClipboardFormatListener(0) + addClipboardFormatListener(0), removeClipboardFormatListener(0), + getDisplayAutoRotationPreferences(0), setDisplayAutoRotationPreferences(0) { } @@ -198,6 +199,8 @@ void QWindowsUser32DLL::init() addClipboardFormatListener = (AddClipboardFormatListener)library.resolve("AddClipboardFormatListener"); removeClipboardFormatListener = (RemoveClipboardFormatListener)library.resolve("RemoveClipboardFormatListener"); } + getDisplayAutoRotationPreferences = (GetDisplayAutoRotationPreferences)library.resolve("GetDisplayAutoRotationPreferences"); + setDisplayAutoRotationPreferences = (SetDisplayAutoRotationPreferences)library.resolve("SetDisplayAutoRotationPreferences"); } bool QWindowsUser32DLL::initTouch() diff --git a/src/plugins/platforms/windows/qwindowscontext.h b/src/plugins/platforms/windows/qwindowscontext.h index 641e3ed41f..d08fc8f726 100644 --- a/src/plugins/platforms/windows/qwindowscontext.h +++ b/src/plugins/platforms/windows/qwindowscontext.h @@ -94,6 +94,8 @@ struct QWindowsUser32DLL typedef BOOL (WINAPI *SetProcessDPIAware)(); typedef BOOL (WINAPI *AddClipboardFormatListener)(HWND); typedef BOOL (WINAPI *RemoveClipboardFormatListener)(HWND); + typedef BOOL (WINAPI *GetDisplayAutoRotationPreferences)(DWORD *); + typedef BOOL (WINAPI *SetDisplayAutoRotationPreferences)(DWORD); // Functions missing in Q_CC_GNU stub libraries. SetLayeredWindowAttributes setLayeredWindowAttributes; @@ -116,6 +118,10 @@ struct QWindowsUser32DLL // Clipboard listeners, Windows Vista onwards AddClipboardFormatListener addClipboardFormatListener; RemoveClipboardFormatListener removeClipboardFormatListener; + + // Rotation API + GetDisplayAutoRotationPreferences getDisplayAutoRotationPreferences; + SetDisplayAutoRotationPreferences setDisplayAutoRotationPreferences; }; struct QWindowsShell32DLL diff --git a/src/plugins/platforms/windows/qwindowsscreen.cpp b/src/plugins/platforms/windows/qwindowsscreen.cpp index e69665e4a9..02696c87cd 100644 --- a/src/plugins/platforms/windows/qwindowsscreen.cpp +++ b/src/plugins/platforms/windows/qwindowsscreen.cpp @@ -325,6 +325,74 @@ void QWindowsScreen::handleChanges(const QWindowsScreenData &newData) } } +enum OrientationPreference // matching Win32 API ORIENTATION_PREFERENCE +#if defined(Q_COMPILER_CLASS_ENUM) || defined(Q_CC_MSVC) + : DWORD +#endif +{ + orientationPreferenceNone = 0, + orientationPreferenceLandscape = 0x1, + orientationPreferencePortrait = 0x2, + orientationPreferenceLandscapeFlipped = 0x4, + orientationPreferencePortraitFlipped = 0x8 +}; + +bool QWindowsScreen::setOrientationPreference(Qt::ScreenOrientation o) +{ + bool result = false; +#ifndef Q_OS_WINCE + if (QWindowsContext::user32dll.setDisplayAutoRotationPreferences) { + DWORD orientationPreference = 0; + switch (o) { + case Qt::PrimaryOrientation: + orientationPreference = orientationPreferenceNone; + break; + case Qt::PortraitOrientation: + orientationPreference = orientationPreferencePortrait; + break; + case Qt::LandscapeOrientation: + orientationPreference = orientationPreferenceLandscape; + break; + case Qt::InvertedPortraitOrientation: + orientationPreference = orientationPreferencePortraitFlipped; + break; + case Qt::InvertedLandscapeOrientation: + orientationPreference = orientationPreferenceLandscapeFlipped; + break; + } + result = QWindowsContext::user32dll.setDisplayAutoRotationPreferences(orientationPreference); + } +#endif // !Q_OS_WINCE + return result; +} + +Qt::ScreenOrientation QWindowsScreen::orientationPreference() +{ + Qt::ScreenOrientation result = Qt::PrimaryOrientation; +#ifndef Q_OS_WINCE + if (QWindowsContext::user32dll.getDisplayAutoRotationPreferences) { + DWORD orientationPreference = 0; + if (QWindowsContext::user32dll.getDisplayAutoRotationPreferences(&orientationPreference)) { + switch (orientationPreference) { + case orientationPreferenceLandscape: + result = Qt::LandscapeOrientation; + break; + case orientationPreferencePortrait: + result = Qt::PortraitOrientation; + break; + case orientationPreferenceLandscapeFlipped: + result = Qt::InvertedLandscapeOrientation; + break; + case orientationPreferencePortraitFlipped: + result = Qt::InvertedPortraitOrientation; + break; + } + } + } +#endif // !Q_OS_WINCE + return result; +} + /*! \brief Queries ClearType settings to check the pixel layout */ diff --git a/src/plugins/platforms/windows/qwindowsscreen.h b/src/plugins/platforms/windows/qwindowsscreen.h index 879cda047e..b46bd88ec6 100644 --- a/src/plugins/platforms/windows/qwindowsscreen.h +++ b/src/plugins/platforms/windows/qwindowsscreen.h @@ -97,6 +97,9 @@ public: QPixmap grabWindow(WId window, int qX, int qY, int qWidth, int qHeight) const Q_DECL_OVERRIDE; QPlatformScreen::SubpixelAntialiasingType subpixelAntialiasingTypeHint() const Q_DECL_OVERRIDE; + static Qt::ScreenOrientation orientationPreference(); + static bool setOrientationPreference(Qt::ScreenOrientation o); + inline void handleChanges(const QWindowsScreenData &newData); #ifndef QT_NO_CURSOR -- cgit v1.2.3 From b4c8e1517455becb138876c08b3bdd880a80770d Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 23 Nov 2015 12:02:24 +0100 Subject: Windows Open GL blacklist: Introduce keyword "disable_rotation". Add a flag to disable rotation to the Renderers enumeration of QWindowsOpenGLTester triggered by the keyword "disable_rotation". Specifying this keyword forces the application to landscape mode for Desktop GL. It is intended for drivers that have issues with rotation. Task-number: QTBUG-49541 Change-Id: I0f0bb7415c59e98648be09b34a59dd201d52b211 Reviewed-by: Laszlo Agocs --- src/plugins/platforms/windows/qwindowsintegration.cpp | 17 ++++++++++++++--- src/plugins/platforms/windows/qwindowsopengltester.cpp | 5 ++++- src/plugins/platforms/windows/qwindowsopengltester.h | 4 +++- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp index 797a96cda7..6b50ebe8a1 100644 --- a/src/plugins/platforms/windows/qwindowsintegration.cpp +++ b/src/plugins/platforms/windows/qwindowsintegration.cpp @@ -338,11 +338,18 @@ QWindowsWindow *QWindowsIntegration::createPlatformWindowHelper(QWindow *window, QWindowsStaticOpenGLContext *QWindowsStaticOpenGLContext::doCreate() { #if defined(QT_OPENGL_DYNAMIC) + const QWindowsOpenGLTester::Renderers supportedRenderers = QWindowsOpenGLTester::supportedRenderers(); + QWindowsOpenGLTester::Renderer requestedRenderer = QWindowsOpenGLTester::requestedRenderer(); switch (requestedRenderer) { case QWindowsOpenGLTester::DesktopGl: - if (QWindowsStaticOpenGLContext *glCtx = QOpenGLStaticContext::create()) + if (QWindowsStaticOpenGLContext *glCtx = QOpenGLStaticContext::create()) { + if ((supportedRenderers & QWindowsOpenGLTester::DisableRotationFlag) + && !QWindowsScreen::setOrientationPreference(Qt::LandscapeOrientation)) { + qCWarning(lcQpaGl, "Unable to disable rotation."); + } return glCtx; + } qCWarning(lcQpaGl, "System OpenGL failed. Falling back to Software OpenGL."); return QOpenGLStaticContext::create(true); // If ANGLE is requested, use it, don't try anything else. @@ -363,10 +370,14 @@ QWindowsStaticOpenGLContext *QWindowsStaticOpenGLContext::doCreate() break; } - const QWindowsOpenGLTester::Renderers supportedRenderers = QWindowsOpenGLTester::supportedRenderers(); if (supportedRenderers & QWindowsOpenGLTester::DesktopGl) { - if (QWindowsStaticOpenGLContext *glCtx = QOpenGLStaticContext::create()) + if (QWindowsStaticOpenGLContext *glCtx = QOpenGLStaticContext::create()) { + if ((supportedRenderers & QWindowsOpenGLTester::DisableRotationFlag) + && !QWindowsScreen::setOrientationPreference(Qt::LandscapeOrientation)) { + qCWarning(lcQpaGl, "Unable to disable rotation."); + } return glCtx; + } } if (QWindowsOpenGLTester::Renderers glesRenderers = supportedRenderers & QWindowsOpenGLTester::GlesMask) { if (QWindowsEGLStaticContext *eglCtx = QWindowsEGLStaticContext::create(glesRenderers)) diff --git a/src/plugins/platforms/windows/qwindowsopengltester.cpp b/src/plugins/platforms/windows/qwindowsopengltester.cpp index e32a7e32af..fcbe488f93 100644 --- a/src/plugins/platforms/windows/qwindowsopengltester.cpp +++ b/src/plugins/platforms/windows/qwindowsopengltester.cpp @@ -268,7 +268,10 @@ QWindowsOpenGLTester::Renderers QWindowsOpenGLTester::detectSupportedRenderers(c result &= ~QWindowsOpenGLTester::AngleRendererD3d9; } } - + if (features.contains(QStringLiteral("disable_rotation"))) { + qCDebug(lcQpaGl) << "Disabling rotation: " << gpu; + result |= DisableRotationFlag; + } srCache->insert(qgpu, result); return result; #endif // !Q_OS_WINCE && !QT_NO_OPENGL diff --git a/src/plugins/platforms/windows/qwindowsopengltester.h b/src/plugins/platforms/windows/qwindowsopengltester.h index f22031aa4e..0fad3d960e 100644 --- a/src/plugins/platforms/windows/qwindowsopengltester.h +++ b/src/plugins/platforms/windows/qwindowsopengltester.h @@ -76,7 +76,9 @@ public: AngleBackendMask = AngleRendererD3d11 | AngleRendererD3d9 | AngleRendererD3d11Warp, Gles = 0x0010, // ANGLE/unspecified or Generic GLES for Windows CE. GlesMask = Gles | AngleBackendMask, - SoftwareRasterizer = 0x0020 + SoftwareRasterizer = 0x0020, + RendererMask = 0x00FF, + DisableRotationFlag = 0x0100 }; Q_DECLARE_FLAGS(Renderers, Renderer) -- cgit v1.2.3 From fb69a09a2490102ad0c3f6015e04942bb5df7505 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 24 Nov 2015 13:49:44 +0100 Subject: QWidget::mapTo/FromGlobal(): Avoid calling QWindow helpers until shown. The platform window geometry can be misleading until it has been properly positioned and QWindowPrivate::resizeEventPending has been cleared. Task-number: QTBUG-49588 Task-number: QTBUG-48396 Change-Id: Ie065f62478fc8522a9ad51391bb897510afa5aad Reviewed-by: Marc Mutz --- src/widgets/kernel/qwidget.cpp | 10 ++++- tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp | 56 ++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 2 deletions(-) diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index b8b8640cea..229cfc0f85 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -12327,6 +12327,12 @@ QPaintEngine *QWidget::paintEngine() const return 0; //##### @@@ } +// Do not call QWindow::mapToGlobal() until QPlatformWindow is properly showing. +static inline bool canMapPosition(QWindow *window) +{ + return window->handle() && !qt_window_private(window)->resizeEventPending; +} + /*! \fn QPoint QWidget::mapToGlobal(const QPoint &pos) const @@ -12354,7 +12360,7 @@ QPoint QWidget::mapToGlobal(const QPoint &pos) const #endif // !QT_NO_GRAPHICSVIEW QWindow *window = w->windowHandle(); - if (window && window->handle()) + if (window && canMapPosition(window)) return window->mapToGlobal(QPoint(x, y)); x += w->data->crect.x(); @@ -12390,7 +12396,7 @@ QPoint QWidget::mapFromGlobal(const QPoint &pos) const #endif // !QT_NO_GRAPHICSVIEW QWindow *window = w->windowHandle(); - if (window && window->handle()) + if (window && canMapPosition(window)) return window->mapFromGlobal(QPoint(x, y)); x -= w->data->crect.x(); diff --git a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp index 5ae0733965..b3f9c54f24 100644 --- a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp +++ b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp @@ -94,6 +94,7 @@ private slots: void task208001_stylesheet(); void activeSubMenuPosition(); + void activeSubMenuPositionExec(); void task242454_sizeHint(); void task176201_clear(); void task250673_activeMultiColumnSubMenuPosition(); @@ -694,6 +695,61 @@ void tst_QMenu::activeSubMenuPosition() #endif } +// QTBUG-49588, QTBUG-48396: activeSubMenuPositionExec() is the same as +// activeSubMenuPosition(), but uses QMenu::exec(), which produces a different +// sequence of events. Verify that the sub menu is positioned to the right of the +// main menu. +class SubMenuPositionExecMenu : public QMenu +{ + Q_OBJECT +public: + SubMenuPositionExecMenu() : QMenu("Menu-Title"), m_timerId(-1), m_timerTick(0) + { + addAction("Item 1"); + m_subMenu = addMenu("Submenu"); + m_subAction = m_subMenu->addAction("Sub-Item1"); + setActiveAction(m_subMenu->menuAction()); + } + +protected: + void showEvent(QShowEvent *e) Q_DECL_OVERRIDE + { + QVERIFY(m_subMenu->isVisible()); + QVERIFY2(m_subMenu->x() > x(), + (QByteArray::number(m_subMenu->x()) + ' ' + QByteArray::number(x())).constData()); + m_timerId = startTimer(50); + QMenu::showEvent(e); + } + + void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE + { + if (e->timerId() == m_timerId) { + switch (m_timerTick++) { + case 0: + m_subMenu->close(); + break; + case 1: + close(); + break; + } + } + } + +private: + int m_timerId; + int m_timerTick; + QMenu *m_subMenu; + QAction *m_subAction; +}; + +void tst_QMenu::activeSubMenuPositionExec() +{ +#ifndef Q_OS_WINCE + SubMenuPositionExecMenu menu; + menu.exec(QGuiApplication::primaryScreen()->availableGeometry().center()); +#endif // !Q_OS_WINCE +} + void tst_QMenu::task242454_sizeHint() { QMenu menu; -- cgit v1.2.3 From 884e3bdd5de3aee841f7194972f1eeeae05649e8 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 25 Nov 2015 09:18:19 +0100 Subject: tst_QItemModel: Use a QTemporaryDir for test data of QDirModel. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I5943c6656da93d36e1955ac038bf656831da0c5c Reviewed-by: Jędrzej Nowacki --- .../corelib/itemmodels/qitemmodel/modelstotest.cpp | 43 +++++++++------------- 1 file changed, 17 insertions(+), 26 deletions(-) diff --git a/tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp b/tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp index ba143a31f8..e0e688cc3a 100644 --- a/tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp +++ b/tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp @@ -78,6 +78,9 @@ public: QList tests; static void setupDatabase(); + +private: + QScopedPointer m_dirModelTempDir; }; @@ -306,18 +309,20 @@ QModelIndex ModelsToTest::populateTestArea(QAbstractItemModel *model) } if (QDirModel *dirModel = qobject_cast(model)) { - if (!QDir::current().mkdir("test")) - qFatal("%s: cannot create directory %s", - Q_FUNC_INFO, - qPrintable(QDir::toNativeSeparators(QDir::currentPath()+"/test"))); + m_dirModelTempDir.reset(new QTemporaryDir); + if (!m_dirModelTempDir->isValid()) + qFatal("Cannot create temporary directory \"%s\": %s", + qPrintable(QDir::toNativeSeparators(m_dirModelTempDir->path())), + qPrintable(m_dirModelTempDir->errorString())); + + QDir tempDir(m_dirModelTempDir->path()); for (int i = 0; i < 26; ++i) { - QString subdir = QString("test/foo_%1").arg(i); - if (!QDir::current().mkdir(subdir)) - qFatal("%s: cannot create directory %s", - Q_FUNC_INFO, - qPrintable(QDir::toNativeSeparators(QDir::currentPath()+"/"+subdir))); + const QString subdir = QString("foo_") + QString::number(i); + if (!tempDir.mkdir(subdir)) + qFatal("Cannot create directory %s", + qPrintable(QDir::toNativeSeparators(tempDir.path() + QLatin1Char('/') +subdir))); } - return dirModel->index(QDir::currentPath()+"/test"); + return dirModel->index(tempDir.path()); } if (QSqlQueryModel *queryModel = qobject_cast(model)) { @@ -382,22 +387,8 @@ QModelIndex ModelsToTest::populateTestArea(QAbstractItemModel *model) */ void ModelsToTest::cleanupTestArea(QAbstractItemModel *model) { - if (qobject_cast(model)) - { - if (QDir(QDir::currentPath()+"/test").exists()) - { - for (int i = 0; i < 26; ++i) { - QString subdir(QString("test/foo_%1").arg(i)); - if (!QDir::current().rmdir(subdir)) - qFatal("%s: cannot remove directory %s", - Q_FUNC_INFO, - qPrintable(QDir::toNativeSeparators(QDir::currentPath()+"/"+subdir))); - } - if (!QDir::current().rmdir("test")) - qFatal("%s: cannot remove directory %s", - Q_FUNC_INFO, - qPrintable(QDir::toNativeSeparators(QDir::currentPath()+"/test"))); - } + if (qobject_cast(model)) { + m_dirModelTempDir.reset(); } else if (qobject_cast(model)) { QSqlQuery q("DROP TABLE test"); } -- cgit v1.2.3 From 4eea99788b11ab8b5e3e68764671757d010425c6 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 25 Nov 2015 11:39:02 +0100 Subject: Fix closing a QMenu by pressing Alt. In QMenuPrivate::hideMenu(), delay clearing of 'causedPopup.widget' to after the QMenu::close() call, so that it is still accessible in QMenu::hideEvent() which calls QMenuBarPrivate::setCurrentAction(0) if the caused widget is a QMenuBar. Task-number: QTBUG-47377 Task-number: QTBUG-49592 Change-Id: Idbda48e918dae799afea84068a60d7383d7b4971 Reviewed-by: Marc Mutz --- src/widgets/widgets/qmenu.cpp | 2 +- .../auto/widgets/widgets/qmenubar/tst_qmenubar.cpp | 30 ++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index 27e977f027..4239e7f3d4 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -502,8 +502,8 @@ void QMenuPrivate::hideMenu(QMenu *menu) if (activeMenu == menu) activeMenu = 0; menu->d_func()->causedPopup.action = 0; - menu->d_func()->causedPopup.widget = 0; menu->close(); + menu->d_func()->causedPopup.widget = 0; if (previousMouseMenu.data() == menu) handleEnterLeaveEvents(&previousMouseMenu, Q_NULLPTR); } diff --git a/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp b/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp index baf60551c4..f787d73a02 100644 --- a/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp +++ b/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp @@ -117,6 +117,7 @@ private slots: // void check_mouse2(); void check_altPress(); + void check_altClosePress(); #if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE) void check_shortcutPress(); void check_menuPosition(); @@ -978,6 +979,35 @@ void tst_QMenuBar::check_altPress() QTRY_VERIFY( ::qobject_cast(qApp->focusWidget()) ); } +// QTBUG-47377: Pressing 'Alt' after opening a menu by pressing 'Alt+Accelerator' +// should close it and QMenuBar::activeAction() should be 0. +void tst_QMenuBar::check_altClosePress() +{ + const QStyle *style = QApplication::style(); + if (!style->styleHint(QStyle::SH_MenuBar_AltKeyNavigation) ) { + QSKIP(("This test is not supposed to work in the " + style->objectName().toLatin1() + + " style. Skipping.").constData()); + } + + QMainWindow w; + w.setWindowTitle(QTest::currentTestFunction()); + QMenu *menuFile = w.menuBar()->addMenu(tr("&File")); + menuFile->addAction("Quit"); + QMenu *menuEdit = w.menuBar()->addMenu(tr("&Edit")); + menuEdit->addAction("Copy"); + + w.show(); + w.move(QGuiApplication::primaryScreen()->availableGeometry().center()); + QApplication::setActiveWindow(&w); + QVERIFY(QTest::qWaitForWindowActive(&w)); + + QTest::keyClick(&w, Qt::Key_F, Qt::AltModifier); + QTRY_VERIFY(menuFile->isVisible()); + QTest::keyClick(menuFile, Qt::Key_Alt, Qt::AltModifier); + QTRY_VERIFY(!menuFile->isVisible()); + QTRY_VERIFY(!w.menuBar()->activeAction()); +} + // Qt/Mac,WinCE does not use the native popups/menubar #if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE) void tst_QMenuBar::check_shortcutPress() -- cgit v1.2.3 From a4ecd5f1b336629c3f1e0224e28c639a9d56757e Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 20 Nov 2015 16:12:23 +0100 Subject: Windows: Open GL blacklist - Disable rotation for Intel HD Graphics 4000 / 5500. The driver causes crashes when switching orientation in full screen mode. Task-number: QTBUG-49541 Change-Id: I8293d4b2f2981fa627654d06894a74c922304ac3 Reviewed-by: Laszlo Agocs --- 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 1e003e2d15..2672711d3a 100644 --- a/src/plugins/platforms/windows/openglblacklists/default.json +++ b/src/plugins/platforms/windows/openglblacklists/default.json @@ -66,6 +66,18 @@ "features": [ "disable_desktopgl", "disable_angle" ] + }, + { + "id": 6, + "description": "Intel(R) HD Graphics 4000 / 5500 cause crashes on orientation changes in fullscreen mode (QTBUG-49541)", + "vendor_id": "0x8086", + "device_id": [ "0x0166", "0x1616" ], + "os": { + "type": "win" + }, + "features": [ + "disable_rotation" + ] } ] } -- cgit v1.2.3 From 40a8302115d6bcc171b314c7d3b4e574b08b66b0 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sat, 24 Oct 2015 12:41:08 +0200 Subject: QtBase: remove explicit function info from qWarning() etc This information is already registered by the QMessageLogger ctor. Where, by dropping the << Q_FUNC_INFO in ostream-style qDebug(), only a string literal remained, converted to printf-style qDebug() on the go. Change-Id: I3f261c98fd7bcfa1fead381a75a82713bb75e6f3 Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/corelib/kernel/qcoreapplication.cpp | 2 +- src/corelib/kernel/qeventdispatcher_blackberry.cpp | 6 +- src/corelib/kernel/qeventdispatcher_win.cpp | 4 +- src/corelib/mimetypes/qmimeprovider.cpp | 2 +- src/corelib/plugin/qlibrary.cpp | 6 +- src/gui/image/qpixmap.cpp | 6 +- src/gui/kernel/qhighdpiscaling.cpp | 2 +- src/gui/kernel/qplatformgraphicsbufferhelper.cpp | 6 +- src/gui/kernel/qplatformscreen.cpp | 6 +- src/gui/kernel/qscreen.cpp | 2 +- src/gui/kernel/qwindow.cpp | 6 +- src/gui/opengl/qopengl.cpp | 4 +- src/gui/opengl/qopengltextureblitter.cpp | 2 +- src/gui/painting/qdrawhelper.cpp | 4 +- src/gui/util/qdesktopservices.cpp | 2 +- src/network/access/qspdyprotocolhandler.cpp | 22 ++--- src/network/bearer/qnetworkconfiguration.cpp | 14 +-- src/network/kernel/qdnslookup_android.cpp | 2 +- src/network/kernel/qdnslookup_unix.cpp | 2 +- src/network/kernel/qdnslookup_win.cpp | 2 +- src/opengl/qglshaderprogram.cpp | 3 +- .../services/genericunix/qgenericunixservices.cpp | 4 +- .../themes/genericunix/qgenericunixthemes.cpp | 2 +- src/plugins/bearer/blackberry/qbbengine.cpp | 22 ++--- .../networkmanager/qnetworkmanagerservice.cpp | 6 +- src/plugins/platforms/cocoa/qcocoamenu.mm | 12 +-- src/plugins/platforms/cocoa/qcocoamenubar.mm | 6 +- src/plugins/platforms/cocoa/qcocoamenuitem.mm | 4 +- src/plugins/platforms/cocoa/qcocoawindow.mm | 2 +- .../platforms/qnx/qqnxabstractnavigator.cpp | 2 +- src/plugins/platforms/qnx/qqnxbpseventfilter.cpp | 22 ++--- src/plugins/platforms/qnx/qqnxbuffer.cpp | 10 +- .../platforms/qnx/qqnxbuttoneventnotifier.cpp | 8 +- src/plugins/platforms/qnx/qqnxclipboard.cpp | 14 +-- src/plugins/platforms/qnx/qqnxeglwindow.cpp | 2 +- .../platforms/qnx/qqnxfiledialoghelper_bb10.cpp | 22 ++--- src/plugins/platforms/qnx/qqnxglcontext.cpp | 18 ++-- src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp | 108 ++++++++++----------- .../platforms/qnx/qqnxinputcontext_noimf.cpp | 14 +-- src/plugins/platforms/qnx/qqnxintegration.cpp | 40 ++++---- src/plugins/platforms/qnx/qqnxnavigatorbps.cpp | 2 +- .../platforms/qnx/qqnxnavigatoreventhandler.cpp | 14 +-- .../platforms/qnx/qqnxnavigatoreventnotifier.cpp | 20 ++-- src/plugins/platforms/qnx/qqnxnavigatorpps.cpp | 14 +-- .../platforms/qnx/qqnxrasterbackingstore.cpp | 14 +-- src/plugins/platforms/qnx/qqnxrasterwindow.cpp | 8 +- src/plugins/platforms/qnx/qqnxscreen.cpp | 32 +++--- .../platforms/qnx/qqnxscreeneventhandler.cpp | 22 ++--- .../platforms/qnx/qqnxscreeneventthread.cpp | 10 +- .../platforms/qnx/qqnxvirtualkeyboardbps.cpp | 18 ++-- .../platforms/qnx/qqnxvirtualkeyboardpps.cpp | 14 +-- src/plugins/platforms/qnx/qqnxwindow.cpp | 40 ++++---- .../platforms/windows/qwindowsclipboard.cpp | 2 +- .../platforms/windows/qwindowsglcontext.cpp | 4 +- src/plugins/platforms/winrt/qwinrtinputcontext.cpp | 4 +- src/plugins/platforms/xcb/qxcbxsettings.cpp | 4 +- src/testlib/qtestaccessible.h | 9 +- src/widgets/itemviews/qtableview.cpp | 4 - src/widgets/kernel/qwidgetwindow.cpp | 2 +- src/widgets/styles/qwindowsvistastyle.cpp | 4 +- src/widgets/styles/qwindowsxpstyle.cpp | 6 +- src/widgets/util/qsystemtrayicon_win.cpp | 2 +- src/widgets/widgets/qtoolbararealayout.cpp | 2 +- 63 files changed, 333 insertions(+), 341 deletions(-) diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index aa44d2e74b..abc5af94cb 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -350,7 +350,7 @@ struct QCoreApplicationData { QFile metafile(QStringLiteral("app/META-INF/MANIFEST.MF")); if (!metafile.open(QIODevice::ReadOnly)) { - qWarning() << Q_FUNC_INFO << "Could not open application metafile for reading"; + qWarning("Could not open application metafile for reading") } else { while (!metafile.atEnd() && (application.isEmpty() || applicationVersion.isEmpty() || orgName.isEmpty())) { QByteArray line = metafile.readLine(); diff --git a/src/corelib/kernel/qeventdispatcher_blackberry.cpp b/src/corelib/kernel/qeventdispatcher_blackberry.cpp index 796daaa50a..a8e3d3c766 100644 --- a/src/corelib/kernel/qeventdispatcher_blackberry.cpp +++ b/src/corelib/kernel/qeventdispatcher_blackberry.cpp @@ -102,7 +102,7 @@ static int bpsUnblockDomain = -1; static int bpsIOHandler(int fd, int io_events, void *data) { - qEventDispatcherDebug << Q_FUNC_INFO; + qEventDispatcherDebug; // decode callback payload bpsIOHandlerData *ioData = static_cast(data); @@ -223,7 +223,7 @@ void QEventDispatcherBlackberry::registerSocketNotifier(QSocketNotifier *notifie int sockfd = notifier->socket(); int type = notifier->type(); - qEventDispatcherDebug << Q_FUNC_INFO << "fd =" << sockfd; + qEventDispatcherDebug << "fd =" << sockfd; if (Q_UNLIKELY(sockfd >= FD_SETSIZE)) { qWarning() << "QEventDispatcherBlackberry: cannot register QSocketNotifier (fd too high)" @@ -267,7 +267,7 @@ void QEventDispatcherBlackberry::unregisterSocketNotifier(QSocketNotifier *notif int sockfd = notifier->socket(); - qEventDispatcherDebug << Q_FUNC_INFO << "fd =" << sockfd; + qEventDispatcherDebug << "fd =" << sockfd; if (Q_UNLIKELY(sockfd >= FD_SETSIZE)) { qWarning() << "QEventDispatcherBlackberry: cannot unregister QSocketNotifier" << sockfd; diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp index ecaa78cbbc..bb091e9f6d 100644 --- a/src/corelib/kernel/qeventdispatcher_win.cpp +++ b/src/corelib/kernel/qeventdispatcher_win.cpp @@ -513,7 +513,7 @@ QWindowsMessageWindowClassContext::QWindowsMessageWindowClassContext() wc.lpszClassName = className; atom = RegisterClass(&wc); if (!atom) { - qErrnoWarning("%s: RegisterClass() failed", Q_FUNC_INFO, qPrintable(qClassName)); + qErrnoWarning("%s RegisterClass() failed", qPrintable(qClassName)); delete [] className; className = 0; } @@ -549,7 +549,7 @@ static HWND qt_create_internal_window(const QEventDispatcherWin32 *eventDispatch 0); // windows creation data. if (!wnd) { - qErrnoWarning("%s: CreateWindow() for QEventDispatcherWin32 internal window failed", Q_FUNC_INFO); + qErrnoWarning("CreateWindow() for QEventDispatcherWin32 internal window failed"); return 0; } diff --git a/src/corelib/mimetypes/qmimeprovider.cpp b/src/corelib/mimetypes/qmimeprovider.cpp index e0fe144c26..59aef39fb7 100644 --- a/src/corelib/mimetypes/qmimeprovider.cpp +++ b/src/corelib/mimetypes/qmimeprovider.cpp @@ -756,7 +756,7 @@ void QMimeXMLProvider::ensureLoaded() foreach (const QString &packageDir, packageDirs) { QDir dir(packageDir); const QStringList files = dir.entryList(QDir::Files | QDir::NoDotAndDotDot); - //qDebug() << static_cast(this) << Q_FUNC_INFO << packageDir << files; + //qDebug() << static_cast(this) << packageDir << files; if (!fdoXmlFound) fdoXmlFound = files.contains(QLatin1String("freedesktop.org.xml")); QStringList::const_iterator endIt(files.constEnd()); diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp index 920e02ae5a..317c1dcdc1 100644 --- a/src/corelib/plugin/qlibrary.cpp +++ b/src/corelib/plugin/qlibrary.cpp @@ -337,12 +337,10 @@ static void installCoverageTool(QLibraryPrivate *libPrivate) if (qt_debug_component()) { if (ret >= 0) { - qDebug("%s: coverage data for %s registered", - Q_FUNC_INFO, + qDebug("coverage data for %s registered", qPrintable(libPrivate->fileName)); } else { - qWarning("%s: could not register %s: error %d; coverage data may be incomplete", - Q_FUNC_INFO, + qWarning("could not register %s: error %d; coverage data may be incomplete", qPrintable(libPrivate->fileName), ret); } diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index e53af8038f..fb62889e40 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -907,7 +907,7 @@ void QPixmap::fill(const QPaintDevice *device, const QPoint &p) { Q_UNUSED(device) Q_UNUSED(p) - qWarning("%s is deprecated, ignored", Q_FUNC_INFO); + qWarning("this function is deprecated, ignored"); } @@ -1703,8 +1703,8 @@ QPixmap QPixmap::fromImageReader(QImageReader *imageReader, Qt::ImageConversionF QPixmap QPixmap::grabWindow(WId window, int x, int y, int w, int h) { - qWarning("%s is deprecated, use QScreen::grabWindow() instead." - " Defaulting to primary screen.", Q_FUNC_INFO); + qWarning("this function is deprecated, use QScreen::grabWindow() instead." + " Defaulting to primary screen."); return QGuiApplication::primaryScreen()->grabWindow(window, x, y, w, h); } diff --git a/src/gui/kernel/qhighdpiscaling.cpp b/src/gui/kernel/qhighdpiscaling.cpp index a002b8c48d..4a0900ad97 100644 --- a/src/gui/kernel/qhighdpiscaling.cpp +++ b/src/gui/kernel/qhighdpiscaling.cpp @@ -227,7 +227,7 @@ void QHighDpiScaling::setGlobalFactor(qreal factor) if (qFuzzyCompare(factor, m_factor)) return; if (!QGuiApplication::allWindows().isEmpty()) - qWarning() << Q_FUNC_INFO << "QHighDpiScaling::setFactor: Should only be called when no windows exist."; + qWarning("QHighDpiScaling::setFactor: Should only be called when no windows exist."); m_globalScalingActive = !qFuzzyCompare(factor, qreal(1)); m_factor = m_globalScalingActive ? factor : qreal(1); diff --git a/src/gui/kernel/qplatformgraphicsbufferhelper.cpp b/src/gui/kernel/qplatformgraphicsbufferhelper.cpp index 2749b05691..1d59c38598 100644 --- a/src/gui/kernel/qplatformgraphicsbufferhelper.cpp +++ b/src/gui/kernel/qplatformgraphicsbufferhelper.cpp @@ -69,18 +69,18 @@ bool QPlatformGraphicsBufferHelper::lockAndBindToTexture(QPlatformGraphicsBuffer { if (graphicsBuffer->lock(QPlatformGraphicsBuffer::TextureAccess)) { if (!graphicsBuffer->bindToTexture(rect)) { - qWarning() << Q_FUNC_INFO << "Failed to bind graphicsbuffer to texture"; + qWarning("Failed to bind %sgraphicsbuffer to texture", ""); return false; } if (swizzle) *swizzle = false; } else if (graphicsBuffer->lock(QPlatformGraphicsBuffer::SWReadAccess)) { if (!bindSWToTexture(graphicsBuffer, swizzle, rect)) { - qWarning() << Q_FUNC_INFO << "Failed to bind SW graphcisbuffer to texture"; + qWarning("Failed to bind %sgraphicsbuffer to texture", "SW "); return false; } } else { - qWarning() << Q_FUNC_INFO << "Failed to lock"; + qWarning("Failed to lock"); return false; } return true; diff --git a/src/gui/kernel/qplatformscreen.cpp b/src/gui/kernel/qplatformscreen.cpp index 8666d0a04c..8e9767d69e 100644 --- a/src/gui/kernel/qplatformscreen.cpp +++ b/src/gui/kernel/qplatformscreen.cpp @@ -362,7 +362,7 @@ static int log2(uint i) int QPlatformScreen::angleBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b) { if (a == Qt::PrimaryOrientation || b == Qt::PrimaryOrientation) { - qWarning() << "Use QScreen version of" << __FUNCTION__ << "when passing Qt::PrimaryOrientation"; + qWarning("Use QScreen version of %sBetween() when passing Qt::PrimaryOrientation", "angle"); return 0; } @@ -384,7 +384,7 @@ int QPlatformScreen::angleBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation QTransform QPlatformScreen::transformBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &target) { if (a == Qt::PrimaryOrientation || b == Qt::PrimaryOrientation) { - qWarning() << "Use QScreen version of" << __FUNCTION__ << "when passing Qt::PrimaryOrientation"; + qWarning("Use QScreen version of %sBetween() when passing Qt::PrimaryOrientation", "transform"); return QTransform(); } @@ -415,7 +415,7 @@ QTransform QPlatformScreen::transformBetween(Qt::ScreenOrientation a, Qt::Screen QRect QPlatformScreen::mapBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &rect) { if (a == Qt::PrimaryOrientation || b == Qt::PrimaryOrientation) { - qWarning() << "Use QScreen version of" << __FUNCTION__ << "when passing Qt::PrimaryOrientation"; + qWarning("Use QScreen version of %sBetween() when passing Qt::PrimaryOrientation", "map"); return rect; } diff --git a/src/gui/kernel/qscreen.cpp b/src/gui/kernel/qscreen.cpp index b6b50372ae..fb322ae74f 100644 --- a/src/gui/kernel/qscreen.cpp +++ b/src/gui/kernel/qscreen.cpp @@ -680,7 +680,7 @@ QPixmap QScreen::grabWindow(WId window, int x, int y, int width, int height) { const QPlatformScreen *platformScreen = handle(); if (!platformScreen) { - qWarning("%s invoked with handle==0", Q_FUNC_INFO); + qWarning("invoked with handle==0"); return QPixmap(); } return platformScreen->grabWindow(window, x, y, width, height); diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index e262f3f8a4..e728d32e4b 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -369,7 +369,7 @@ void QWindowPrivate::setTopLevelScreen(QScreen *newScreen, bool recreate) { Q_Q(QWindow); if (parentWindow) { - qWarning() << this << Q_FUNC_INFO << '(' << newScreen << "): Attempt to set a screen on a child window."; + qWarning() << this << '(' << newScreen << "): Attempt to set a screen on a child window."; return; } if (newScreen != topLevelScreen) { @@ -604,7 +604,7 @@ void QWindow::setParent(QWindow *parent) QScreen *newScreen = parent ? parent->screen() : screen(); if (d->windowRecreationRequired(newScreen)) { - qWarning() << this << Q_FUNC_INFO << '(' << parent << "): Cannot change screens (" << screen() << newScreen << ')'; + qWarning() << this << '(' << parent << "): Cannot change screens (" << screen() << newScreen << ')'; return; } @@ -1160,7 +1160,7 @@ void QWindow::setTransientParent(QWindow *parent) { Q_D(QWindow); if (parent && !parent->isTopLevel()) { - qWarning() << Q_FUNC_INFO << parent << "must be a top level window."; + qWarning() << parent << "must be a top level window."; return; } diff --git a/src/gui/opengl/qopengl.cpp b/src/gui/opengl/qopengl.cpp index 68cd8a82b4..a77d6743ad 100644 --- a/src/gui/opengl/qopengl.cpp +++ b/src/gui/opengl/qopengl.cpp @@ -184,7 +184,7 @@ struct VersionTerm { bool VersionTerm::matches(const QVersionNumber &other) const { if (isNull() || other.isNull()) { - qWarning() << Q_FUNC_INFO << "called with invalid parameters"; + qWarning("called with invalid parameters"); return false; } switch (op) { @@ -262,7 +262,7 @@ struct OsTypeTerm bool matches(const QString &osName, const QVersionNumber &kernelVersion, const QString &osRelease) const { if (isNull() || osName.isEmpty() || kernelVersion.isNull()) { - qWarning() << Q_FUNC_INFO << "called with invalid parameters"; + qWarning("called with invalid parameters"); return false; } if (type != osName) diff --git a/src/gui/opengl/qopengltextureblitter.cpp b/src/gui/opengl/qopengltextureblitter.cpp index 1c6a7937e5..9e611a160d 100644 --- a/src/gui/opengl/qopengltextureblitter.cpp +++ b/src/gui/opengl/qopengltextureblitter.cpp @@ -285,7 +285,7 @@ bool QOpenGLTextureBlitterPrivate::buildProgram(ProgramIndex idx, const char *vs p->glProgram->addShaderFromSourceCode(QOpenGLShader::Fragment, fs); p->glProgram->link(); if (!p->glProgram->isLinked()) { - qWarning() << Q_FUNC_INFO << "Could not link shader program:\n" << p->glProgram->log(); + qWarning() << "Could not link shader program:\n" << p->glProgram->log(); return false; } diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index 988bee9b27..0d89b2466d 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -3885,7 +3885,7 @@ void blend_color_generic_rgb64(int count, const QSpan *spans, void *userData) QSpanData *data = reinterpret_cast(userData); Operator op = getOperator(data, spans, count); if (!op.funcSolid64) { - qDebug() << Q_FUNC_INFO << "unsupported 64bit blend attempted"; + qDebug("unsupported 64bit blend attempted"); return blend_color_generic(count, spans, userData); } @@ -4180,7 +4180,7 @@ static void blend_untransformed_generic_rgb64(int count, const QSpan *spans, voi Operator op = getOperator(data, spans, count); if (!op.func64) { - qWarning() << Q_FUNC_INFO << "Unsupported blend"; + qWarning("Unsupported blend"); return blend_untransformed_generic(count, spans, userData); } QRgba64 buffer[buffer_size]; diff --git a/src/gui/util/qdesktopservices.cpp b/src/gui/util/qdesktopservices.cpp index 354dfeb78c..70daf55b61 100644 --- a/src/gui/util/qdesktopservices.cpp +++ b/src/gui/util/qdesktopservices.cpp @@ -197,7 +197,7 @@ bool QDesktopServices::openUrl(const QUrl &url) QPlatformServices *platformServices = platformIntegration->services(); if (!platformServices) { - qWarning("%s: The platform plugin does not support services.", Q_FUNC_INFO); + qWarning("The platform plugin does not support services."); return false; } return url.scheme() == QLatin1String("file") ? diff --git a/src/network/access/qspdyprotocolhandler.cpp b/src/network/access/qspdyprotocolhandler.cpp index 7d2c0dfef2..5f9697ab92 100644 --- a/src/network/access/qspdyprotocolhandler.cpp +++ b/src/network/access/qspdyprotocolhandler.cpp @@ -452,7 +452,7 @@ bool QSpdyProtocolHandler::uncompressHeader(const QByteArray &input, QByteArray break; } default: { - qWarning() << Q_FUNC_INFO << "got unexpected zlib return value:" << zlibRet; + qWarning() << "got unexpected zlib return value:" << zlibRet; return false; } } @@ -688,7 +688,7 @@ bool QSpdyProtocolHandler::uploadData(qint32 streamID) Q_ASSERT(replyPrivate); if (reply->d_func()->state == QHttpNetworkReplyPrivate::SPDYHalfClosed || reply->d_func()->state == QHttpNetworkReplyPrivate::SPDYClosed) { - qWarning() << Q_FUNC_INFO << "Trying to upload to closed stream"; + qWarning("Trying to upload to closed stream"); return false; } @@ -843,7 +843,7 @@ void QSpdyProtocolHandler::handleControlFrame(const QByteArray &frameHeaders) // break; } default: - qWarning() << Q_FUNC_INFO << "cannot handle frame of type" << type; + qWarning() << "cannot handle frame of type" << type; } } @@ -887,13 +887,13 @@ void QSpdyProtocolHandler::parseHttpHeaders(char flags, const QByteArray &frameD QByteArray uncompressedHeader; if (!uncompressHeader(headerValuePairs, &uncompressedHeader)) { - qWarning() << Q_FUNC_INFO << "error reading header from SYN_REPLY message"; + qWarning("error reading header from SYN_REPLY message"); return; } qint32 headerCount = fourBytesToInt(uncompressedHeader.constData()); if (headerCount * 8 > uncompressedHeader.size()) { - qWarning() << Q_FUNC_INFO << "error parsing header from SYN_REPLY message"; + qWarning("error parsing header from SYN_REPLY message"); sendRST_STREAM(streamID, RST_STREAM_PROTOCOL_ERROR); return; } @@ -904,7 +904,7 @@ void QSpdyProtocolHandler::parseHttpHeaders(char flags, const QByteArray &frameD QByteArray name = uncompressedHeader.mid(readPointer, count); readPointer += count; if (readPointer > uncompressedHeader.size()) { - qWarning() << Q_FUNC_INFO << "error parsing header from SYN_REPLY message"; + qWarning("error parsing header from SYN_REPLY message"); sendRST_STREAM(streamID, RST_STREAM_PROTOCOL_ERROR); return; } @@ -913,7 +913,7 @@ void QSpdyProtocolHandler::parseHttpHeaders(char flags, const QByteArray &frameD QByteArray value = uncompressedHeader.mid(readPointer, count); readPointer += count; if (readPointer > uncompressedHeader.size()) { - qWarning() << Q_FUNC_INFO << "error parsing header from SYN_REPLY message"; + qWarning("error parsing header from SYN_REPLY message"); sendRST_STREAM(streamID, RST_STREAM_PROTOCOL_ERROR); return; } @@ -1014,7 +1014,7 @@ void QSpdyProtocolHandler::handleRST_STREAM(char /*flags*/, quint32 length, errorMessage = "server cannot process the frame because it is too large"; break; default: - qWarning() << Q_FUNC_INFO << "could not understand servers RST_STREAM status code"; + qWarning("could not understand servers RST_STREAM status code"); errorCode = QNetworkReply::ProtocolFailure; errorMessage = "got SPDY RST_STREAM message with unknown error code"; } @@ -1078,7 +1078,7 @@ void QSpdyProtocolHandler::handleSETTINGS(char flags, quint32 /*length*/, const break; } default: - qWarning() << Q_FUNC_INFO << "found unknown settings value" << value; + qWarning() << "found unknown settings value" << value; } } } @@ -1117,7 +1117,7 @@ void QSpdyProtocolHandler::handleGOAWAY(char /*flags*/, quint32 /*length*/, break; } default: - qWarning() << Q_FUNC_INFO << "unexpected status code" << statusCode; + qWarning() << "unexpected status code" << statusCode; errorCode = QNetworkReply::ProtocolUnknownError; } @@ -1252,7 +1252,7 @@ void QSpdyProtocolHandler::handleDataFrame(const QByteArray &frameHeaders) } if (flag_compress) { - qWarning() << Q_FUNC_INFO << "SPDY level compression is not supported"; + qWarning("SPDY level compression is not supported"); } if (flag_fin) { diff --git a/src/network/bearer/qnetworkconfiguration.cpp b/src/network/bearer/qnetworkconfiguration.cpp index 6b56d3ec88..378245ce3e 100644 --- a/src/network/bearer/qnetworkconfiguration.cpp +++ b/src/network/bearer/qnetworkconfiguration.cpp @@ -211,30 +211,30 @@ static QNetworkConfiguration::BearerType cellularStatus() int cellularStatusFD; if ((cellularStatusFD = qt_safe_open(cellularStatusFile, O_RDONLY)) == -1) { - qWarning() << Q_FUNC_INFO << "failed to open" << cellularStatusFile; + qWarning() << "failed to open" << cellularStatusFile; return ret; } char buf[2048]; if (qt_safe_read(cellularStatusFD, &buf, sizeof(buf)) == -1) { - qWarning() << Q_FUNC_INFO << "read from PPS file failed:" << strerror(errno); + qWarning() << "read from PPS file failed:" << strerror(errno); qt_safe_close(cellularStatusFD); return ret; } pps_decoder_t ppsDecoder; if (pps_decoder_initialize(&ppsDecoder, buf) != PPS_DECODER_OK) { - qWarning() << Q_FUNC_INFO << "failed to initialize PPS decoder"; + qWarning("failed to initialize PPS decoder"); qt_safe_close(cellularStatusFD); return ret; } pps_decoder_error_t err; if ((err = pps_decoder_push(&ppsDecoder, 0)) != PPS_DECODER_OK) { - qWarning() << Q_FUNC_INFO << "pps_decoder_push failed" << err; + qWarning() << "pps_decoder_push failed" << err; pps_decoder_cleanup(&ppsDecoder); qt_safe_close(cellularStatusFD); return ret; } if (!pps_decoder_is_integer(&ppsDecoder, "network_technology")) { - qWarning() << Q_FUNC_INFO << "field has not the expected data type"; + qWarning("field has not the expected data type"); pps_decoder_cleanup(&ppsDecoder); qt_safe_close(cellularStatusFD); return ret; @@ -242,7 +242,7 @@ static QNetworkConfiguration::BearerType cellularStatus() int type; if (!pps_decoder_get_int(&ppsDecoder, "network_technology", &type) == PPS_DECODER_OK) { - qWarning() << Q_FUNC_INFO << "could not read bearer type from PPS"; + qWarning("could not read bearer type from PPS"); pps_decoder_cleanup(&ppsDecoder); qt_safe_close(cellularStatusFD); return ret; @@ -264,7 +264,7 @@ static QNetworkConfiguration::BearerType cellularStatus() ret = QNetworkConfiguration::BearerLTE; break; default: - qWarning() << Q_FUNC_INFO << "unhandled bearer type" << type; + qWarning() << "unhandled bearer type" << type; break; } pps_decoder_cleanup(&ppsDecoder); diff --git a/src/network/kernel/qdnslookup_android.cpp b/src/network/kernel/qdnslookup_android.cpp index b03c63c320..978da57609 100644 --- a/src/network/kernel/qdnslookup_android.cpp +++ b/src/network/kernel/qdnslookup_android.cpp @@ -41,7 +41,7 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN Q_UNUSED(requestName); Q_UNUSED(nameserver); Q_UNUSED(reply); - qWarning() << Q_FUNC_INFO << "Not yet supported on Android"; + qWarning("Not yet supported on Android"); reply->error = QDnsLookup::ResolverError; reply->errorString = tr("Not yet supported on Android"); return; diff --git a/src/network/kernel/qdnslookup_unix.cpp b/src/network/kernel/qdnslookup_unix.cpp index fa782dadf7..a5e97c4a93 100644 --- a/src/network/kernel/qdnslookup_unix.cpp +++ b/src/network/kernel/qdnslookup_unix.cpp @@ -166,7 +166,7 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN ns->sin6_addr.s6_addr[i] = ipv6Address[i]; } #else - qWarning() << Q_FUNC_INFO << "IPv6 addresses for nameservers is currently not supported"; + qWarning("IPv6 addresses for nameservers is currently not supported"); reply->error = QDnsLookup::ResolverError; reply->errorString = tr("IPv6 addresses for nameservers is currently not supported"); return; diff --git a/src/network/kernel/qdnslookup_win.cpp b/src/network/kernel/qdnslookup_win.cpp index 056a9c7a62..7eeeb80264 100644 --- a/src/network/kernel/qdnslookup_win.cpp +++ b/src/network/kernel/qdnslookup_win.cpp @@ -60,7 +60,7 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN // For supoprting IPv6 nameserver addresses, we'll need to switch // from DnsQuey() to DnsQueryEx() as it supports passing an IPv6 // address in the nameserver list - qWarning() << Q_FUNC_INFO << "IPv6 addresses for nameservers is currently not supported"; + qWarning("IPv6 addresses for nameservers is currently not supported"); reply->error = QDnsLookup::ResolverError; reply->errorString = tr("IPv6 addresses for nameservers is currently not supported"); return; diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp index abd4a59fb8..0617c36236 100644 --- a/src/opengl/qglshaderprogram.cpp +++ b/src/opengl/qglshaderprogram.cpp @@ -246,8 +246,7 @@ bool QGLShaderPrivate::create() else shader = glfuncs->glCreateShader(GL_FRAGMENT_SHADER); if (!shader) { - qWarning("%s: Could not create shader of type %d.", - Q_FUNC_INFO, int(shaderType)); + qWarning("Could not create shader of type %d.", int(shaderType)); return false; } shaderGuard = createSharedResourceGuard(context, shader, freeShaderFunc); diff --git a/src/platformsupport/services/genericunix/qgenericunixservices.cpp b/src/platformsupport/services/genericunix/qgenericunixservices.cpp index b59ae431f4..33cb4391f0 100644 --- a/src/platformsupport/services/genericunix/qgenericunixservices.cpp +++ b/src/platformsupport/services/genericunix/qgenericunixservices.cpp @@ -134,7 +134,7 @@ bool QGenericUnixServices::openUrl(const QUrl &url) return openDocument(url); if (m_webBrowser.isEmpty() && !detectWebBrowser(desktopEnvironment(), true, &m_webBrowser)) { - qWarning("%s: Unable to detect a web browser to launch '%s'", Q_FUNC_INFO, qPrintable(url.toString())); + qWarning("Unable to detect a web browser to launch '%s'", qPrintable(url.toString())); return false; } return launch(m_webBrowser, url); @@ -143,7 +143,7 @@ bool QGenericUnixServices::openUrl(const QUrl &url) bool QGenericUnixServices::openDocument(const QUrl &url) { if (m_documentLauncher.isEmpty() && !detectWebBrowser(desktopEnvironment(), false, &m_documentLauncher)) { - qWarning("%s: Unable to detect a launcher for '%s'", Q_FUNC_INFO, qPrintable(url.toString())); + qWarning("Unable to detect a launcher for '%s'", qPrintable(url.toString())); return false; } return launch(m_documentLauncher, url); diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp index c94bfd4f4e..8f6171f217 100644 --- a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp +++ b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp @@ -546,7 +546,7 @@ QPlatformTheme *QKdeTheme::createKdeTheme() kdeDirs.removeDuplicates(); if (kdeDirs.isEmpty()) { - qWarning("%s: Unable to determine KDE dirs", Q_FUNC_INFO); + qWarning("Unable to determine KDE dirs"); return 0; } diff --git a/src/plugins/bearer/blackberry/qbbengine.cpp b/src/plugins/bearer/blackberry/qbbengine.cpp index d90d9fa217..5483c48eaa 100644 --- a/src/plugins/bearer/blackberry/qbbengine.cpp +++ b/src/plugins/bearer/blackberry/qbbengine.cpp @@ -151,14 +151,14 @@ void QBBEngine::disconnectFromId(const QString &id) void QBBEngine::initialize() { if (initialized) { - qWarning() << Q_FUNC_INFO << "called, but instance already initialized."; + qWarning("called, but instance already initialized."); return; } instanceStorage()->setLocalData(new EngineInstanceHolder(this)); if (netstatus_request_events(0) != BPS_SUCCESS) { - qWarning() << Q_FUNC_INFO << "cannot register for network events. Polling enabled."; + qWarning("cannot register for network events. Polling enabled."); const QMutexLocker locker(&pollingMutex); pollingRequired = true; @@ -176,12 +176,12 @@ void QBBEngine::requestUpdate() void QBBEngine::doRequestUpdate() { - qBearerDebug() << Q_FUNC_INFO << "entered method"; + qBearerDebug("entered method"); netstatus_interface_list_t interfaceList; if ((netstatus_get_interfaces(&interfaceList)) != BPS_SUCCESS) { - qBearerDebug() << Q_FUNC_INFO << "cannot retrieve interface list"; + qBearerDebug("cannot retrieve interface list"); return; } @@ -193,7 +193,7 @@ void QBBEngine::doRequestUpdate() for (int i = 0; i < interfaceList.num_interfaces; i++) { const char *interface = interfaceList.interfaces[i]; - qBearerDebug() << Q_FUNC_INFO << "discovered interface" << interface; + qBearerDebug() << "discovered interface" << interface; updateConfiguration(interface); @@ -262,7 +262,7 @@ QNetworkConfigurationPrivatePointer QBBEngine::defaultConfiguration() const QMutexLocker locker(&mutex); if (accessPointConfigurations.contains(id)) { - qBearerDebug() << Q_FUNC_INFO << "found default interface:" << id; + qBearerDebug() << "found default interface:" << id; return accessPointConfigurations.value(id); } @@ -287,7 +287,7 @@ bool QBBEngine::nativeEventFilter(const QByteArray &eventType, void *message, lo Q_ASSERT(event); if (bps_event_get_domain(event) == netstatus_get_domain()) { - qBearerDebug() << Q_FUNC_INFO << "got update request."; + qBearerDebug("got update request."); doRequestUpdate(); } @@ -299,7 +299,7 @@ void QBBEngine::updateConfiguration(const char *interface) netstatus_interface_details_t *details = 0; if (netstatus_get_interface_details(interface, &details) != BPS_SUCCESS) { - qBearerDebug() << Q_FUNC_INFO << "cannot retrieve details for interface" << interface; + qBearerDebug() << "cannot retrieve details for interface" << interface; return; } @@ -355,12 +355,12 @@ void QBBEngine::updateConfiguration(const char *interface) locker.unlock(); if (changed) { - qBearerDebug() << Q_FUNC_INFO << "configuration changed:" << interface; + qBearerDebug() << "configuration changed:" << interface; Q_EMIT configurationChanged(ptr); } else { // maybe Wifi has changed but gateway not yet ready etc. - qBearerDebug() << Q_FUNC_INFO << "configuration has not changed."; + qBearerDebug("configuration has not changed."); if (oldIpStatus != ipStatus) { // if IP status changed if (ipStatus != NETSTATUS_IP_STATUS_OK && ipStatus != NETSTATUS_IP_STATUS_ERROR_NOT_UP @@ -389,7 +389,7 @@ void QBBEngine::updateConfiguration(const char *interface) locker.unlock(); - qBearerDebug() << Q_FUNC_INFO << "configuration added:" << interface; + qBearerDebug() << "configuration added:" << interface; Q_EMIT configurationAdded(ptr); } diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp b/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp index 75c4ce2014..fc9a3281b8 100644 --- a/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp +++ b/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp @@ -74,7 +74,7 @@ QNetworkManagerInterface::QNetworkManagerInterface(QObject *parent) if (!propsReply.isError()) { propertyMap = propsReply.value(); } else { - qWarning() << Q_FUNC_INFO << "propsReply"< > nmReply @@ -83,7 +83,7 @@ QNetworkManagerInterface::QNetworkManagerInterface(QObject *parent) if (!nmReply.isError()) { devicesPathList = nmReply.value(); } else { - qWarning() << Q_FUNC_INFO <<"nmReply"<nsItem() menu]) { - qWarning() << Q_FUNC_INFO << "Menu item is already in a menu, remove it from the other menu first before inserting"; + qWarning("Menu item is already in a menu, remove it from the other menu first before inserting"); return; } // if the item we're inserting before is merged, skip along until @@ -326,7 +326,7 @@ void QCocoaMenu::insertNative(QCocoaMenuItem *item, QCocoaMenuItem *beforeItem) if (beforeItem) { if (beforeItem->isMerged()) { - qWarning() << Q_FUNC_INFO << "No non-merged before menu item found"; + qWarning("No non-merged before menu item found"); return; } NSUInteger nativeIndex = [m_nativeMenu indexOfItem:beforeItem->nsItem()]; @@ -342,7 +342,7 @@ void QCocoaMenu::removeMenuItem(QPlatformMenuItem *menuItem) QMacAutoReleasePool pool; QCocoaMenuItem *cocoaItem = static_cast(menuItem); if (!m_menuItems.contains(cocoaItem)) { - qWarning() << Q_FUNC_INFO << "Menu does not contain the item to be removed"; + qWarning("Menu does not contain the item to be removed"); return; } @@ -352,7 +352,7 @@ void QCocoaMenu::removeMenuItem(QPlatformMenuItem *menuItem) m_menuItems.removeOne(cocoaItem); if (!cocoaItem->isMerged()) { if (m_nativeMenu != [cocoaItem->nsItem() menu]) { - qWarning() << Q_FUNC_INFO << "Item to remove does not belong to this menu"; + qWarning("Item to remove does not belong to this menu"); return; } [m_nativeMenu removeItem: cocoaItem->nsItem()]; @@ -372,7 +372,7 @@ void QCocoaMenu::syncMenuItem(QPlatformMenuItem *menuItem) QMacAutoReleasePool pool; QCocoaMenuItem *cocoaItem = static_cast(menuItem); if (!m_menuItems.contains(cocoaItem)) { - qWarning() << Q_FUNC_INFO << "Item does not belong to this menu"; + qWarning("Item does not belong to this menu"); return; } diff --git a/src/plugins/platforms/cocoa/qcocoamenubar.mm b/src/plugins/platforms/cocoa/qcocoamenubar.mm index 7775cdbde6..1a516f874b 100644 --- a/src/plugins/platforms/cocoa/qcocoamenubar.mm +++ b/src/plugins/platforms/cocoa/qcocoamenubar.mm @@ -108,12 +108,12 @@ void QCocoaMenuBar::insertMenu(QPlatformMenu *platformMenu, QPlatformMenu *befor #endif if (m_menus.contains(menu)) { - qWarning() << Q_FUNC_INFO << "This menu already belongs to the menubar, remove it first"; + qWarning("This menu already belongs to the menubar, remove it first"); return; } if (beforeMenu && !m_menus.contains(beforeMenu)) { - qWarning() << Q_FUNC_INFO << "The before menu does not belong to the menubar"; + qWarning("The before menu does not belong to the menubar"); return; } @@ -138,7 +138,7 @@ void QCocoaMenuBar::removeMenu(QPlatformMenu *platformMenu) { QCocoaMenu *menu = static_cast(platformMenu); if (!m_menus.contains(menu)) { - qWarning() << Q_FUNC_INFO << "Trying to remove a menu that does not belong to the menubar"; + qWarning("Trying to remove a menu that does not belong to the menubar"); return; } m_menus.removeOne(menu); diff --git a/src/plugins/platforms/cocoa/qcocoamenuitem.mm b/src/plugins/platforms/cocoa/qcocoamenuitem.mm index 0fc1bff325..0f551bcd7d 100644 --- a/src/plugins/platforms/cocoa/qcocoamenuitem.mm +++ b/src/plugins/platforms/cocoa/qcocoamenuitem.mm @@ -281,7 +281,7 @@ NSMenuItem *QCocoaMenuItem::sync() } default: - qWarning() << Q_FUNC_INFO << "menu item" << m_text << "has unsupported role" << (int)m_role; + qWarning() << "menu item" << m_text << "has unsupported role" << (int)m_role; } if (mergeItem) { @@ -398,7 +398,7 @@ QKeySequence QCocoaMenuItem::mergeAccel() void QCocoaMenuItem::syncMerged() { if (!m_merged) { - qWarning() << Q_FUNC_INFO << "Trying to sync a non-merged item"; + qWarning("Trying to sync a non-merged item"); return; } [m_native setTag:reinterpret_cast(this)]; diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index a545dbddd5..5a59a842c6 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -1523,7 +1523,7 @@ void QCocoaWindow::syncWindowState(Qt::WindowState newState) // do nothing except set the new state NSRect contentRect = [contentView() frame]; if (contentRect.size.width <= 0 || contentRect.size.height <= 0) { - qWarning() << Q_FUNC_INFO << "invalid window content view size, check your window geometry"; + qWarning("invalid window content view size, check your window geometry"); m_synchedWindowState = newState; return; } diff --git a/src/plugins/platforms/qnx/qqnxabstractnavigator.cpp b/src/plugins/platforms/qnx/qqnxabstractnavigator.cpp index 985cc14b1d..7bec1fb603 100644 --- a/src/plugins/platforms/qnx/qqnxabstractnavigator.cpp +++ b/src/plugins/platforms/qnx/qqnxabstractnavigator.cpp @@ -62,7 +62,7 @@ bool QQnxAbstractNavigator::invokeUrl(const QUrl &url) // which is not recognized by the navigator anymore const bool result = requestInvokeUrl(url.toString().toUtf8()); - qNavigatorDebug() << Q_FUNC_INFO << "url=" << url << "result=" << result; + qNavigatorDebug() << "url=" << url << "result=" << result; return result; } diff --git a/src/plugins/platforms/qnx/qqnxbpseventfilter.cpp b/src/plugins/platforms/qnx/qqnxbpseventfilter.cpp index 3950681c5e..66843283b6 100644 --- a/src/plugins/platforms/qnx/qqnxbpseventfilter.cpp +++ b/src/plugins/platforms/qnx/qqnxbpseventfilter.cpp @@ -78,7 +78,7 @@ QQnxBpsEventFilter::~QQnxBpsEventFilter() void QQnxBpsEventFilter::installOnEventDispatcher(QAbstractEventDispatcher *dispatcher) { - qBpsEventFilterDebug() << Q_FUNC_INFO << "dispatcher=" << dispatcher; + qBpsEventFilterDebug() << "dispatcher=" << dispatcher; if (navigator_request_events(NAVIGATOR_EXTENDED_DATA) != BPS_SUCCESS) qWarning("QQNX: failed to register for navigator events"); @@ -125,7 +125,7 @@ bool QQnxBpsEventFilter::nativeEventFilter(const QByteArray &eventType, void *me Q_UNUSED(result); bps_event_t *event = static_cast(message); const int eventDomain = bps_event_get_domain(event); - qBpsEventFilterDebug() << Q_FUNC_INFO << "event=" << event << "domain=" << eventDomain; + qBpsEventFilterDebug() << "event=" << event << "domain=" << eventDomain; if (eventDomain == screen_get_domain()) { if (!m_screenEventHandler) { @@ -151,10 +151,10 @@ bool QQnxBpsEventFilter::handleNavigatorEvent(bps_event_t *event) switch (bps_event_get_code(event)) { case NAVIGATOR_ORIENTATION_CHECK: { const int angle = navigator_event_get_orientation_angle(event); - qBpsEventFilterDebug() << Q_FUNC_INFO << "ORIENTATION CHECK event. angle=" << angle; + qBpsEventFilterDebug() << "ORIENTATION CHECK event. angle=" << angle; const bool result = m_navigatorEventHandler->handleOrientationCheck(angle); - qBpsEventFilterDebug() << Q_FUNC_INFO << "ORIENTATION CHECK event. result=" << result; + qBpsEventFilterDebug() << "ORIENTATION CHECK event. result=" << result; // reply to navigator whether orientation is acceptable navigator_orientation_check_response(event, result); @@ -163,7 +163,7 @@ bool QQnxBpsEventFilter::handleNavigatorEvent(bps_event_t *event) case NAVIGATOR_ORIENTATION: { const int angle = navigator_event_get_orientation_angle(event); - qBpsEventFilterDebug() << Q_FUNC_INFO << "ORIENTATION event. angle=" << angle; + qBpsEventFilterDebug() << "ORIENTATION event. angle=" << angle; m_navigatorEventHandler->handleOrientationChange(angle); navigator_done_orientation(event); @@ -171,17 +171,17 @@ bool QQnxBpsEventFilter::handleNavigatorEvent(bps_event_t *event) } case NAVIGATOR_SWIPE_DOWN: - qBpsEventFilterDebug() << Q_FUNC_INFO << "SWIPE DOWN event"; + qBpsEventFilterDebug("SWIPE DOWN event"); m_navigatorEventHandler->handleSwipeDown(); break; case NAVIGATOR_EXIT: - qBpsEventFilterDebug() << Q_FUNC_INFO << "EXIT event"; + qBpsEventFilterDebug("EXIT event"); m_navigatorEventHandler->handleExit(); break; case NAVIGATOR_WINDOW_STATE: { - qBpsEventFilterDebug() << Q_FUNC_INFO << "WINDOW STATE event"; + qBpsEventFilterDebug("WINDOW STATE event"); const navigator_window_state_t state = navigator_event_get_window_state(event); const QByteArray id(navigator_event_get_groupid(event)); @@ -200,14 +200,14 @@ bool QQnxBpsEventFilter::handleNavigatorEvent(bps_event_t *event) } case NAVIGATOR_WINDOW_ACTIVE: { - qBpsEventFilterDebug() << Q_FUNC_INFO << "WINDOW ACTIVE event"; + qBpsEventFilterDebug("WINDOW ACTIVE event"); const QByteArray id(navigator_event_get_groupid(event)); m_navigatorEventHandler->handleWindowGroupActivated(id); break; } case NAVIGATOR_WINDOW_INACTIVE: { - qBpsEventFilterDebug() << Q_FUNC_INFO << "WINDOW INACTIVE event"; + qBpsEventFilterDebug("WINDOW INACTIVE event"); const QByteArray id(navigator_event_get_groupid(event)); m_navigatorEventHandler->handleWindowGroupDeactivated(id); break; @@ -219,7 +219,7 @@ bool QQnxBpsEventFilter::handleNavigatorEvent(bps_event_t *event) return false; default: - qBpsEventFilterDebug() << Q_FUNC_INFO << "Unhandled navigator event. code=" << bps_event_get_code(event); + qBpsEventFilterDebug() << "Unhandled navigator event. code=" << bps_event_get_code(event); return false; } diff --git a/src/plugins/platforms/qnx/qqnxbuffer.cpp b/src/plugins/platforms/qnx/qqnxbuffer.cpp index 2c3a42ac7c..7ee6664676 100644 --- a/src/plugins/platforms/qnx/qqnxbuffer.cpp +++ b/src/plugins/platforms/qnx/qqnxbuffer.cpp @@ -51,13 +51,13 @@ QT_BEGIN_NAMESPACE QQnxBuffer::QQnxBuffer() : m_buffer(0) { - qBufferDebug() << Q_FUNC_INFO << "empty"; + qBufferDebug("empty"); } QQnxBuffer::QQnxBuffer(screen_buffer_t buffer) : m_buffer(buffer) { - qBufferDebug() << Q_FUNC_INFO << "normal"; + qBufferDebug("normal"); // Get size of buffer int size[2]; @@ -118,17 +118,17 @@ QQnxBuffer::QQnxBuffer(const QQnxBuffer &other) : m_buffer(other.m_buffer), m_image(other.m_image) { - qBufferDebug() << Q_FUNC_INFO << "copy"; + qBufferDebug("copy"); } QQnxBuffer::~QQnxBuffer() { - qBufferDebug() << Q_FUNC_INFO; + qBufferDebug(); } void QQnxBuffer::invalidateInCache() { - qBufferDebug() << Q_FUNC_INFO; + qBufferDebug(); // Verify native buffer exists if (m_buffer == 0) diff --git a/src/plugins/platforms/qnx/qqnxbuttoneventnotifier.cpp b/src/plugins/platforms/qnx/qqnxbuttoneventnotifier.cpp index ae3153336f..614bfc381f 100644 --- a/src/plugins/platforms/qnx/qqnxbuttoneventnotifier.cpp +++ b/src/plugins/platforms/qnx/qqnxbuttoneventnotifier.cpp @@ -74,7 +74,7 @@ QQnxButtonEventNotifier::~QQnxButtonEventNotifier() void QQnxButtonEventNotifier::start() { - qButtonDebug() << Q_FUNC_INFO << "starting hardware button event processing"; + qButtonDebug("starting hardware button event processing"); if (m_fd != -1) return; @@ -91,7 +91,7 @@ void QQnxButtonEventNotifier::start() m_readNotifier = new QSocketNotifier(m_fd, QSocketNotifier::Read); QObject::connect(m_readNotifier, SIGNAL(activated(int)), this, SLOT(updateButtonStates())); - qButtonDebug() << Q_FUNC_INFO << "successfully connected to Navigator. fd =" << m_fd; + qButtonDebug() << "successfully connected to Navigator. fd =" << m_fd; } void QQnxButtonEventNotifier::updateButtonStates() @@ -115,7 +115,7 @@ void QQnxButtonEventNotifier::updateButtonStates() // Ensure data is null terminated buffer[bytes] = '\0'; - qButtonDebug() << Q_FUNC_INFO << "received PPS message:\n" << buffer; + qButtonDebug() << "received PPS message:\n" << buffer; // Process received message QByteArray ppsData = QByteArray::fromRawData(buffer, bytes); @@ -197,7 +197,7 @@ bool QQnxButtonEventNotifier::parsePPS(const QByteArray &ppsData, QHashtype()) { case QEvent::CloseSoftwareInputPanel: @@ -692,19 +692,19 @@ QRectF QQnxInputContext::keyboardRect() const void QQnxInputContext::reset() { - qInputContextDebug() << Q_FUNC_INFO; + qInputContextDebug(); endComposition(); } void QQnxInputContext::commit() { - qInputContextDebug() << Q_FUNC_INFO; + qInputContextDebug(); endComposition(); } void QQnxInputContext::update(Qt::InputMethodQueries queries) { - qInputContextDebug() << Q_FUNC_INFO << queries; + qInputContextDebug() << queries; if (queries & Qt::ImCursorPosition) { int lastCaret = m_caretPosition; @@ -716,7 +716,7 @@ void QQnxInputContext::update(Qt::InputMethodQueries queries) initEvent(&caretEvent.event, sInputSession, EVENT_CARET, CARET_POS_CHANGED, sizeof(caretEvent)); caretEvent.old_pos = lastCaret; caretEvent.new_pos = m_caretPosition; - qInputContextDebug() << Q_FUNC_INFO << "ictrl_dispatch_event caret changed" << lastCaret << m_caretPosition; + qInputContextDebug() << "ictrl_dispatch_event caret changed" << lastCaret << m_caretPosition; p_ictrl_dispatch_event(&caretEvent.event); } } @@ -724,7 +724,7 @@ void QQnxInputContext::update(Qt::InputMethodQueries queries) void QQnxInputContext::closeSession() { - qInputContextDebug() << Q_FUNC_INFO; + qInputContextDebug(); if (!imfAvailable()) return; @@ -746,7 +746,7 @@ bool QQnxInputContext::openSession() closeSession(); sInputSession = p_ictrl_open_session(&ic_funcs); - qInputContextDebug() << Q_FUNC_INFO; + qInputContextDebug(); return sInputSession != 0; } @@ -770,7 +770,7 @@ bool QQnxInputContext::hasSelectedText() bool QQnxInputContext::dispatchRequestSoftwareInputPanel() { - qInputContextDebug() << Q_FUNC_INFO << "requesting keyboard" << m_inputPanelVisible; + qInputContextDebug() << "requesting keyboard" << m_inputPanelVisible; m_virtualKeyboard.showKeyboard(); return true; @@ -778,7 +778,7 @@ bool QQnxInputContext::dispatchRequestSoftwareInputPanel() bool QQnxInputContext::dispatchCloseSoftwareInputPanel() { - qInputContextDebug() << Q_FUNC_INFO << "hiding keyboard" << m_inputPanelVisible; + qInputContextDebug() << "hiding keyboard" << m_inputPanelVisible; m_virtualKeyboard.hideKeyboard(); return true; @@ -824,7 +824,7 @@ bool QQnxInputContext::dispatchFocusGainEvent(int inputHints) focusEvent.style |= IMF_EMAIL_TYPE; } - qInputContextDebug() << Q_FUNC_INFO << "ictrl_dispatch_event focus gain style:" << focusEvent.style; + qInputContextDebug() << "ictrl_dispatch_event focus gain style:" << focusEvent.style; p_ictrl_dispatch_event((event_t *)&focusEvent); @@ -834,7 +834,7 @@ bool QQnxInputContext::dispatchFocusGainEvent(int inputHints) void QQnxInputContext::dispatchFocusLossEvent() { if (hasSession()) { - qInputContextDebug() << Q_FUNC_INFO << "ictrl_dispatch_event focus lost"; + qInputContextDebug("ictrl_dispatch_event focus lost"); focus_event_t focusEvent; initEvent(&focusEvent.event, sInputSession, EVENT_FOCUS, FOCUS_LOST, sizeof(focusEvent)); @@ -909,7 +909,7 @@ bool QQnxInputContext::handleKeyboardEvent(int flags, int sym, int mod, int scan navigation_event_t navEvent; initEvent(&navEvent.event, sInputSession, EVENT_NAVIGATION, key, sizeof(navEvent)); navEvent.magnitude = 1; - qInputContextDebug() << Q_FUNC_INFO << "ictrl_dispatch_even navigation" << key; + qInputContextDebug() << "ictrl_dispatch_even navigation" << key; p_ictrl_dispatch_event(&navEvent.event); } } else { @@ -922,7 +922,7 @@ bool QQnxInputContext::handleKeyboardEvent(int flags, int sym, int mod, int scan keyEvent.sequence_id = sequenceId; p_ictrl_dispatch_event(&keyEvent.event); - qInputContextDebug() << Q_FUNC_INFO << "ictrl_dispatch_even key" << key; + qInputContextDebug() << "ictrl_dispatch_even key" << key; } return true; @@ -938,7 +938,7 @@ void QQnxInputContext::updateCursorPosition() QCoreApplication::sendEvent(input, &query); m_caretPosition = query.value(Qt::ImCursorPosition).toInt(); - qInputContextDebug() << Q_FUNC_INFO << m_caretPosition; + qInputContextDebug() << m_caretPosition; } void QQnxInputContext::endComposition() @@ -951,7 +951,7 @@ void QQnxInputContext::endComposition() if (hasSession()) { action_event_t actionEvent; initEvent(&actionEvent.event, sInputSession, EVENT_ACTION, ACTION_END_COMPOSITION, sizeof(actionEvent)); - qInputContextDebug() << Q_FUNC_INFO << "ictrl_dispatch_even end composition"; + qInputContextDebug("ictrl_dispatch_even end composition"); p_ictrl_dispatch_event(&actionEvent.event); } } @@ -968,7 +968,7 @@ void QQnxInputContext::updateComposition(spannable_string_t *text, int32_t new_c m_composingText = QString::fromWCharArray(text->str, text->length); m_isComposing = true; - qInputContextDebug() << Q_FUNC_INFO << m_composingText << new_cursor_position; + qInputContextDebug() << m_composingText << new_cursor_position; QList attributes; attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, @@ -1017,7 +1017,7 @@ void QQnxInputContext::finishComposingText() QObject *input = qGuiApp->focusObject(); if (input) { - qInputContextDebug() << Q_FUNC_INFO << m_composingText; + qInputContextDebug() << m_composingText; QInputMethodEvent event; event.setCommitString(m_composingText); @@ -1082,13 +1082,13 @@ int32_t QQnxInputContext::processEvent(event_t *event) int32_t result = -1; switch (event->event_type) { case EVENT_SPELL_CHECK: { - qInputContextDebug() << Q_FUNC_INFO << "EVENT_SPELL_CHECK"; + qInputContextDebug("EVENT_SPELL_CHECK"); result = handleSpellCheck(reinterpret_cast(event)); break; } case EVENT_NAVIGATION: { - qInputContextDebug() << Q_FUNC_INFO << "EVENT_NAVIGATION"; + qInputContextDebug("EVENT_NAVIGATION"); int key = event->event_id == NAVIGATE_UP ? KEYCODE_UP : event->event_id == NAVIGATE_DOWN ? KEYCODE_DOWN : @@ -1111,7 +1111,7 @@ int32_t QQnxInputContext::processEvent(event_t *event) int flags = KEY_SYM_VALID | KEY_CAP_VALID; if (event->event_id == IMF_KEY_DOWN) flags |= KEY_DOWN; - qInputContextDebug() << Q_FUNC_INFO << "EVENT_KEY" << flags << keySym; + qInputContextDebug() << "EVENT_KEY" << flags << keySym; QQnxScreenEventHandler::injectKeyboardEvent(flags, keySym, modifiers, 0, keyCap); result = 0; break; @@ -1127,10 +1127,10 @@ int32_t QQnxInputContext::processEvent(event_t *event) case EVENT_USER_ACTION: case EVENT_STROKE: case EVENT_INVOKE_LATER: - qCritical() << Q_FUNC_INFO << "Unsupported event type: " << event->event_type; + qCritical() << "Unsupported event type: " << event->event_type; break; default: - qCritical() << Q_FUNC_INFO << "Unknown event type: " << event->event_type; + qCritical() << "Unknown event type: " << event->event_type; } return result; } @@ -1151,7 +1151,7 @@ int32_t QQnxInputContext::onCommitText(spannable_string_t *text, int32_t new_cur int32_t QQnxInputContext::onDeleteSurroundingText(int32_t left_length, int32_t right_length) { - qInputContextDebug() << Q_FUNC_INFO << "L:" << left_length << " R:" << right_length; + qInputContextDebug() << "L:" << left_length << " R:" << right_length; QObject *input = qGuiApp->focusObject(); if (!input) @@ -1182,7 +1182,7 @@ int32_t QQnxInputContext::onFinishComposingText() int32_t QQnxInputContext::onGetCursorPosition() { - qInputContextDebug() << Q_FUNC_INFO; + qInputContextDebug(); QObject *input = qGuiApp->focusObject(); if (!input) @@ -1196,7 +1196,7 @@ int32_t QQnxInputContext::onGetCursorPosition() spannable_string_t *QQnxInputContext::onGetTextAfterCursor(int32_t n, int32_t flags) { Q_UNUSED(flags); - qInputContextDebug() << Q_FUNC_INFO; + qInputContextDebug(); QObject *input = qGuiApp->focusObject(); if (!input) @@ -1213,7 +1213,7 @@ spannable_string_t *QQnxInputContext::onGetTextAfterCursor(int32_t n, int32_t fl spannable_string_t *QQnxInputContext::onGetTextBeforeCursor(int32_t n, int32_t flags) { Q_UNUSED(flags); - qInputContextDebug() << Q_FUNC_INFO; + qInputContextDebug(); QObject *input = qGuiApp->focusObject(); if (!input) @@ -1232,7 +1232,7 @@ spannable_string_t *QQnxInputContext::onGetTextBeforeCursor(int32_t n, int32_t f int32_t QQnxInputContext::onSendEvent(event_t *event) { - qInputContextDebug() << Q_FUNC_INFO; + qInputContextDebug(); return processEvent(event); } @@ -1248,7 +1248,7 @@ int32_t QQnxInputContext::onSetComposingRegion(int32_t start, int32_t end) QString text = query.value(Qt::ImSurroundingText).toString(); m_caretPosition = query.value(Qt::ImCursorPosition).toInt(); - qInputContextDebug() << Q_FUNC_INFO << text; + qInputContextDebug() << text; m_isUpdatingText = true; @@ -1291,7 +1291,7 @@ int32_t QQnxInputContext::onIsTextSelected(int32_t* pIsSelected) { *pIsSelected = hasSelectedText(); - qInputContextDebug() << Q_FUNC_INFO << *pIsSelected; + qInputContextDebug() << *pIsSelected; return 0; } @@ -1307,20 +1307,20 @@ int32_t QQnxInputContext::onIsAllTextSelected(int32_t* pIsSelected) *pIsSelected = query.value(Qt::ImSurroundingText).toString().length() == query.value(Qt::ImCurrentSelection).toString().length(); - qInputContextDebug() << Q_FUNC_INFO << *pIsSelected; + qInputContextDebug() << *pIsSelected; return 0; } void QQnxInputContext::showInputPanel() { - qInputContextDebug() << Q_FUNC_INFO; + qInputContextDebug(); dispatchRequestSoftwareInputPanel(); } void QQnxInputContext::hideInputPanel() { - qInputContextDebug() << Q_FUNC_INFO; + qInputContextDebug(); dispatchCloseSoftwareInputPanel(); } @@ -1336,7 +1336,7 @@ QLocale QQnxInputContext::locale() const void QQnxInputContext::keyboardVisibilityChanged(bool visible) { - qInputContextDebug() << Q_FUNC_INFO << "visible=" << visible; + qInputContextDebug() << "visible=" << visible; if (m_inputPanelVisible != visible) { m_inputPanelVisible = visible; emitInputPanelVisibleChanged(); @@ -1345,7 +1345,7 @@ void QQnxInputContext::keyboardVisibilityChanged(bool visible) void QQnxInputContext::keyboardLocaleChanged(const QLocale &locale) { - qInputContextDebug() << Q_FUNC_INFO << "locale=" << locale; + qInputContextDebug() << "locale=" << locale; if (m_inputPanelLocale != locale) { m_inputPanelLocale = locale; emitLocaleChanged(); @@ -1354,7 +1354,7 @@ void QQnxInputContext::keyboardLocaleChanged(const QLocale &locale) void QQnxInputContext::setHighlightColor(int index, const QColor &color) { - qInputContextDebug() << Q_FUNC_INFO << "setHighlightColor" << index << color << qGuiApp->focusObject(); + qInputContextDebug() << "setHighlightColor" << index << color << qGuiApp->focusObject(); if (!sInputContextInstance) return; @@ -1373,7 +1373,7 @@ void QQnxInputContext::setHighlightColor(int index, const QColor &color) void QQnxInputContext::setFocusObject(QObject *object) { - qInputContextDebug() << Q_FUNC_INFO << "input item=" << object; + qInputContextDebug() << "input item=" << object; // Ensure the colors are reset if we've a change in focus object setHighlightColor(-1, QColor()); @@ -1403,7 +1403,7 @@ void QQnxInputContext::setFocusObject(QObject *object) bool QQnxInputContext::checkSpelling(const QString &text, void *context, void (*spellCheckDone)(void *context, const QString &text, const QList &indices)) { - qInputContextDebug() << Q_FUNC_INFO << "text" << text; + qInputContextDebug() << "text" << text; if (!imfAvailable()) return false; diff --git a/src/plugins/platforms/qnx/qqnxinputcontext_noimf.cpp b/src/plugins/platforms/qnx/qqnxinputcontext_noimf.cpp index 3860cdf0db..af280f5c6f 100644 --- a/src/plugins/platforms/qnx/qqnxinputcontext_noimf.cpp +++ b/src/plugins/platforms/qnx/qqnxinputcontext_noimf.cpp @@ -88,13 +88,13 @@ bool QQnxInputContext::filterEvent( const QEvent *event ) if (event->type() == QEvent::CloseSoftwareInputPanel) { m_virtualKeyboard.hideKeyboard(); - qInputContextDebug() << Q_FUNC_INFO << "hiding virtual keyboard"; + qInputContextDebug("hiding virtual keyboard"); return false; } if (event->type() == QEvent::RequestSoftwareInputPanel) { m_virtualKeyboard.showKeyboard(); - qInputContextDebug() << Q_FUNC_INFO << "requesting virtual keyboard"; + qInputContextDebug("requesting virtual keyboard"); return false; } @@ -121,13 +121,13 @@ bool QQnxInputContext::handleKeyboardEvent(int flags, int sym, int mod, int scan void QQnxInputContext::showInputPanel() { - qInputContextDebug() << Q_FUNC_INFO; + qInputContextDebug(); m_virtualKeyboard.showKeyboard(); } void QQnxInputContext::hideInputPanel() { - qInputContextDebug() << Q_FUNC_INFO; + qInputContextDebug(); m_virtualKeyboard.hideKeyboard(); } @@ -148,7 +148,7 @@ void QQnxInputContext::keyboardHeightChanged() void QQnxInputContext::keyboardVisibilityChanged(bool visible) { - qInputContextDebug() << Q_FUNC_INFO << "visible=" << visible; + qInputContextDebug() << "visible=" << visible; if (m_inputPanelVisible != visible) { m_inputPanelVisible = visible; emitInputPanelVisibleChanged(); @@ -157,7 +157,7 @@ void QQnxInputContext::keyboardVisibilityChanged(bool visible) void QQnxInputContext::keyboardLocaleChanged(const QLocale &locale) { - qInputContextDebug() << Q_FUNC_INFO << "locale=" << locale; + qInputContextDebug() << "locale=" << locale; if (m_inputPanelLocale != locale) { m_inputPanelLocale = locale; emitLocaleChanged(); @@ -166,7 +166,7 @@ void QQnxInputContext::keyboardLocaleChanged(const QLocale &locale) void QQnxInputContext::setFocusObject(QObject *object) { - qInputContextDebug() << Q_FUNC_INFO << "input item=" << object; + qInputContextDebug() << "input item=" << object; if (!inputMethodAccepted()) { if (m_inputPanelVisible) diff --git a/src/plugins/platforms/qnx/qqnxintegration.cpp b/src/plugins/platforms/qnx/qqnxintegration.cpp index 1c825dbbdd..6548c82310 100644 --- a/src/plugins/platforms/qnx/qqnxintegration.cpp +++ b/src/plugins/platforms/qnx/qqnxintegration.cpp @@ -164,7 +164,7 @@ QQnxIntegration::QQnxIntegration(const QStringList ¶mList) #endif { ms_options = parseOptions(paramList); - qIntegrationDebug() << Q_FUNC_INFO; + qIntegrationDebug(); // Open connection to QNX composition manager Q_SCREEN_CRITICALERROR(screen_create_context(&ms_screenContext, SCREEN_APPLICATION_CONTEXT), "Failed to create screen context"); @@ -261,7 +261,7 @@ QQnxIntegration::QQnxIntegration(const QStringList ¶mList) QQnxIntegration::~QQnxIntegration() { - qIntegrationDebug() << Q_FUNC_INFO << "platform plugin shutdown begin"; + qIntegrationDebug("platform plugin shutdown begin"); delete m_nativeInterface; #if !defined(QT_NO_DRAGANDDROP) @@ -325,12 +325,12 @@ QQnxIntegration::~QQnxIntegration() // Destroy navigator interface delete m_navigator; - qIntegrationDebug() << Q_FUNC_INFO << "platform plugin shutdown end"; + qIntegrationDebug("platform plugin shutdown end"); } bool QQnxIntegration::hasCapability(QPlatformIntegration::Capability cap) const { - qIntegrationDebug() << Q_FUNC_INFO; + qIntegrationDebug(); switch (cap) { case MultipleWindows: case ThreadedPixmaps: @@ -348,7 +348,7 @@ bool QQnxIntegration::hasCapability(QPlatformIntegration::Capability cap) const QPlatformWindow *QQnxIntegration::createPlatformWindow(QWindow *window) const { - qIntegrationDebug() << Q_FUNC_INFO; + qIntegrationDebug(); QSurface::SurfaceType surfaceType = window->surfaceType(); const bool needRootWindow = options() & RootWindow; switch (surfaceType) { @@ -366,14 +366,14 @@ QPlatformWindow *QQnxIntegration::createPlatformWindow(QWindow *window) const QPlatformBackingStore *QQnxIntegration::createPlatformBackingStore(QWindow *window) const { - qIntegrationDebug() << Q_FUNC_INFO; + qIntegrationDebug(); return new QQnxRasterBackingStore(window); } #if !defined(QT_NO_OPENGL) QPlatformOpenGLContext *QQnxIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const { - qIntegrationDebug() << Q_FUNC_INFO; + qIntegrationDebug(); return new QQnxGLContext(context); } #endif @@ -381,14 +381,14 @@ QPlatformOpenGLContext *QQnxIntegration::createPlatformOpenGLContext(QOpenGLCont #if defined(QQNX_PPS) QPlatformInputContext *QQnxIntegration::inputContext() const { - qIntegrationDebug() << Q_FUNC_INFO; + qIntegrationDebug(); return m_inputContext; } #endif void QQnxIntegration::moveToScreen(QWindow *window, int screen) { - qIntegrationDebug() << Q_FUNC_INFO << "w =" << window << ", s =" << screen; + qIntegrationDebug() << "w =" << window << ", s =" << screen; // get platform window used by widget QQnxWindow *platformWindow = static_cast(window->handle()); @@ -402,7 +402,7 @@ void QQnxIntegration::moveToScreen(QWindow *window, int screen) QAbstractEventDispatcher *QQnxIntegration::createEventDispatcher() const { - qIntegrationDebug() << Q_FUNC_INFO; + qIntegrationDebug(); // We transfer ownersip of the event-dispatcher to QtCoreApplication QAbstractEventDispatcher *eventDispatcher = m_eventDispatcher; @@ -419,7 +419,7 @@ QPlatformNativeInterface *QQnxIntegration::nativeInterface() const #if !defined(QT_NO_CLIPBOARD) QPlatformClipboard *QQnxIntegration::clipboard() const { - qIntegrationDebug() << Q_FUNC_INFO; + qIntegrationDebug(); #if defined(QQNX_PPS) if (!m_clipboard) @@ -438,7 +438,7 @@ QPlatformDrag *QQnxIntegration::drag() const QVariant QQnxIntegration::styleHint(QPlatformIntegration::StyleHint hint) const { - qIntegrationDebug() << Q_FUNC_INFO; + qIntegrationDebug(); if ((hint == ShowIsFullScreen) && (ms_options & FullScreenApplication)) return true; @@ -458,7 +458,7 @@ QStringList QQnxIntegration::themeNames() const QPlatformTheme *QQnxIntegration::createPlatformTheme(const QString &name) const { - qIntegrationDebug() << Q_FUNC_INFO << "name =" << name; + qIntegrationDebug() << "name =" << name; if (name == QBlackberryTheme::name()) return new QBlackberryTheme(this); return 0; @@ -467,7 +467,7 @@ QPlatformTheme *QQnxIntegration::createPlatformTheme(const QString &name) const QWindow *QQnxIntegration::window(screen_window_t qnxWindow) { - qIntegrationDebug() << Q_FUNC_INFO; + qIntegrationDebug(); QMutexLocker locker(&ms_windowMapperMutex); Q_UNUSED(locker); return ms_windowMapper.value(qnxWindow, 0); @@ -475,7 +475,7 @@ QWindow *QQnxIntegration::window(screen_window_t qnxWindow) void QQnxIntegration::addWindow(screen_window_t qnxWindow, QWindow *window) { - qIntegrationDebug() << Q_FUNC_INFO; + qIntegrationDebug(); QMutexLocker locker(&ms_windowMapperMutex); Q_UNUSED(locker); ms_windowMapper.insert(qnxWindow, window); @@ -483,7 +483,7 @@ void QQnxIntegration::addWindow(screen_window_t qnxWindow, QWindow *window) void QQnxIntegration::removeWindow(screen_window_t qnxWindow) { - qIntegrationDebug() << Q_FUNC_INFO; + qIntegrationDebug(); QMutexLocker locker(&ms_windowMapperMutex); Q_UNUSED(locker); ms_windowMapper.remove(qnxWindow); @@ -491,7 +491,7 @@ void QQnxIntegration::removeWindow(screen_window_t qnxWindow) void QQnxIntegration::createDisplays() { - qIntegrationDebug() << Q_FUNC_INFO; + qIntegrationDebug(); // Query number of displays int displayCount = 0; int result = screen_get_context_property_iv(ms_screenContext, SCREEN_PROPERTY_DISPLAY_COUNT, @@ -520,11 +520,11 @@ void QQnxIntegration::createDisplays() Q_SCREEN_CHECKERROR(result, "Failed to query display attachment"); if (!isAttached) { - qIntegrationDebug() << Q_FUNC_INFO << "Skipping non-attached display" << i; + qIntegrationDebug() << "Skipping non-attached display" << i; continue; } - qIntegrationDebug() << Q_FUNC_INFO << "Creating screen for display" << i; + qIntegrationDebug() << "Creating screen for display" << i; createDisplay(displays[i], /*isPrimary=*/false); } // of displays iteration } @@ -558,7 +558,7 @@ void QQnxIntegration::removeDisplay(QQnxScreen *screen) void QQnxIntegration::destroyDisplays() { - qIntegrationDebug() << Q_FUNC_INFO; + qIntegrationDebug(); Q_FOREACH (QQnxScreen *screen, m_screens) { QPlatformIntegration::destroyScreen(screen); } diff --git a/src/plugins/platforms/qnx/qqnxnavigatorbps.cpp b/src/plugins/platforms/qnx/qqnxnavigatorbps.cpp index 67f936a8dd..0d730d6f57 100644 --- a/src/plugins/platforms/qnx/qqnxnavigatorbps.cpp +++ b/src/plugins/platforms/qnx/qqnxnavigatorbps.cpp @@ -56,7 +56,7 @@ bool QQnxNavigatorBps::requestInvokeUrl(const QByteArray &encodedUrl) int ret = navigator_invoke(encodedUrl, &error); if (error) { - qWarning() << Q_FUNC_INFO << "error=" << error; + qWarning() << "error=" << error; bps_free(error); } diff --git a/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.cpp b/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.cpp index f179719c6b..647c53e32c 100644 --- a/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.cpp +++ b/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.cpp @@ -57,20 +57,20 @@ bool QQnxNavigatorEventHandler::handleOrientationCheck(int angle) { // reply to navigator that (any) orientation is acceptable // TODO: check if top window flags prohibit orientation change - qNavigatorEventHandlerDebug() << Q_FUNC_INFO << "angle=" << angle; + qNavigatorEventHandlerDebug() << "angle=" << angle; return true; } void QQnxNavigatorEventHandler::handleOrientationChange(int angle) { // update screen geometry and reply to navigator that we're ready - qNavigatorEventHandlerDebug() << Q_FUNC_INFO << "angle=" << angle; + qNavigatorEventHandlerDebug() << "angle=" << angle; emit rotationChanged(angle); } void QQnxNavigatorEventHandler::handleSwipeDown() { - qNavigatorEventHandlerDebug() << Q_FUNC_INFO; + qNavigatorEventHandlerDebug(); Q_EMIT swipeDown(); } @@ -78,25 +78,25 @@ void QQnxNavigatorEventHandler::handleSwipeDown() void QQnxNavigatorEventHandler::handleExit() { // shutdown everything - qNavigatorEventHandlerDebug() << Q_FUNC_INFO; + qNavigatorEventHandlerDebug(); QCoreApplication::quit(); } void QQnxNavigatorEventHandler::handleWindowGroupActivated(const QByteArray &id) { - qNavigatorEventHandlerDebug() << Q_FUNC_INFO << id; + qNavigatorEventHandlerDebug() << id; Q_EMIT windowGroupActivated(id); } void QQnxNavigatorEventHandler::handleWindowGroupDeactivated(const QByteArray &id) { - qNavigatorEventHandlerDebug() << Q_FUNC_INFO << id; + qNavigatorEventHandlerDebug() << id; Q_EMIT windowGroupDeactivated(id); } void QQnxNavigatorEventHandler::handleWindowGroupStateChanged(const QByteArray &id, Qt::WindowState state) { - qNavigatorEventHandlerDebug() << Q_FUNC_INFO << id; + qNavigatorEventHandlerDebug() << id; Q_EMIT windowGroupStateChanged(id, state); } diff --git a/src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.cpp b/src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.cpp index aa47b5409b..6199eb8e11 100644 --- a/src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.cpp +++ b/src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.cpp @@ -74,18 +74,18 @@ QQnxNavigatorEventNotifier::~QQnxNavigatorEventNotifier() if (m_fd != -1) close(m_fd); - qNavigatorEventNotifierDebug() << Q_FUNC_INFO << "navigator event notifier stopped"; + qNavigatorEventNotifierDebug("navigator event notifier stopped"); } void QQnxNavigatorEventNotifier::start() { - qNavigatorEventNotifierDebug() << Q_FUNC_INFO << "navigator event notifier started"; + qNavigatorEventNotifierDebug("navigator event notifier started"); // open connection to navigator errno = 0; m_fd = open(navigatorControlPath, O_RDWR); if (m_fd == -1) { - qNavigatorEventNotifierDebug() << Q_FUNC_INFO << ": failed to open navigator pps:" + qNavigatorEventNotifierDebug() << "failed to open navigator pps:" << strerror(errno); return; } @@ -96,7 +96,7 @@ void QQnxNavigatorEventNotifier::start() void QQnxNavigatorEventNotifier::parsePPS(const QByteArray &ppsData, QByteArray &msg, QByteArray &dat, QByteArray &id) { - qNavigatorEventNotifierDebug() << Q_FUNC_INFO << "data=" << ppsData; + qNavigatorEventNotifierDebug() << "data=" << ppsData; // tokenize pps data into lines QList lines = ppsData.split('\n'); @@ -110,7 +110,7 @@ void QQnxNavigatorEventNotifier::parsePPS(const QByteArray &ppsData, QByteArray // tokenize current attribute const QByteArray &attr = lines.at(i); - qNavigatorEventNotifierDebug() << Q_FUNC_INFO << "attr=" << attr; + qNavigatorEventNotifierDebug() << "attr=" << attr; int firstColon = attr.indexOf(':'); if (firstColon == -1) { @@ -127,8 +127,8 @@ void QQnxNavigatorEventNotifier::parsePPS(const QByteArray &ppsData, QByteArray QByteArray key = attr.left(firstColon); QByteArray value = attr.mid(secondColon + 1); - qNavigatorEventNotifierDebug() << Q_FUNC_INFO << "key=" << key; - qNavigatorEventNotifierDebug() << Q_FUNC_INFO << "val=" << value; + qNavigatorEventNotifierDebug() << "key=" << key; + qNavigatorEventNotifierDebug() << "val=" << value; // save attribute value if (key == "msg") @@ -155,7 +155,7 @@ void QQnxNavigatorEventNotifier::replyPPS(const QByteArray &res, const QByteArra } ppsData += "\n"; - qNavigatorEventNotifierDebug() << Q_FUNC_INFO << "reply=" << ppsData; + qNavigatorEventNotifierDebug() << "reply=" << ppsData; // send pps message to navigator errno = 0; @@ -166,7 +166,7 @@ void QQnxNavigatorEventNotifier::replyPPS(const QByteArray &res, const QByteArra void QQnxNavigatorEventNotifier::handleMessage(const QByteArray &msg, const QByteArray &dat, const QByteArray &id) { - qNavigatorEventNotifierDebug() << Q_FUNC_INFO << "msg=" << msg << ", dat=" << dat << ", id=" << id; + qNavigatorEventNotifierDebug() << "msg=" << msg << ", dat=" << dat << ", id=" << id; // check message type if (msg == "orientationCheck") { @@ -190,7 +190,7 @@ void QQnxNavigatorEventNotifier::handleMessage(const QByteArray &msg, const QByt void QQnxNavigatorEventNotifier::readData() { - qNavigatorEventNotifierDebug() << Q_FUNC_INFO << "reading navigator data"; + qNavigatorEventNotifierDebug("reading navigator data"); // allocate buffer for pps data char buffer[ppsBufferSize]; diff --git a/src/plugins/platforms/qnx/qqnxnavigatorpps.cpp b/src/plugins/platforms/qnx/qqnxnavigatorpps.cpp index c3b088ae5f..b139471669 100644 --- a/src/plugins/platforms/qnx/qqnxnavigatorpps.cpp +++ b/src/plugins/platforms/qnx/qqnxnavigatorpps.cpp @@ -73,7 +73,7 @@ bool QQnxNavigatorPps::openPpsConnection() return false; } - qNavigatorDebug() << Q_FUNC_INFO << "successfully connected to Navigator. fd=" << m_fd; + qNavigatorDebug() << "successfully connected to Navigator. fd=" << m_fd; return true; } @@ -95,7 +95,7 @@ bool QQnxNavigatorPps::sendPpsMessage(const QByteArray &message, const QByteArra ppsMessage += "\n"; - qNavigatorDebug() << Q_FUNC_INFO << "sending PPS message:\n" << ppsMessage; + qNavigatorDebug() << "sending PPS message:\n" << ppsMessage; // send pps message to navigator errno = 0; @@ -117,7 +117,7 @@ bool QQnxNavigatorPps::sendPpsMessage(const QByteArray &message, const QByteArra // ensure data is null terminated buffer[bytes] = '\0'; - qNavigatorDebug() << Q_FUNC_INFO << "received PPS message:\n" << buffer; + qNavigatorDebug() << "received PPS message:\n" << buffer; // process received message QByteArray ppsData(buffer); @@ -136,7 +136,7 @@ bool QQnxNavigatorPps::sendPpsMessage(const QByteArray &message, const QByteArra void QQnxNavigatorPps::parsePPS(const QByteArray &ppsData, QHash &messageFields) { - qNavigatorDebug() << Q_FUNC_INFO << "data=" << ppsData; + qNavigatorDebug() << "data=" << ppsData; // tokenize pps data into lines QList lines = ppsData.split('\n'); @@ -151,7 +151,7 @@ void QQnxNavigatorPps::parsePPS(const QByteArray &ppsData, QHashscreenForNative(nativeDisplay); if (!screen) { @@ -598,7 +598,7 @@ void QQnxScreenEventHandler::handlePropertyEvent(screen_event_t event) break; default: // event ignored - qScreenEventDebug() << Q_FUNC_INFO << "Ignore property event for property: " << property; + qScreenEventDebug() << "Ignore property event for property: " << property; } } diff --git a/src/plugins/platforms/qnx/qqnxscreeneventthread.cpp b/src/plugins/platforms/qnx/qqnxscreeneventthread.cpp index e0801a2d60..a7d5c4d4bc 100644 --- a/src/plugins/platforms/qnx/qqnxscreeneventthread.cpp +++ b/src/plugins/platforms/qnx/qqnxscreeneventthread.cpp @@ -84,7 +84,7 @@ void QQnxScreenEventThread::unlock() void QQnxScreenEventThread::run() { - qScreenEventThreadDebug() << Q_FUNC_INFO << "screen event thread started"; + qScreenEventThreadDebug("screen event thread started"); int errorCounter = 0; // loop indefinitely @@ -117,7 +117,7 @@ void QQnxScreenEventThread::run() if (qnxType == SCREEN_EVENT_USER) { // treat all user events as shutdown requests - qScreenEventThreadDebug() << Q_FUNC_INFO << "QNX user screen event"; + qScreenEventThreadDebug("QNX user screen event"); m_quit = true; } else { m_mutex.lock(); @@ -127,7 +127,7 @@ void QQnxScreenEventThread::run() } } - qScreenEventThreadDebug() << Q_FUNC_INFO << "screen event thread stopped"; + qScreenEventThreadDebug("screen event thread stopped"); // cleanup m_mutex.lock(); @@ -160,10 +160,10 @@ void QQnxScreenEventThread::shutdown() // cleanup screen_destroy_event(event); - qScreenEventThreadDebug() << Q_FUNC_INFO << "screen event thread shutdown begin"; + qScreenEventThreadDebug("screen event thread shutdown begin"); // block until thread terminates wait(); - qScreenEventThreadDebug() << Q_FUNC_INFO << "screen event thread shutdown end"; + qScreenEventThreadDebug("screen event thread shutdown end"); } diff --git a/src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp b/src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp index 3d749b486d..b55ae842ed 100644 --- a/src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp +++ b/src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp @@ -80,7 +80,7 @@ bool QQnxVirtualKeyboardBps::handleEvent(bps_event_t *event) bool QQnxVirtualKeyboardBps::showKeyboard() { - qVirtualKeyboardDebug() << Q_FUNC_INFO << "current visibility=" << isVisible(); + qVirtualKeyboardDebug() << "current visibility=" << isVisible(); // They keyboard's mode is global between applications, we have to set it each time if ( !isVisible() ) @@ -92,7 +92,7 @@ bool QQnxVirtualKeyboardBps::showKeyboard() bool QQnxVirtualKeyboardBps::hideKeyboard() { - qVirtualKeyboardDebug() << Q_FUNC_INFO << "current visibility=" << isVisible(); + qVirtualKeyboardDebug() << "current visibility=" << isVisible(); virtualkeyboard_hide(); return true; } @@ -102,7 +102,7 @@ void QQnxVirtualKeyboardBps::applyKeyboardOptions() virtualkeyboard_layout_t layout = keyboardLayout(); virtualkeyboard_enter_t enter = enterKey(); - qVirtualKeyboardDebug() << Q_FUNC_INFO << "mode=" << keyboardMode() << "enterKey=" << enterKeyType(); + qVirtualKeyboardDebug() << "mode=" << keyboardMode() << "enterKey=" << enterKeyType(); virtualkeyboard_change_options(layout, enter); } @@ -176,12 +176,12 @@ bool QQnxVirtualKeyboardBps::handleLocaleEvent(bps_event_t *event) const QString country = QString::fromLatin1(locale_event_get_country(event)); const QLocale newLocale(language + QLatin1Char('_') + country); - qVirtualKeyboardDebug() << Q_FUNC_INFO << "current locale" << locale() << "new locale=" << newLocale; + qVirtualKeyboardDebug() << "current locale" << locale() << "new locale=" << newLocale; setLocale(newLocale); return true; } - qVirtualKeyboardDebug() << Q_FUNC_INFO << "Unhandled locale event. code=" << bps_event_get_code(event); + qVirtualKeyboardDebug() << "Unhandled locale event. code=" << bps_event_get_code(event); return false; } @@ -190,24 +190,24 @@ bool QQnxVirtualKeyboardBps::handleVirtualKeyboardEvent(bps_event_t *event) { switch (bps_event_get_code(event)) { case VIRTUALKEYBOARD_EVENT_VISIBLE: - qVirtualKeyboardDebug() << Q_FUNC_INFO << "EVENT VISIBLE: current visibility=" << isVisible(); + qVirtualKeyboardDebug() << "EVENT VISIBLE: current visibility=" << isVisible(); setVisible(true); break; case VIRTUALKEYBOARD_EVENT_HIDDEN: - qVirtualKeyboardDebug() << Q_FUNC_INFO << "EVENT HIDDEN: current visibility=" << isVisible(); + qVirtualKeyboardDebug() << "EVENT HIDDEN: current visibility=" << isVisible(); setVisible(false); break; case VIRTUALKEYBOARD_EVENT_INFO: { const int newHeight = virtualkeyboard_event_get_height(event); - qVirtualKeyboardDebug() << Q_FUNC_INFO << "EVENT INFO: current height=" << height() << "new height=" << newHeight; + qVirtualKeyboardDebug() << "EVENT INFO: current height=" << height() << "new height=" << newHeight; setHeight(newHeight); break; } default: - qVirtualKeyboardDebug() << Q_FUNC_INFO << "Unhandled virtual keyboard event. code=" << bps_event_get_code(event); + qVirtualKeyboardDebug() << "Unhandled virtual keyboard event. code=" << bps_event_get_code(event); return false; } diff --git a/src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp b/src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp index 2c7a28e835..d5a9a49ac6 100644 --- a/src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp +++ b/src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp @@ -75,7 +75,7 @@ QQnxVirtualKeyboardPps::~QQnxVirtualKeyboardPps() void QQnxVirtualKeyboardPps::start() { - qVirtualKeyboardDebug() << Q_FUNC_INFO << "starting keyboard event processing"; + qVirtualKeyboardDebug("starting keyboard event processing"); if (!connect()) return; } @@ -120,7 +120,7 @@ bool QQnxVirtualKeyboardPps::connect() m_fd = ::open(ms_PPSPath, O_RDWR); if (m_fd == -1) { - qVirtualKeyboardDebug() << Q_FUNC_INFO << ": Unable to open" << ms_PPSPath + qVirtualKeyboardDebug() << "Unable to open" << ms_PPSPath << ':' << strerror(errno); close(); return false; @@ -158,7 +158,7 @@ void QQnxVirtualKeyboardPps::ppsDataReady() { ssize_t nread = qt_safe_read(m_fd, m_buffer, ms_bufferSize - 1); - qVirtualKeyboardDebug() << Q_FUNC_INFO << "keyboardMessage size: " << nread; + qVirtualKeyboardDebug() << "keyboardMessage size: " << nread; if (nread < 0){ connect(); // reconnect return; @@ -197,7 +197,7 @@ void QQnxVirtualKeyboardPps::ppsDataReady() else if (strcmp(value, "info") == 0) handleKeyboardInfoMessage(); else if (strcmp(value, "connect") == 0) - qVirtualKeyboardDebug() << Q_FUNC_INFO << "Unhandled command 'connect'"; + qVirtualKeyboardDebug("Unhandled command 'connect'"); else qCritical("QQnxVirtualKeyboard: Unexpected keyboard PPS msg value: %s", value ? value : "[null]"); } else if (pps_decoder_get_string(m_decoder, "res", &value) == PPS_DECODER_OK) { @@ -224,12 +224,12 @@ void QQnxVirtualKeyboardPps::handleKeyboardInfoMessage() } setHeight(newHeight); - qVirtualKeyboardDebug() << Q_FUNC_INFO << "size=" << newHeight; + qVirtualKeyboardDebug() << "size=" << newHeight; } bool QQnxVirtualKeyboardPps::showKeyboard() { - qVirtualKeyboardDebug() << Q_FUNC_INFO; + qVirtualKeyboardDebug(); if (!prepareToSend()) return false; @@ -251,7 +251,7 @@ bool QQnxVirtualKeyboardPps::showKeyboard() bool QQnxVirtualKeyboardPps::hideKeyboard() { - qVirtualKeyboardDebug() << Q_FUNC_INFO; + qVirtualKeyboardDebug(); if (!prepareToSend()) return false; diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp index 3f92bcbc01..4dc1248bd1 100644 --- a/src/plugins/platforms/qnx/qqnxwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxwindow.cpp @@ -156,7 +156,7 @@ QQnxWindow::QQnxWindow(QWindow *window, screen_context_t context, bool needRootW m_windowState(Qt::WindowNoState), m_mmRendererWindow(0) { - qWindowDebug() << Q_FUNC_INFO << "window =" << window << ", size =" << window->size(); + qWindowDebug() << "window =" << window << ", size =" << window->size(); QQnxScreen *platformScreen = static_cast(window->screen()->handle()); @@ -215,7 +215,7 @@ QQnxWindow::QQnxWindow(QWindow *window, screen_context_t context, bool needRootW QQnxWindow::~QQnxWindow() { - qWindowDebug() << Q_FUNC_INFO << "window =" << window(); + qWindowDebug() << "window =" << window(); // Qt should have already deleted the children before deleting the parent. Q_ASSERT(m_childWindows.size() == 0); @@ -247,7 +247,7 @@ void QQnxWindow::setGeometry(const QRect &rect) void QQnxWindow::setGeometryHelper(const QRect &rect) { - qWindowDebug() << Q_FUNC_INFO << "window =" << window() + qWindowDebug() << "window =" << window() << ", (" << rect.x() << "," << rect.y() << "," << rect.width() << "," << rect.height() << ")"; @@ -277,7 +277,7 @@ void QQnxWindow::setGeometryHelper(const QRect &rect) void QQnxWindow::setVisible(bool visible) { - qWindowDebug() << Q_FUNC_INFO << "window =" << window() << "visible =" << visible; + qWindowDebug() << "window =" << window() << "visible =" << visible; if (m_visible == visible || window()->type() == Qt::Desktop) return; @@ -308,7 +308,7 @@ void QQnxWindow::setVisible(bool visible) void QQnxWindow::updateVisibility(bool parentVisible) { - qWindowDebug() << Q_FUNC_INFO << "parentVisible =" << parentVisible << "window =" << window(); + qWindowDebug() << "parentVisible =" << parentVisible << "window =" << window(); // Set window visibility int val = (m_visible && parentVisible) ? 1 : 0; Q_SCREEN_CHECKERROR(screen_set_window_property_iv(m_window, SCREEN_PROPERTY_VISIBLE, &val), @@ -320,7 +320,7 @@ void QQnxWindow::updateVisibility(bool parentVisible) void QQnxWindow::setOpacity(qreal level) { - qWindowDebug() << Q_FUNC_INFO << "window =" << window() << "opacity =" << level; + qWindowDebug() << "window =" << window() << "opacity =" << level; // Set window global alpha int val = (int)(level * 255); Q_SCREEN_CHECKERROR(screen_set_window_property_iv(m_window, SCREEN_PROPERTY_GLOBAL_ALPHA, &val), @@ -331,7 +331,7 @@ void QQnxWindow::setOpacity(qreal level) void QQnxWindow::setExposed(bool exposed) { - qWindowDebug() << Q_FUNC_INFO << "window =" << window() << "expose =" << exposed; + qWindowDebug() << "window =" << window() << "expose =" << exposed; if (m_exposed != exposed) { m_exposed = exposed; @@ -346,7 +346,7 @@ bool QQnxWindow::isExposed() const void QQnxWindow::setBufferSize(const QSize &size) { - qWindowDebug() << Q_FUNC_INFO << "window =" << window() << "size =" << size; + qWindowDebug() << "window =" << window() << "size =" << size; // libscreen fails when creating empty buffers const QSize nonEmptySize = size.isEmpty() ? QSize(1, 1) : size; @@ -408,7 +408,7 @@ void QQnxWindow::setBufferSize(const QSize &size) void QQnxWindow::setScreen(QQnxScreen *platformScreen) { - qWindowDebug() << Q_FUNC_INFO << "window =" << window() << "platformScreen =" << platformScreen; + qWindowDebug() << "window =" << window() << "platformScreen =" << platformScreen; if (platformScreen == 0) { // The screen has been destroyed m_screen = 0; @@ -422,7 +422,7 @@ void QQnxWindow::setScreen(QQnxScreen *platformScreen) return; if (m_screen) { - qWindowDebug() << Q_FUNC_INFO << "Moving window to different screen"; + qWindowDebug("Moving window to different screen"); m_screen->removeWindow(this); if ((QQnxIntegration::options() & QQnxIntegration::RootWindow)) { @@ -453,7 +453,7 @@ void QQnxWindow::setScreen(QQnxScreen *platformScreen) void QQnxWindow::removeFromParent() { - qWindowDebug() << Q_FUNC_INFO << "window =" << window(); + qWindowDebug() << "window =" << window(); // Remove from old Hierarchy position if (m_parentWindow) { if (m_parentWindow->m_childWindows.removeAll(this)) @@ -467,7 +467,7 @@ void QQnxWindow::removeFromParent() void QQnxWindow::setParent(const QPlatformWindow *window) { - qWindowDebug() << Q_FUNC_INFO << "window =" << this->window() << "platformWindow =" << window; + qWindowDebug() << "window =" << this->window() << "platformWindow =" << window; // Cast away the const, we need to modify the hierarchy. QQnxWindow* const newParent = static_cast(const_cast(window)); @@ -499,7 +499,7 @@ void QQnxWindow::setParent(const QPlatformWindow *window) void QQnxWindow::raise() { - qWindowDebug() << Q_FUNC_INFO << "window =" << window(); + qWindowDebug() << "window =" << window(); if (m_parentWindow) { m_parentWindow->m_childWindows.removeAll(this); @@ -513,7 +513,7 @@ void QQnxWindow::raise() void QQnxWindow::lower() { - qWindowDebug() << Q_FUNC_INFO << "window =" << window(); + qWindowDebug() << "window =" << window(); if (m_parentWindow) { m_parentWindow->m_childWindows.removeAll(this); @@ -583,7 +583,7 @@ void QQnxWindow::setFocus(screen_window_t newFocusWindow) void QQnxWindow::setWindowState(Qt::WindowState state) { - qWindowDebug() << Q_FUNC_INFO << "state =" << state; + qWindowDebug() << "state =" << state; // Prevent two calls with Qt::WindowFullScreen from changing m_unmaximizedGeometry if (m_windowState == state) @@ -598,7 +598,7 @@ void QQnxWindow::setWindowState(Qt::WindowState state) void QQnxWindow::propagateSizeHints() { // nothing to do; silence base class warning - qWindowDebug() << Q_FUNC_INFO << ": ignored"; + qWindowDebug("ignored"); } void QQnxWindow::setMMRendererWindowName(const QString &name) @@ -634,7 +634,7 @@ QQnxWindow *QQnxWindow::findWindow(screen_window_t windowHandle) void QQnxWindow::minimize() { #if defined(Q_OS_BLACKBERRY) - qWindowDebug() << Q_FUNC_INFO; + qWindowDebug(); pps_encoder_t encoder; @@ -643,7 +643,7 @@ void QQnxWindow::minimize() if (navigator_raw_write(pps_encoder_buffer(&encoder), pps_encoder_length(&encoder)) != BPS_SUCCESS) { - qWindowDebug() << Q_FUNC_INFO << "navigator_raw_write failed:" << strerror(errno); + qWindowDebug() << "navigator_raw_write failed:" << strerror(errno); } pps_encoder_cleanup(&encoder); @@ -654,7 +654,7 @@ void QQnxWindow::minimize() void QQnxWindow::setRotation(int rotation) { - qWindowDebug() << Q_FUNC_INFO << "angle =" << rotation; + qWindowDebug() << "angle =" << rotation; Q_SCREEN_CHECKERROR( screen_set_window_property_iv(m_window, SCREEN_PROPERTY_ROTATION, &rotation), "Failed to set window rotation"); @@ -726,7 +726,7 @@ void QQnxWindow::joinWindowGroup(const QByteArray &groupName) { bool changed = false; - qWindowDebug() << Q_FUNC_INFO << "group:" << groupName; + qWindowDebug() << "group:" << groupName; if (!groupName.isEmpty()) { if (groupName != m_parentGroupName) { diff --git a/src/plugins/platforms/windows/qwindowsclipboard.cpp b/src/plugins/platforms/windows/qwindowsclipboard.cpp index 25cfd12b44..1071a2e038 100644 --- a/src/plugins/platforms/windows/qwindowsclipboard.cpp +++ b/src/plugins/platforms/windows/qwindowsclipboard.cpp @@ -236,7 +236,7 @@ void QWindowsClipboard::propagateClipboardMessage(UINT message, WPARAM wParam, L // suspended by a shell prompt 'Select' or debugger). if (QWindowsContext::user32dll.isHungAppWindow && QWindowsContext::user32dll.isHungAppWindow(m_nextClipboardViewer)) { - qWarning("%s: Cowardly refusing to send clipboard message to hung application...", Q_FUNC_INFO); + qWarning("Cowardly refusing to send clipboard message to hung application..."); return; } // Do not block if the process is being debugged, specifically, if it is diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp index a06707b84c..8d33e2f0db 100644 --- a/src/plugins/platforms/windows/qwindowsglcontext.cpp +++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp @@ -463,7 +463,7 @@ static int choosePixelFormat(HDC hdc, const QSurfaceFormat &format, PIXELFORMATDESCRIPTOR *obtainedPfd) { if (QOpenGLStaticContext::opengl32.moduleIsNotOpengl32()) { - qWarning("%s: Attempted to use GDI functions with a non-opengl32.dll library", Q_FUNC_INFO); + qWarning("Attempted to use GDI functions with a non-opengl32.dll library"); return 0; } @@ -1018,7 +1018,7 @@ QByteArray QOpenGLStaticContext::getGlString(unsigned int which) QOpenGLStaticContext *QOpenGLStaticContext::create(bool softwareRendering) { if (!opengl32.init(softwareRendering)) { - qWarning("%s: Failed to load and resolve WGL/OpenGL functions", Q_FUNC_INFO); + qWarning("Failed to load and resolve WGL/OpenGL functions"); return 0; } diff --git a/src/plugins/platforms/winrt/qwinrtinputcontext.cpp b/src/plugins/platforms/winrt/qwinrtinputcontext.cpp index 9d8792a6db..a0474b6710 100644 --- a/src/plugins/platforms/winrt/qwinrtinputcontext.cpp +++ b/src/plugins/platforms/winrt/qwinrtinputcontext.cpp @@ -81,7 +81,7 @@ QWinRTInputContext::QWinRTInputContext(QWinRTScreen *screen) IInputPaneStatics *statics; if (FAILED(GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_UI_ViewManagement_InputPane).Get(), &statics))) { - qWarning(Q_FUNC_INFO ": failed to retrieve input pane statics."); + qWarning("failed to retrieve input pane statics."); return; } @@ -98,7 +98,7 @@ QWinRTInputContext::QWinRTInputContext(QWinRTScreen *screen) m_keyboardRect = getInputPaneRect(inputPane, m_screen->scaleFactor()); m_isInputPanelVisible = !m_keyboardRect.isEmpty(); } else { - qWarning(Q_FUNC_INFO ": failed to retrieve InputPane."); + qWarning("failed to retrieve InputPane."); } } diff --git a/src/plugins/platforms/xcb/qxcbxsettings.cpp b/src/plugins/platforms/xcb/qxcbxsettings.cpp index 46cee5d6d0..effdbf7334 100644 --- a/src/plugins/platforms/xcb/qxcbxsettings.cpp +++ b/src/plugins/platforms/xcb/qxcbxsettings.cpp @@ -147,7 +147,7 @@ public: return; char byteOrder = xSettings.at(0); if (byteOrder != LSBFirst && byteOrder != MSBFirst) { - qWarning("%s ByteOrder byte %d not 0 or 1", Q_FUNC_INFO , byteOrder); + qWarning("ByteOrder byte %d not 0 or 1", byteOrder); return; } @@ -157,7 +157,7 @@ public: qFromBigEndian((const uchar *)(x))) #define VALIDATE_LENGTH(x) \ if ((size_t)xSettings.length() < (offset + local_offset + 12 + x)) { \ - qWarning("%s Length %d runs past end of data", Q_FUNC_INFO , x); \ + qWarning("Length %d runs past end of data", x); \ return; \ } diff --git a/src/testlib/qtestaccessible.h b/src/testlib/qtestaccessible.h index 628145f3b0..a397a09908 100644 --- a/src/testlib/qtestaccessible.h +++ b/src/testlib/qtestaccessible.h @@ -135,13 +135,12 @@ public: for (int i = 0; eventList().isEmpty() && i < 5; ++i) QTest::qWait(50); if (eventList().isEmpty()) { - qWarning("%s: Timeout waiting for accessibility event.", Q_FUNC_INFO); + qWarning("Timeout waiting for accessibility event."); return false; } const bool res = *eventList().first() == *ev; if (!res) - qWarning("%s: %s", Q_FUNC_INFO, - qPrintable(msgAccessibilityEventListMismatch(eventList(), ev))); + qWarning("%s", qPrintable(msgAccessibilityEventListMismatch(eventList(), ev))); delete eventList().takeFirst(); return res; } @@ -172,9 +171,9 @@ private: if (object) { QGuiApplication* app = qobject_cast(object); if ( !app ) - qWarning("%s: root Object is not a QGuiApplication!", Q_FUNC_INFO); + qWarning("root Object is not a QGuiApplication!"); } else { - qWarning("%s: root Object called with 0 pointer", Q_FUNC_INFO); + qWarning("root Object called with 0 pointer"); } } diff --git a/src/widgets/itemviews/qtableview.cpp b/src/widgets/itemviews/qtableview.cpp index 89bd9dbcb1..1e2e81a4e3 100644 --- a/src/widgets/itemviews/qtableview.cpp +++ b/src/widgets/itemviews/qtableview.cpp @@ -201,7 +201,6 @@ QDebug operator<<(QDebug str, const QSpanCollection::Span &span) void QSpanCollection::updateInsertedRows(int start, int end) { #ifdef DEBUG_SPAN_UPDATE - qDebug() << Q_FUNC_INFO; qDebug() << start << end; qDebug() << index; #endif @@ -251,7 +250,6 @@ void QSpanCollection::updateInsertedRows(int start, int end) void QSpanCollection::updateInsertedColumns(int start, int end) { #ifdef DEBUG_SPAN_UPDATE - qDebug() << Q_FUNC_INFO; qDebug() << start << end; qDebug() << index; #endif @@ -334,7 +332,6 @@ bool QSpanCollection::cleanSpanSubIndex(QSpanCollection::SubIndex &subindex, int void QSpanCollection::updateRemovedRows(int start, int end) { #ifdef DEBUG_SPAN_UPDATE - qDebug() << Q_FUNC_INFO; qDebug() << start << end; qDebug() << index; #endif @@ -463,7 +460,6 @@ void QSpanCollection::updateRemovedRows(int start, int end) void QSpanCollection::updateRemovedColumns(int start, int end) { #ifdef DEBUG_SPAN_UPDATE - qDebug() << Q_FUNC_INFO; qDebug() << start << end; qDebug() << index; #endif diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp index a194993328..3637b76aa9 100644 --- a/src/widgets/kernel/qwidgetwindow.cpp +++ b/src/widgets/kernel/qwidgetwindow.cpp @@ -795,7 +795,7 @@ void QWidgetWindow::handleDragLeaveEvent(QDragLeaveEvent *event) void QWidgetWindow::handleDropEvent(QDropEvent *event) { if (m_dragTarget.isNull()) { - qWarning() << Q_FUNC_INFO << m_widget << ": No drag target set."; + qWarning() << m_widget << ": No drag target set."; event->ignore(); return; } diff --git a/src/widgets/styles/qwindowsvistastyle.cpp b/src/widgets/styles/qwindowsvistastyle.cpp index a7a0830fb9..083b1d1707 100644 --- a/src/widgets/styles/qwindowsvistastyle.cpp +++ b/src/widgets/styles/qwindowsvistastyle.cpp @@ -2472,12 +2472,12 @@ bool QWindowsVistaStylePrivate::initTreeViewTheming() m_treeViewHelper = createTreeViewHelperWindow(); if (!m_treeViewHelper) { - qWarning("%s: Unable to create the treeview helper window.", Q_FUNC_INFO); + qWarning("Unable to create the treeview helper window."); return false; } const HRESULT hr = QWindowsXPStylePrivate::pSetWindowTheme(m_treeViewHelper, L"explorer", NULL); if (hr != S_OK) { - qErrnoWarning("%s: SetWindowTheme() failed.", Q_FUNC_INFO); + qErrnoWarning("SetWindowTheme() failed."); return false; } return QWindowsXPStylePrivate::createTheme(QWindowsXPStylePrivate::TreeViewTheme, m_treeViewHelper); diff --git a/src/widgets/styles/qwindowsxpstyle.cpp b/src/widgets/styles/qwindowsxpstyle.cpp index 0b33213378..c350e82c69 100644 --- a/src/widgets/styles/qwindowsxpstyle.cpp +++ b/src/widgets/styles/qwindowsxpstyle.cpp @@ -338,15 +338,15 @@ void QWindowsXPStylePrivate::cleanupHandleMap() HTHEME QWindowsXPStylePrivate::createTheme(int theme, HWND hwnd) { if (theme < 0 || theme >= NThemes || !hwnd) { - qWarning("%s: Invalid parameters #%d, %p", Q_FUNC_INFO, theme, hwnd); + qWarning("Invalid parameters #%d, %p", theme, hwnd); return 0; } if (!m_themes[theme]) { const wchar_t *name = themeNames[theme]; m_themes[theme] = pOpenThemeData(hwnd, name); if (!m_themes[theme]) - qErrnoWarning("%s: OpenThemeData() failed for theme %d (%s).", - Q_FUNC_INFO, theme, qPrintable(themeName(theme))); + qErrnoWarning("OpenThemeData() failed for theme %d (%s).", + theme, qPrintable(themeName(theme))); } return m_themes[theme]; } diff --git a/src/widgets/util/qsystemtrayicon_win.cpp b/src/widgets/util/qsystemtrayicon_win.cpp index 1809c36483..f1b86ba2df 100644 --- a/src/widgets/util/qsystemtrayicon_win.cpp +++ b/src/widgets/util/qsystemtrayicon_win.cpp @@ -395,7 +395,7 @@ void QSystemTrayIconPrivate::install_sys() sys->createIcon(); sys->trayMessage(NIM_ADD); } else { - qWarning("%s: The platform plugin failed to create a message window.", Q_FUNC_INFO); + qWarning("The platform plugin failed to create a message window."); } } } diff --git a/src/widgets/widgets/qtoolbararealayout.cpp b/src/widgets/widgets/qtoolbararealayout.cpp index 89e3da1383..16b1115dd6 100644 --- a/src/widgets/widgets/qtoolbararealayout.cpp +++ b/src/widgets/widgets/qtoolbararealayout.cpp @@ -1129,7 +1129,7 @@ QLayoutItem *QToolBarAreaLayout::plug(const QList &path) { QToolBarAreaLayoutItem *item = this->item(path); if (!item) { - qWarning() << Q_FUNC_INFO << "No item at" << path; + qWarning() << "No item at" << path; return 0; } Q_ASSERT(item->gap); -- cgit v1.2.3 From 678a4273a30e9e073dabe684ba21f18faf426e15 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sat, 24 Oct 2015 22:32:45 +0200 Subject: QtBase: combine adjacent qDebug()/qCritical() lines For qDebug() and qWarning(), this is just an optimization. For qCritical(), which can be fatal, the old code was just wrong. Change-Id: I6d8ab1d7531d766cd41b49569dc0fd4420ecab8b Reviewed-by: Friedemann Kleint Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/corelib/mimetypes/qmimeprovider.cpp | 6 ++-- src/corelib/plugin/qfactoryloader.cpp | 4 +-- src/plugins/bearer/nla/qnlaengine.cpp | 42 ++++++++++++------------ src/plugins/platforms/android/androidjnimain.cpp | 4 +-- src/widgets/itemviews/qtableview.cpp | 12 +++---- src/widgets/util/qscroller.cpp | 4 +-- 6 files changed, 34 insertions(+), 38 deletions(-) diff --git a/src/corelib/mimetypes/qmimeprovider.cpp b/src/corelib/mimetypes/qmimeprovider.cpp index 59aef39fb7..917c29b8d6 100644 --- a/src/corelib/mimetypes/qmimeprovider.cpp +++ b/src/corelib/mimetypes/qmimeprovider.cpp @@ -568,9 +568,9 @@ void QMimeBinaryProvider::loadMimeTypePrivate(QMimeTypePrivate &data) mimeFiles = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QString::fromLatin1("mime/") + file); // pre-1.3 } if (mimeFiles.isEmpty()) { - qWarning() << "No file found for" << file << ", even though update-mime-info said it would exist."; - qWarning() << "Either it was just removed, or the directory doesn't have executable permission..."; - qWarning() << QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QLatin1String("mime"), QStandardPaths::LocateDirectory); + qWarning() << "No file found for" << file << ", even though update-mime-info said it would exist.\n" + "Either it was just removed, or the directory doesn't have executable permission..." + << QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QLatin1String("mime"), QStandardPaths::LocateDirectory); return; } diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp index 8de1669924..fb5b895851 100644 --- a/src/corelib/plugin/qfactoryloader.cpp +++ b/src/corelib/plugin/qfactoryloader.cpp @@ -164,8 +164,8 @@ void QFactoryLoader::update() library = QLibraryPrivate::findOrCreate(QFileInfo(fileName).canonicalFilePath()); if (!library->isPlugin()) { if (qt_debug_component()) { - qDebug() << library->errorString; - qDebug() << " not a plugin"; + qDebug() << library->errorString << endl + << " not a plugin"; } library->release(); continue; diff --git a/src/plugins/bearer/nla/qnlaengine.cpp b/src/plugins/bearer/nla/qnlaengine.cpp index 3680eb7305..cc65364a02 100644 --- a/src/plugins/bearer/nla/qnlaengine.cpp +++ b/src/plugins/bearer/nla/qnlaengine.cpp @@ -69,39 +69,39 @@ QWindowsSockInit2::~QWindowsSockInit2() #ifdef BEARER_MANAGEMENT_DEBUG static void printBlob(NLA_BLOB *blob) { - qDebug() << "==== BEGIN NLA_BLOB ===="; + qDebug() << "==== BEGIN NLA_BLOB ====" << endl - qDebug() << "type:" << blob->header.type; - qDebug() << "size:" << blob->header.dwSize; - qDebug() << "next offset:" << blob->header.nextOffset; + << "type:" << blob->header.type << endl + << "size:" << blob->header.dwSize << endl + << "next offset:" << blob->header.nextOffset; switch (blob->header.type) { case NLA_RAW_DATA: - qDebug() << "Raw Data"; - qDebug() << '\t' << blob->data.rawData; + qDebug() << "Raw Data" << endl + << '\t' << blob->data.rawData; break; case NLA_INTERFACE: - qDebug() << "Interface"; - qDebug() << "\ttype:" << blob->data.interfaceData.dwType; - qDebug() << "\tspeed:" << blob->data.interfaceData.dwSpeed; - qDebug() << "\tadapter:" << blob->data.interfaceData.adapterName; + qDebug() << "Interface" << endl + << "\ttype:" << blob->data.interfaceData.dwType << endl + << "\tspeed:" << blob->data.interfaceData.dwSpeed << endl + << "\tadapter:" << blob->data.interfaceData.adapterName; break; case NLA_802_1X_LOCATION: - qDebug() << "802.1x Location"; - qDebug() << '\t' << blob->data.locationData.information; + qDebug() << "802.1x Location" << endl + << '\t' << blob->data.locationData.information; break; case NLA_CONNECTIVITY: - qDebug() << "Connectivity"; - qDebug() << "\ttype:" << blob->data.connectivity.type; - qDebug() << "\tinternet:" << blob->data.connectivity.internet; + qDebug() << "Connectivity" << endl + << "\ttype:" << blob->data.connectivity.type << endl + << "\tinternet:" << blob->data.connectivity.internet; break; case NLA_ICS: - qDebug() << "ICS"; - qDebug() << "\tspeed:" << blob->data.ICS.remote.speed; - qDebug() << "\ttype:" << blob->data.ICS.remote.type; - qDebug() << "\tstate:" << blob->data.ICS.remote.state; - qDebug() << "\tmachine name:" << blob->data.ICS.remote.machineName; - qDebug() << "\tshared adapter name:" << blob->data.ICS.remote.sharedAdapterName; + qDebug() << "ICS" << endl + << "\tspeed:" << blob->data.ICS.remote.speed << endl + << "\ttype:" << blob->data.ICS.remote.type << endl + << "\tstate:" << blob->data.ICS.remote.state << endl + << "\tmachine name:" << blob->data.ICS.remote.machineName << endl + << "\tshared adapter name:" << blob->data.ICS.remote.sharedAdapterName; break; default: qDebug() << "UNKNOWN BLOB TYPE"; diff --git a/src/plugins/platforms/android/androidjnimain.cpp b/src/plugins/platforms/android/androidjnimain.cpp index d419e42cd5..f500d6e413 100644 --- a/src/plugins/platforms/android/androidjnimain.cpp +++ b/src/plugins/platforms/android/androidjnimain.cpp @@ -498,8 +498,8 @@ static jboolean startQtApplication(JNIEnv *env, jobject /*object*/, jstring para } if (!m_main) { - qCritical() << "dlsym failed:" << dlerror(); - qCritical() << "Could not find main method"; + qCritical() << "dlsym failed:" << dlerror() << endl + << "Could not find main method"; return false; } diff --git a/src/widgets/itemviews/qtableview.cpp b/src/widgets/itemviews/qtableview.cpp index 1e2e81a4e3..ee0d41ce15 100644 --- a/src/widgets/itemviews/qtableview.cpp +++ b/src/widgets/itemviews/qtableview.cpp @@ -201,8 +201,7 @@ QDebug operator<<(QDebug str, const QSpanCollection::Span &span) void QSpanCollection::updateInsertedRows(int start, int end) { #ifdef DEBUG_SPAN_UPDATE - qDebug() << start << end; - qDebug() << index; + qDebug() << start << end << endl << index; #endif if (spans.isEmpty()) return; @@ -250,8 +249,7 @@ void QSpanCollection::updateInsertedRows(int start, int end) void QSpanCollection::updateInsertedColumns(int start, int end) { #ifdef DEBUG_SPAN_UPDATE - qDebug() << start << end; - qDebug() << index; + qDebug() << start << end << endl << index; #endif if (spans.isEmpty()) return; @@ -332,8 +330,7 @@ bool QSpanCollection::cleanSpanSubIndex(QSpanCollection::SubIndex &subindex, int void QSpanCollection::updateRemovedRows(int start, int end) { #ifdef DEBUG_SPAN_UPDATE - qDebug() << start << end; - qDebug() << index; + qDebug() << start << end << endl << index; #endif if (spans.isEmpty()) return; @@ -460,8 +457,7 @@ void QSpanCollection::updateRemovedRows(int start, int end) void QSpanCollection::updateRemovedColumns(int start, int end) { #ifdef DEBUG_SPAN_UPDATE - qDebug() << start << end; - qDebug() << index; + qDebug() << start << end << endl << index; #endif if (spans.isEmpty()) return; diff --git a/src/widgets/util/qscroller.cpp b/src/widgets/util/qscroller.cpp index 0065ccf6b3..38b104f9e9 100644 --- a/src/widgets/util/qscroller.cpp +++ b/src/widgets/util/qscroller.cpp @@ -1870,8 +1870,8 @@ void QScrollerPrivate::setContentPositionHelperScrolling() newPos.setY(nextSegmentPosition(ySegments, now, newPos.y())); // -- set the position and handle overshoot - qScrollerDebug() << "QScroller::setContentPositionHelperScrolling()"; - qScrollerDebug() << " --> overshoot:" << overshootPosition << "- new pos:" << newPos; + qScrollerDebug() << "QScroller::setContentPositionHelperScrolling()\n" + " --> overshoot:" << overshootPosition << "- new pos:" << newPos; QPointF newClampedPos = clampToRect(newPos, contentPosRange); -- cgit v1.2.3 From 61cefb2f7a7cb16dfa2732e26d2319017039ef62 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 23 Nov 2015 14:47:05 +0100 Subject: De-inline QFileSystemModel::fileInfo() and implement it efficiently De-inline the method, and return the file info that's already being cached by the model. This is ok to do in a minor release, as apps compiled against an older version of Qt will simply continue to use the less efficient implementation. Change-Id: I164c7961a8cf97447638af316512326442767dd8 Task-number: QTBUG-30902 Reviewed-by: Marc Mutz Reviewed-by: Edward Welbourne Reviewed-by: Konstantin Ritt --- src/widgets/dialogs/qfilesystemmodel.cpp | 5 +++++ src/widgets/dialogs/qfilesystemmodel.h | 4 +--- src/widgets/dialogs/qfilesystemmodel_p.h | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp index b1e77540e7..6bce7e99f5 100644 --- a/src/widgets/dialogs/qfilesystemmodel.cpp +++ b/src/widgets/dialogs/qfilesystemmodel.cpp @@ -154,6 +154,11 @@ QT_BEGIN_NAMESPACE Returns the QFileInfo for the item stored in the model under the given \a index. */ +QFileInfo QFileSystemModel::fileInfo(const QModelIndex &index) const +{ + Q_D(const QFileSystemModel); + return d->node(index)->fileInfo(); +} /*! \fn void QFileSystemModel::rootPathChanged(const QString &newPath); diff --git a/src/widgets/dialogs/qfilesystemmodel.h b/src/widgets/dialogs/qfilesystemmodel.h index f749c97bcb..add1a7241a 100644 --- a/src/widgets/dialogs/qfilesystemmodel.h +++ b/src/widgets/dialogs/qfilesystemmodel.h @@ -132,7 +132,7 @@ public: inline QString fileName(const QModelIndex &index) const; inline QIcon fileIcon(const QModelIndex &index) const; QFile::Permissions permissions(const QModelIndex &index) const; - inline QFileInfo fileInfo(const QModelIndex &index) const; + QFileInfo fileInfo(const QModelIndex &index) const; bool remove(const QModelIndex &index); protected: @@ -156,8 +156,6 @@ inline QString QFileSystemModel::fileName(const QModelIndex &aindex) const { return aindex.data(Qt::DisplayRole).toString(); } inline QIcon QFileSystemModel::fileIcon(const QModelIndex &aindex) const { return qvariant_cast(aindex.data(Qt::DecorationRole)); } -inline QFileInfo QFileSystemModel::fileInfo(const QModelIndex &aindex) const -{ return QFileInfo(filePath(aindex)); } #endif // QT_NO_FILESYSTEMMODEL diff --git a/src/widgets/dialogs/qfilesystemmodel_p.h b/src/widgets/dialogs/qfilesystemmodel_p.h index 57fb457071..a35c50bfc7 100644 --- a/src/widgets/dialogs/qfilesystemmodel_p.h +++ b/src/widgets/dialogs/qfilesystemmodel_p.h @@ -107,6 +107,7 @@ public: return true; return false; } + inline QFileInfo fileInfo() const { if (info) return info->fileInfo(); return QFileInfo(); } inline bool isFile() const { if (info) return info->isFile(); return true; } inline bool isSystem() const { if (info) return info->isSystem(); return true; } inline bool isHidden() const { if (info) return info->isHidden(); return false; } -- cgit v1.2.3 From 4efa50a5e37497bc3a3dd30f27db7d8100e3f6a5 Mon Sep 17 00:00:00 2001 From: Daniel Molkentin Date: Mon, 7 Apr 2014 13:10:52 +0200 Subject: QNAM Fix error message The code path is called for up- and downloads, yet the error message talks about "Error downloading...". Make this "Error transferring..." for a more neutral statement. Change-Id: Ifbca6a95058042b195cdbeec339ef27a231491b2 Reviewed-by: Simon Hausmann --- src/network/access/qhttpthreaddelegate.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/network/access/qhttpthreaddelegate.cpp b/src/network/access/qhttpthreaddelegate.cpp index c07064fd94..b0e366d2f8 100644 --- a/src/network/access/qhttpthreaddelegate.cpp +++ b/src/network/access/qhttpthreaddelegate.cpp @@ -492,7 +492,7 @@ void QHttpThreadDelegate::finishedSlot() if (httpReply->statusCode() >= 400) { // it's an error reply QString msg = QLatin1String(QT_TRANSLATE_NOOP("QNetworkReply", - "Error downloading %1 - server replied: %2")); + "Error transferring %1 - server replied: %2")); msg = msg.arg(httpRequest.url().toString(), httpReply->reasonPhrase()); emit error(statusCodeFromHttp(httpReply->statusCode(), httpRequest.url()), msg); } @@ -518,7 +518,7 @@ void QHttpThreadDelegate::synchronousFinishedSlot() if (httpReply->statusCode() >= 400) { // it's an error reply QString msg = QLatin1String(QT_TRANSLATE_NOOP("QNetworkReply", - "Error downloading %1 - server replied: %2")); + "Error transferring %1 - server replied: %2")); incomingErrorDetail = msg.arg(httpRequest.url().toString(), httpReply->reasonPhrase()); incomingErrorCode = statusCodeFromHttp(httpReply->statusCode(), httpRequest.url()); } -- cgit v1.2.3 From 9f591b3b6ca4d3c0de234f04bb9a2deb8d784170 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 12 Oct 2015 22:47:13 +0200 Subject: QVector: prevent resize() from shedding capacity ...even if reserve() hasn't been called before. [ChangeLog][QtCore][QVector] resize() will no longer shrink the capacity. That means resize(0) now reliably preserves capacity(). Task-number: QTBUG-39293 Done-with: Robin Burchell Change-Id: Ie7e4e597126832990b6cfb83bba875c3963b143e Reviewed-by: Olivier Goffart (Woboq GmbH) Reviewed-by: Milian Wolff Reviewed-by: Thiago Macieira --- src/corelib/tools/qvector.cpp | 3 +++ src/corelib/tools/qvector.h | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/corelib/tools/qvector.cpp b/src/corelib/tools/qvector.cpp index 0fcba3c0c4..f1cf23cc6a 100644 --- a/src/corelib/tools/qvector.cpp +++ b/src/corelib/tools/qvector.cpp @@ -384,6 +384,9 @@ initialized with a \l{default-constructed value}. If \a size is less than the current size, elements are removed from the end. + Since Qt 5.6, resize() doesn't shrink the capacity anymore. + To shed excess capacity, use squeeze(). + \sa size() */ diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index 890dbd317d..3ce33fb477 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -406,9 +406,6 @@ void QVector::resize(int asize) if (asize > oldAlloc) { // there is not enough space newAlloc = asize; opt = QArrayData::Grow; - } else if (!d->capacityReserved && asize < d->size && asize < (oldAlloc >> 1)) { // we want to shrink - newAlloc = asize; - opt = QArrayData::Grow; } else { newAlloc = oldAlloc; } -- cgit v1.2.3 From aab21bce86f3cf5c520c99bdd73fcca5bb453130 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sat, 24 Oct 2015 15:24:27 +0200 Subject: QDnsLookup: fix grammar in a user-visible string Change-Id: I6bda83c750d2e2c0a2325aae259836bb96d92a11 Reviewed-by: Friedemann Kleint --- src/network/kernel/qdnslookup_win.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/network/kernel/qdnslookup_win.cpp b/src/network/kernel/qdnslookup_win.cpp index 7eeeb80264..4a6c631983 100644 --- a/src/network/kernel/qdnslookup_win.cpp +++ b/src/network/kernel/qdnslookup_win.cpp @@ -60,9 +60,9 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN // For supoprting IPv6 nameserver addresses, we'll need to switch // from DnsQuey() to DnsQueryEx() as it supports passing an IPv6 // address in the nameserver list - qWarning("IPv6 addresses for nameservers is currently not supported"); + qWarning("IPv6 addresses for nameservers are currently not supported"); reply->error = QDnsLookup::ResolverError; - reply->errorString = tr("IPv6 addresses for nameservers is currently not supported"); + reply->errorString = tr("IPv6 addresses for nameservers are currently not supported"); return; } } -- cgit v1.2.3 From 6302fb07e763a3a59458dab38445a22ba7833d7e Mon Sep 17 00:00:00 2001 From: Ilija Ristevski Date: Wed, 28 Oct 2015 18:24:55 +0100 Subject: QTextOdfWriter: Added support for hyperlinks. Hyperlink added in QTextDocument becomes "" tag after exporting the document to ODF with QTextDocumentWriter. Fixed by adding "" tag around it with attribute "href" pointing to hyperlink location. Task-number: QTBUG-48853 Change-Id: I2bd689a88c9d0a5b14369777718b9cb36e4cfa19 Reviewed-by: Konstantin Ritt Reviewed-by: Lars Knoll --- src/gui/text/qtextodfwriter.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gui/text/qtextodfwriter.cpp b/src/gui/text/qtextodfwriter.cpp index 429e910f18..1fd20cfbef 100644 --- a/src/gui/text/qtextodfwriter.cpp +++ b/src/gui/text/qtextodfwriter.cpp @@ -279,6 +279,12 @@ void QTextOdfWriter::writeBlock(QXmlStreamWriter &writer, const QTextBlock &bloc writer.writeAttribute(textNS, QString::fromLatin1("style-name"), QString::fromLatin1("p%1") .arg(block.blockFormatIndex())); for (QTextBlock::Iterator frag = block.begin(); !frag.atEnd(); ++frag) { + bool isHyperlink = frag.fragment().charFormat().hasProperty(QTextFormat::AnchorHref); + if (isHyperlink) { + QString value = frag.fragment().charFormat().property(QTextFormat::AnchorHref).toString(); + writer.writeStartElement(textNS, QString::fromLatin1("a")); + writer.writeAttribute(xlinkNS, QString::fromLatin1("href"), value); + } writer.writeCharacters(QString()); // Trick to make sure that the span gets no linefeed in front of it. writer.writeStartElement(textNS, QString::fromLatin1("span")); @@ -335,6 +341,9 @@ void QTextOdfWriter::writeBlock(QXmlStreamWriter &writer, const QTextBlock &bloc writer.writeCharacters(fragmentText.mid(exportedIndex)); writer.writeEndElement(); // span + writer.writeCharacters(QString()); // Trick to make sure that the span gets no linefeed behind it. + if (isHyperlink) + writer.writeEndElement(); // a } writer.writeCharacters(QString()); // Trick to make sure that the span gets no linefeed behind it. writer.writeEndElement(); // p -- cgit v1.2.3 From 9e5133f4ccc53b2aa0ebb8af4e349ab931b159e0 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 27 Nov 2015 10:56:01 +0100 Subject: Document platform limitations for QCollator::ignorePunctuation OS X and iOS do have a flag for this in their API, but it does not seem to work. We can't support this on Linux without ICU. Change-Id: I81613ad425cb054597f23fac112be665f8d958b6 Task-number: QTBUG-41978 Reviewed-by: Jake Petroules --- src/corelib/tools/qcollator.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/corelib/tools/qcollator.cpp b/src/corelib/tools/qcollator.cpp index 59f8f66869..bbe2e28ea8 100644 --- a/src/corelib/tools/qcollator.cpp +++ b/src/corelib/tools/qcollator.cpp @@ -248,6 +248,8 @@ bool QCollator::numericMode() const The default is locale dependent. + \note This method is not currently supported on Apple platforms or if Qt is configured to not use ICU on Linux. + \sa ignorePunctuation() */ void QCollator::setIgnorePunctuation(bool on) -- cgit v1.2.3 From 63a5b3b09da867f4c005dac1359b87e76f8904ee Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 27 Nov 2015 10:32:01 +0100 Subject: Remove a reference to Mac OS X 10.4 It's been a while since we stopped supporting that version :) Change-Id: I2fa4900945551024ac920c36c47d20b47aee50c0 Reviewed-by: Jake Petroules --- src/corelib/io/qfilesystemwatcher.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qfilesystemwatcher.cpp b/src/corelib/io/qfilesystemwatcher.cpp index 23a2fbecdb..354e4931b9 100644 --- a/src/corelib/io/qfilesystemwatcher.cpp +++ b/src/corelib/io/qfilesystemwatcher.cpp @@ -177,7 +177,7 @@ void QFileSystemWatcherPrivate::_q_directoryChanged(const QString &path, bool re \note The act of monitoring files and directories for modifications consumes system resources. This implies there is a limit to the number of files and directories your process can - monitor simultaneously. On Mac OS X 10.4 and all BSD variants, for + monitor simultaneously. On all BSD variants, for example, an open file descriptor is required for each monitored file. Some system limits the number of open file descriptors to 256 by default. This means that addPath() and addPaths() will fail if @@ -185,7 +185,7 @@ void QFileSystemWatcherPrivate::_q_directoryChanged(const QString &path, bool re the file system monitor. Also note that your process may have other file descriptors open in addition to the ones for files being monitored, and these other open descriptors also count in - the total. Mac OS X 10.5 and up use a different backend and do not + the total. OS X uses a different backend and does not suffer from this issue. -- cgit v1.2.3 From fbc18abf5a1ab1b0e74c4d240af8bf7e8381667c Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Thu, 26 Nov 2015 12:53:33 +0100 Subject: Ignore Q_SERIALBUS_EXPORT and Q_DECL_EQ_DEFAULT in qdoc Change-Id: I3ec9170aba408e8c01c7940f2537a017dbeae065 Reviewed-by: Martin Smith --- doc/global/qt-cpp-defines.qdocconf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/global/qt-cpp-defines.qdocconf b/doc/global/qt-cpp-defines.qdocconf index 8649a14582..967bbb8ede 100644 --- a/doc/global/qt-cpp-defines.qdocconf +++ b/doc/global/qt-cpp-defines.qdocconf @@ -39,6 +39,7 @@ Cpp.ignoretokens += \ Q_DECL_UNUSED \ Q_DECL_CF_RETURNS_RETAINED \ Q_DECL_NS_RETURNS_AUTORELEASED \ + Q_DECL_EQ_DEFAULT \ Q_DECLARATIVE_EXPORT \ Q_EXPLICIT \ Q_EXPORT \ @@ -78,6 +79,7 @@ Cpp.ignoretokens += \ Q_REQUIRED_RESULT \ Q_SCRIPT_EXPORT \ Q_SCRIPTTOOLS_EXPORT \ + Q_SERIALBUS_EXPORT \ Q_SQL_EXPORT \ Q_SVG_EXPORT \ Q_TESTLIB_EXPORT \ -- cgit v1.2.3 From 949ed98b2b5db6aa4cc38b1d0f997ba049d3a8da Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Fri, 20 Nov 2015 12:42:12 +0100 Subject: Doc: added QQuickItem also uses UngrabMouse Task-number: QTBUG-37311 Change-Id: I8beac262d92ddb16c225da65aa8a3f80da59074f Reviewed-by: Michael Brasser --- src/corelib/kernel/qcoreevent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp index 98514c56af..05c18995ff 100644 --- a/src/corelib/kernel/qcoreevent.cpp +++ b/src/corelib/kernel/qcoreevent.cpp @@ -219,7 +219,7 @@ QT_BEGIN_NAMESPACE \value TouchEnd End of touch-event sequence (QTouchEvent). \value TouchUpdate Touch-screen event (QTouchEvent). \value UngrabKeyboard Item loses keyboard grab (QGraphicsItem only). - \value UngrabMouse Item loses mouse grab (QGraphicsItem only). + \value UngrabMouse Item loses mouse grab (QGraphicsItem, QQuickItem). \value UpdateLater The widget should be queued to be repainted at a later time. \value UpdateRequest The widget should be repainted. \value WhatsThis The widget should reveal "What's This?" help (QHelpEvent). -- cgit v1.2.3 From 9b23e36bbdd44f443cff607b524b23fe66ffd9e1 Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Mon, 23 Nov 2015 13:04:49 +0100 Subject: Doc: improvement in if condition about inserting item in list Task-number: QTBUG-41708 Change-Id: Ibbb115a8ad81f7fba0ce162ae131d4843b19c188 Reviewed-by: Martin Smith --- src/corelib/tools/qlist.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/tools/qlist.cpp b/src/corelib/tools/qlist.cpp index 8ed0da7ca0..5710f3925b 100644 --- a/src/corelib/tools/qlist.cpp +++ b/src/corelib/tools/qlist.cpp @@ -820,8 +820,8 @@ void **QListData::erase(void **xi) /*! \fn void QList::insert(int i, const T &value) - Inserts \a value at index position \a i in the list. If \a i - is 0, the value is prepended to the list. If \a i is size(), the + Inserts \a value at index position \a i in the list. If \a i <= 0, + the value is prepended to the list. If \a i >= size(), the value is appended to the list. Example: -- cgit v1.2.3 From eff8fb07040ec68a7d2195a06144e7d61250dc80 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 27 Nov 2015 11:33:07 +0100 Subject: Enable AArch64 versions of ARGB32 NEON drawhelpers Fix the ARGB32 NEON-optimized drawhelpers so they also build on AArch64. The RGB16 NEON-drawhelpers are not converted as they use more assembly. Change-Id: I8b75fadf5bad74360a2ab6aec9a6bf50df80c1b9 Reviewed-by: Erik Verbruggen --- src/gui/painting/painting.pri | 4 +- src/gui/painting/qdrawhelper.cpp | 30 +++++++----- src/gui/painting/qdrawhelper_neon.cpp | 90 ++++++++++++++++++++++++++++++----- 3 files changed, 99 insertions(+), 25 deletions(-) diff --git a/src/gui/painting/painting.pri b/src/gui/painting/painting.pri index fd9ae0aaca..5b25c2fd95 100644 --- a/src/gui/painting/painting.pri +++ b/src/gui/painting/painting.pri @@ -101,11 +101,11 @@ SSE4_1_SOURCES += painting/qdrawhelper_sse4.cpp \ painting/qimagescale_sse4.cpp AVX2_SOURCES += painting/qdrawhelper_avx2.cpp -!ios:!contains(QT_ARCH, "arm64") { +!ios { CONFIG += no_clang_integrated_as NEON_SOURCES += painting/qdrawhelper_neon.cpp NEON_HEADERS += painting/qdrawhelper_neon_p.h - NEON_ASM += ../3rdparty/pixman/pixman-arm-neon-asm.S painting/qdrawhelper_neon_asm.S + !contains(QT_ARCH, "arm64"): NEON_ASM += ../3rdparty/pixman/pixman-arm-neon-asm.S painting/qdrawhelper_neon_asm.S } MIPS_DSP_SOURCES += painting/qdrawhelper_mips_dsp.cpp diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index 0d89b2466d..5854008ea3 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -6309,7 +6309,7 @@ void qt_memfill16(quint16 *dest, quint16 color, int count) qt_memfill_template(dest, color, count); } #endif -#if !defined(__SSE2__) && (!defined(__ARM_NEON__) || defined(Q_PROCESSOR_ARM_64)) +#if !defined(__SSE2__) && !defined(__ARM_NEON__) # ifdef QT_COMPILER_SUPPORTS_MIPS_DSP extern "C" void qt_memfill32_asm_mips_dsp(quint32 *, quint32, int); # endif @@ -6425,14 +6425,11 @@ void qInitDrawhelperAsm() #endif // SSE2 -#if defined(__ARM_NEON__) && !defined(Q_OS_IOS) && !defined(Q_PROCESSOR_ARM_64) +#if defined(__ARM_NEON__) && !defined(Q_OS_IOS) qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_neon; qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_neon; qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_neon; qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_neon; - qBlendFunctions[QImage::Format_RGB16][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_rgb16_neon; - qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB16] = qt_blend_rgb16_on_argb32_neon; - qBlendFunctions[QImage::Format_RGB16][QImage::Format_RGB16] = qt_blend_rgb16_on_rgb16_neon; #if Q_BYTE_ORDER == Q_LITTLE_ENDIAN qBlendFunctions[QImage::Format_RGBX8888][QImage::Format_RGBX8888] = qt_blend_rgb32_on_rgb32_neon; qBlendFunctions[QImage::Format_RGBA8888_Premultiplied][QImage::Format_RGBX8888] = qt_blend_rgb32_on_rgb32_neon; @@ -6440,6 +6437,21 @@ void qInitDrawhelperAsm() qBlendFunctions[QImage::Format_RGBA8888_Premultiplied][QImage::Format_RGBA8888_Premultiplied] = qt_blend_argb32_on_argb32_neon; #endif + qt_functionForMode_C[QPainter::CompositionMode_SourceOver] = qt_blend_argb32_on_argb32_scanline_neon; + qt_functionForModeSolid_C[QPainter::CompositionMode_SourceOver] = comp_func_solid_SourceOver_neon; + qt_functionForMode_C[QPainter::CompositionMode_Plus] = comp_func_Plus_neon; + + extern const uint * QT_FASTCALL qt_fetch_radial_gradient_neon(uint *buffer, const Operator *op, const QSpanData *data, + int y, int x, int length); + + qt_fetch_radial_gradient = qt_fetch_radial_gradient_neon; + +#if !defined(Q_PROCESSOR_ARM_64) + // The RGB16 helpers are using Arm32 assemblythat has not been ported to AArch64 + qBlendFunctions[QImage::Format_RGB16][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_rgb16_neon; + qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB16] = qt_blend_rgb16_on_argb32_neon; + qBlendFunctions[QImage::Format_RGB16][QImage::Format_RGB16] = qt_blend_rgb16_on_rgb16_neon; + qScaleFunctions[QImage::Format_RGB16][QImage::Format_ARGB32_Premultiplied] = qt_scale_image_argb32_on_rgb16_neon; qScaleFunctions[QImage::Format_RGB16][QImage::Format_RGB16] = qt_scale_image_rgb16_on_rgb16_neon; @@ -6448,19 +6460,13 @@ void qInitDrawhelperAsm() qDrawHelper[QImage::Format_RGB16].alphamapBlit = qt_alphamapblit_quint16_neon; - qt_functionForMode_C[QPainter::CompositionMode_SourceOver] = qt_blend_argb32_on_argb32_scanline_neon; - qt_functionForModeSolid_C[QPainter::CompositionMode_SourceOver] = comp_func_solid_SourceOver_neon; - qt_functionForMode_C[QPainter::CompositionMode_Plus] = comp_func_Plus_neon; destFetchProc[QImage::Format_RGB16] = qt_destFetchRGB16_neon; destStoreProc[QImage::Format_RGB16] = qt_destStoreRGB16_neon; qMemRotateFunctions[QImage::Format_RGB16][0] = qt_memrotate90_16_neon; qMemRotateFunctions[QImage::Format_RGB16][2] = qt_memrotate270_16_neon; +#endif - extern const uint * QT_FASTCALL qt_fetch_radial_gradient_neon(uint *buffer, const Operator *op, const QSpanData *data, - int y, int x, int length); - - qt_fetch_radial_gradient = qt_fetch_radial_gradient_neon; #endif #if defined(Q_PROCESSOR_MIPS_32) && defined(QT_COMPILER_SUPPORTS_MIPS_DSP) diff --git a/src/gui/painting/qdrawhelper_neon.cpp b/src/gui/painting/qdrawhelper_neon.cpp index bf4758afd2..413fddcfdc 100644 --- a/src/gui/painting/qdrawhelper_neon.cpp +++ b/src/gui/painting/qdrawhelper_neon.cpp @@ -44,6 +44,7 @@ QT_BEGIN_NAMESPACE void qt_memfill32(quint32 *dest, quint32 value, int count) { const int epilogueSize = count % 16; +#if !defined(Q_PROCESSOR_ARM_64) if (count >= 16) { quint32 *const neonEnd = dest + count - epilogueSize; register uint32x4_t valueVector1 asm ("q0") = vdupq_n_u32(value); @@ -58,6 +59,22 @@ void qt_memfill32(quint32 *dest, quint32 value, int count) ); } } +#else + if (count >= 16) { + quint32 *const neonEnd = dest + count - epilogueSize; + register uint32x4_t valueVector1 asm ("v0") = vdupq_n_u32(value); + register uint32x4_t valueVector2 asm ("v1") = valueVector1; + while (dest != neonEnd) { + asm volatile ( + "st2 { v0.4s, v1.4s }, [%[DST]], #32 \n\t" + "st2 { v0.4s, v1.4s }, [%[DST]], #32 \n\t" + : [DST]"+r" (dest) + : [VALUE1]"w"(valueVector1), [VALUE2]"w"(valueVector2) + : "memory" + ); + } + } +#endif switch (epilogueSize) { @@ -118,6 +135,7 @@ static inline uint16x8_t qvsource_over_u16(uint16x8_t src16, uint16x8_t dst16, u return vaddq_u16(src16, qvbyte_mul_u16(dst16, alpha16, half)); } +#if !defined(Q_PROCESSOR_ARM_64) extern "C" void pixman_composite_over_8888_0565_asm_neon (int32_t w, int32_t h, @@ -164,7 +182,6 @@ pixman_composite_src_0565_0565_asm_neon (int32_t w, int32_t dst_stride, uint16_t *src, int32_t src_stride); - // qblendfunctions.cpp void qt_blend_argb32_on_rgb16_const_alpha(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, @@ -204,6 +221,7 @@ void qt_blend_rgb16_on_rgb16(uchar *dst, int dbpl, int w, int h, int const_alpha); + template static inline void scanLineBlit16(quint16 *dst, quint16 *src, int dstride) { @@ -329,11 +347,16 @@ void qt_blend_argb32_on_rgb16_neon(uchar *destPixels, int dbpl, pixman_composite_over_8888_0565_asm_neon(w, h, dst, dbpl / 2, src, sbpl / 4); } +#endif void qt_blend_argb32_on_argb32_scanline_neon(uint *dest, const uint *src, int length, uint const_alpha) { if (const_alpha == 255) { +#if !defined(Q_PROCESSOR_ARM_64) pixman_composite_scanline_over_asm_neon(length, dest, src); +#else + qt_blend_argb32_on_argb32_neon((uchar *)dest, 4 * length, (uchar *)src, 4 * length, length, 1, 256); +#endif } else { qt_blend_argb32_on_argb32_neon((uchar *)dest, 4 * length, (uchar *)src, 4 * length, length, 1, (const_alpha * 256) / 255); } @@ -349,7 +372,51 @@ void qt_blend_argb32_on_argb32_neon(uchar *destPixels, int dbpl, uint16x8_t half = vdupq_n_u16(0x80); uint16x8_t full = vdupq_n_u16(0xff); if (const_alpha == 256) { +#if !defined(Q_PROCESSOR_ARM_64) pixman_composite_over_8888_8888_asm_neon(w, h, (uint32_t *)destPixels, dbpl / 4, (uint32_t *)srcPixels, sbpl / 4); +#else + for (int y=0; y= 0xff000000) + dst[x] = s; + else if (s != 0) + dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s)); + } + dst = (quint32 *)(((uchar *) dst) + dbpl); + src = (const quint32 *)(((const uchar *) src) + sbpl); + } +#endif } else if (const_alpha != 0) { const_alpha = (const_alpha * 255) >> 8; uint16x8_t const_alpha16 = vdupq_n_u16(const_alpha); @@ -463,6 +530,7 @@ void qt_blend_rgb32_on_rgb32_neon(uchar *destPixels, int dbpl, } } +#if !defined(Q_PROCESSOR_ARM_64) void qt_alphamapblit_quint16_neon(QRasterBuffer *rasterBuffer, int x, int y, const QRgba64 &color, const uchar *bitmap, @@ -703,6 +771,7 @@ void QT_FASTCALL qt_destStoreRGB16_neon(QRasterBuffer *rasterBuffer, int x, int data[i + j] = dstBuffer[j]; } } +#endif void QT_FASTCALL comp_func_solid_SourceOver_neon(uint *destPixels, int length, uint color, uint const_alpha) { @@ -754,16 +823,13 @@ void QT_FASTCALL comp_func_Plus_neon(uint *dst, const uint *src, int length, uin uint *const neonEnd = end - 3; while (dst < neonEnd) { - asm volatile ( - "vld2.8 { d0, d1 }, [%[SRC]] !\n\t" - "vld2.8 { d2, d3 }, [%[DST]]\n\t" - "vqadd.u8 q0, q0, q1\n\t" - "vst2.8 { d0, d1 }, [%[DST]] !\n\t" - : [DST]"+r" (dst), [SRC]"+r" (src) - : - : "memory", "d0", "d1", "d2", "d3", "q0", "q1" - ); - } + uint8x16_t vs = vld1q_u8((const uint8_t*)src); + const uint8x16_t vd = vld1q_u8((uint8_t*)dst); + vs = vqaddq_u8(vs, vd); + vst1q_u8((uint8_t*)dst, vs); + src += 4; + dst += 4; + }; while (dst != end) { *dst = comp_func_Plus_one_pixel(*dst, *src); @@ -802,6 +868,7 @@ void QT_FASTCALL comp_func_Plus_neon(uint *dst, const uint *src, int length, uin } } +#if !defined(Q_PROCESSOR_ARM_64) static const int tileSize = 32; extern "C" void qt_rotate90_16_neon(quint16 *dst, const quint16 *src, int sstride, int dstride, int count); @@ -945,6 +1012,7 @@ void qt_memrotate270_16_neon(const uchar *srcPixels, int w, int h, } } } +#endif class QSimdNeon { -- cgit v1.2.3 From 60e2aa6532c81dbc6bc23d855ee7050f2744d0c0 Mon Sep 17 00:00:00 2001 From: Venugopal Shivashankar Date: Wed, 11 Nov 2015 14:03:38 +0100 Subject: Doc: Add ordered list-specific styles These additional styles enable the use of lower and uppercase alphabets to number the list items. They are useful especially in nested ordered lists where numbering all the list items using decimal numbers could be confusing. Change-Id: If1bdf98ff37c2c191d66dfb66a3e8f20d8fa83e5 Reviewed-by: Venugopal Shivashankar --- doc/global/template/style/offline.css | 13 ++++++++++++- doc/global/template/style/online.css | 16 +++++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/doc/global/template/style/offline.css b/doc/global/template/style/offline.css index 123d753290..5aabd82dcb 100644 --- a/doc/global/template/style/offline.css +++ b/doc/global/template/style/offline.css @@ -515,15 +515,26 @@ li { margin-bottom: 10px; padding-left: 8px; list-style: outside; - list-style-type: square; text-align: left; } + ul > li { + list-style-type: square; + } + ol { margin: 10px; padding: 0; } +ol.A > li { + list-style-type: upper-alpha; +} + +ol.a > li{ + list-style-type: lower-alpha; +} + ol > li { margin-left: 30px; padding-left: 8px; diff --git a/doc/global/template/style/online.css b/doc/global/template/style/online.css index a98382e083..86e30e89b3 100644 --- a/doc/global/template/style/online.css +++ b/doc/global/template/style/online.css @@ -975,9 +975,23 @@ ol,ul { margin-top:0.75em; margin-left:20px } + +.context ol > li { + margin-left: 20px +} + .mainContent ol>li { - list-style-type:decimal + list-style-type: decimal; +} + +.mainContent ol.a >li { + list-style-type: lower-alpha; +} + +.mainContent ol.A >li { + list-style-type: upper-alpha; } + blockquote,q { quotes:none } -- cgit v1.2.3 From 6c0f89b9274380a637af00536dde5128cb967c25 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Thu, 26 Nov 2015 14:04:34 +0100 Subject: Doc: Update the list of highlighted examples Change-Id: Id4459ca978e9f126f04224722565b97552dfa0ef Task-number: QTBUG-49458 Reviewed-by: Sami Makkonen Reviewed-by: Venugopal Shivashankar --- doc/global/manifest-meta.qdocconf | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/global/manifest-meta.qdocconf b/doc/global/manifest-meta.qdocconf index b5eaf96a3f..c45470838a 100644 --- a/doc/global/manifest-meta.qdocconf +++ b/doc/global/manifest-meta.qdocconf @@ -43,16 +43,21 @@ manifestmeta.highlighted.names = "QtQuick/Qt Quick Demo - Same Game" \ "QtQuick/Qt Quick Demo - Clocks" \ "QtQuick/Qt Quick Examples - Shader Effects" \ "QtQuickExtras/Qt Quick Extras - Dashboard" \ + "QtQuickExtras/Qt Quick Extras - Flat" \ "QtQuickExtras/Qt Quick Extras - Gallery" \ "QtQuickControls/Qt Quick Controls - Gallery" \ "QtQuickControls/Qt Quick Controls - Text Editor Example" \ "QtQuickControls/Qt Quick Controls - Table View Example" \ "QtQuickControls/Qt Quick Controls - Calendar Example" \ + "QtQuickControls/Qt Quick Controls - File System Browser Example" \ "QtQuickDialogs/Qt Quick System Dialog Examples" \ "QtWinExtras/Quick Player" \ "QtMultimedia/QML Video Shader Effects Example" \ "QtCanvas3D/Planets Example" \ - "QtLocation/Map Viewer (QML)" + "QtCanvas3D/Interactive Mobile Phone Example" \ + "QtLocation/Map Viewer (QML)" \ + "QtWebEngine/WebEngine Quick Nano Browser" \ + "QtWebEngine/Markdown Editor Example" manifestmeta.highlighted.attributes = isHighlighted:true -- cgit v1.2.3 From 10379e48f154dedb95e2e5bfc17085f8a5183dd2 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Mon, 30 Nov 2015 12:11:50 +0100 Subject: Doc: Omit default argument in describing a function call QKeySequence::PortableText is the default value for argument passed to QKeySequence::toString(), and it doesn't need to be mentioned specifically in description for Qt::AA_MacDontSwapCtrlAndMeta enum value. Dropping the parameter shortens the text string, allows browser to better wrap the table text, and gets rid of the automatic horizontal scrollbar in online style. This improves readability for the entire table. Change-Id: I7051f5415a7a100b8c76f23b06b6cb9a2b0699ef Reviewed-by: Martin Smith --- src/corelib/global/qnamespace.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index e789daafbd..502d6acd9f 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -137,7 +137,7 @@ attribute is true, Qt will not do the flip. \l QKeySequence::StandardKey will also flip accordingly (i.e., QKeySequence::Copy will be Command+C on the keyboard regardless of the value set, though what is output for - QKeySequence::toString(QKeySequence::PortableText) will be different). + QKeySequence::toString() will be different). \value AA_Use96Dpi Assume the screen has a resolution of 96 DPI rather than using the OS-provided resolution. This will cause font rendering -- cgit v1.2.3 From 2e00500b9f32f25a15563a4fd35375ead12c14a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Fri, 28 Mar 2014 14:24:45 +0100 Subject: Fix conversion QVariant(QColor) to QString. QVariant was using QColor::name() to convert a color to string, which by default loses alpha value. The patch is fixing the problem by always including the alpha value in the string when required. [ChangeLog][Core][Variant] QVariant(QColor)::toString() uses QColor::HexArgb format when the alpha component is different from 1. Task-number: QTBUG-37851 Change-Id: I887460c1ea151180ba99d64dd873ba9d6e2268f2 Reviewed-by: Simon Hausmann --- src/gui/kernel/qguivariant.cpp | 9 ++++++--- tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp | 10 ++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qguivariant.cpp b/src/gui/kernel/qguivariant.cpp index ce4a0ec09e..a0769ca671 100644 --- a/src/gui/kernel/qguivariant.cpp +++ b/src/gui/kernel/qguivariant.cpp @@ -175,7 +175,8 @@ static bool convert(const QVariant::Private *d, int t, switch (t) { case QVariant::ByteArray: if (d->type == QVariant::Color) { - *static_cast(result) = v_cast(d)->name().toLatin1(); + const QColor *c = v_cast(d); + *static_cast(result) = c->name(c->alpha() != 255 ? QColor::HexArgb : QColor::HexRgb).toLatin1(); return true; } break; @@ -190,9 +191,11 @@ static bool convert(const QVariant::Private *d, int t, case QVariant::Font: *str = v_cast(d)->toString(); return true; - case QVariant::Color: - *str = v_cast(d)->name(); + case QVariant::Color: { + const QColor *c = v_cast(d); + *str = c->name(c->alpha() != 255 ? QColor::HexArgb : QColor::HexRgb); return true; + } default: break; } diff --git a/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp b/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp index 0e822ced5b..0a704b9f64 100644 --- a/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp +++ b/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp @@ -250,6 +250,14 @@ void tst_QGuiVariant::toColor_data() QColor c("red"); QTest::newRow( "string" ) << QVariant( QString( "red" ) ) << c; QTest::newRow( "solid brush" ) << QVariant( QBrush(c) ) << c; + QTest::newRow("qbytearray") << QVariant(QByteArray("red")) << c; + QTest::newRow("same color") << QVariant(c) << c; + QTest::newRow("qstring(#ff0000)") << QVariant(QString::fromUtf8("#ff0000")) << c; + QTest::newRow("qbytearray(#ff0000)") << QVariant(QByteArray("#ff0000")) << c; + + c.setNamedColor("#88112233"); + QTest::newRow("qstring(#88112233)") << QVariant(QString::fromUtf8("#88112233")) << c; + QTest::newRow("qbytearray(#88112233)") << QVariant(QByteArray("#88112233")) << c; } void tst_QGuiVariant::toColor() @@ -260,6 +268,8 @@ void tst_QGuiVariant::toColor() QVERIFY( value.canConvert( QVariant::Color ) ); QColor d = qvariant_cast(value); QCOMPARE( d, result ); + QVERIFY(value.convert(QMetaType::QColor)); + QCOMPARE(d, QColor(value.toString())); } void tst_QGuiVariant::toPixmap_data() -- cgit v1.2.3 From 197da3d220fb267d127288e109e691d832ce290b Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 23 Nov 2015 14:35:45 +0100 Subject: Use QCollator for sorting in the filesystem model The old code was extremely inefficient, and QCollator can provide the same functionality in a much better and faster way. Task-number: QTBUG-30902 Change-Id: Iaf5dbe587d9a6ebca26885259fdee74a29d3c84f Reviewed-by: Edward Welbourne Reviewed-by: Konstantin Ritt Reviewed-by: Marc Mutz Reviewed-by: Lars Knoll --- src/widgets/dialogs/qfilesystemmodel.cpp | 95 +++------------------- .../qfilesystemmodel/tst_qfilesystemmodel.cpp | 76 ----------------- 2 files changed, 11 insertions(+), 160 deletions(-) diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp index 6bce7e99f5..1b9a1129b2 100644 --- a/src/widgets/dialogs/qfilesystemmodel.cpp +++ b/src/widgets/dialogs/qfilesystemmodel.cpp @@ -39,6 +39,7 @@ #include #include #include +#include #include @@ -979,84 +980,6 @@ void QFileSystemModelPrivate::_q_performDelayedSort() q->sort(sortColumn, sortOrder); } -static inline QChar getNextChar(const QString &s, int location) -{ - return (location < s.length()) ? s.at(location) : QChar(); -} - -/*! - Natural number sort, skips spaces. - - Examples: - 1, 2, 10, 55, 100 - 01.jpg, 2.jpg, 10.jpg - - Note on the algorithm: - Only as many characters as necessary are looked at and at most they all - are looked at once. - - Slower then QString::compare() (of course) - */ -int QFileSystemModelPrivate::naturalCompare(const QString &s1, const QString &s2, Qt::CaseSensitivity cs) -{ - for (int l1 = 0, l2 = 0; l1 <= s1.count() && l2 <= s2.count(); ++l1, ++l2) { - // skip spaces, tabs and 0's - QChar c1 = getNextChar(s1, l1); - while (c1.isSpace()) - c1 = getNextChar(s1, ++l1); - QChar c2 = getNextChar(s2, l2); - while (c2.isSpace()) - c2 = getNextChar(s2, ++l2); - - if (c1.isDigit() && c2.isDigit()) { - while (c1.digitValue() == 0) - c1 = getNextChar(s1, ++l1); - while (c2.digitValue() == 0) - c2 = getNextChar(s2, ++l2); - - int lookAheadLocation1 = l1; - int lookAheadLocation2 = l2; - int currentReturnValue = 0; - // find the last digit, setting currentReturnValue as we go if it isn't equal - for ( - QChar lookAhead1 = c1, lookAhead2 = c2; - (lookAheadLocation1 <= s1.length() && lookAheadLocation2 <= s2.length()); - lookAhead1 = getNextChar(s1, ++lookAheadLocation1), - lookAhead2 = getNextChar(s2, ++lookAheadLocation2) - ) { - bool is1ADigit = !lookAhead1.isNull() && lookAhead1.isDigit(); - bool is2ADigit = !lookAhead2.isNull() && lookAhead2.isDigit(); - if (!is1ADigit && !is2ADigit) - break; - if (!is1ADigit) - return -1; - if (!is2ADigit) - return 1; - if (currentReturnValue == 0) { - if (lookAhead1 < lookAhead2) { - currentReturnValue = -1; - } else if (lookAhead1 > lookAhead2) { - currentReturnValue = 1; - } - } - } - if (currentReturnValue != 0) - return currentReturnValue; - } - - if (cs == Qt::CaseInsensitive) { - if (!c1.isLower()) c1 = c1.toLower(); - if (!c2.isLower()) c2 = c2.toLower(); - } - int r = QString::localeAwareCompare(c1, c2); - if (r < 0) - return -1; - if (r > 0) - return 1; - } - // The two strings are the same (02 == 2) so fall back to the normal sort - return QString::compare(s1, s2, cs); -} /* \internal @@ -1065,7 +988,11 @@ int QFileSystemModelPrivate::naturalCompare(const QString &s1, const QString &s2 class QFileSystemModelSorter { public: - inline QFileSystemModelSorter(int column) : sortColumn(column) {} + inline QFileSystemModelSorter(int column) : sortColumn(column) + { + naturalCompare.setNumericMode(true); + naturalCompare.setCaseSensitivity(Qt::CaseInsensitive); + } bool compareNodes(const QFileSystemModelPrivate::QFileSystemNode *l, const QFileSystemModelPrivate::QFileSystemNode *r) const @@ -1079,8 +1006,7 @@ public: if (left ^ right) return left; #endif - return QFileSystemModelPrivate::naturalCompare(l->fileName, - r->fileName, Qt::CaseInsensitive) < 0; + return naturalCompare.compare(l->fileName, r->fileName) < 0; } case 1: { @@ -1092,7 +1018,7 @@ public: qint64 sizeDifference = l->size() - r->size(); if (sizeDifference == 0) - return QFileSystemModelPrivate::naturalCompare(l->fileName, r->fileName, Qt::CaseInsensitive) < 0; + return naturalCompare.compare(l->fileName, r->fileName) < 0; return sizeDifference < 0; } @@ -1100,14 +1026,14 @@ public: { int compare = QString::localeAwareCompare(l->type(), r->type()); if (compare == 0) - return QFileSystemModelPrivate::naturalCompare(l->fileName, r->fileName, Qt::CaseInsensitive) < 0; + return naturalCompare.compare(l->fileName, r->fileName) < 0; return compare < 0; } case 3: { if (l->lastModified() == r->lastModified()) - return QFileSystemModelPrivate::naturalCompare(l->fileName, r->fileName, Qt::CaseInsensitive) < 0; + return naturalCompare.compare(l->fileName, r->fileName) < 0; return l->lastModified() < r->lastModified(); } @@ -1124,6 +1050,7 @@ public: private: + QCollator naturalCompare; int sortColumn; }; diff --git a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp index 209048a853..3252650d12 100644 --- a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp +++ b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp @@ -78,10 +78,6 @@ private slots: void indexPath(); void rootPath(); -#ifdef QT_BUILD_INTERNAL - void naturalCompare_data(); - void naturalCompare(); -#endif void readOnly(); void iconProvider(); @@ -242,78 +238,6 @@ void tst_QFileSystemModel::rootPath() } } -#ifdef QT_BUILD_INTERNAL -void tst_QFileSystemModel::naturalCompare_data() -{ - QTest::addColumn("s1"); - QTest::addColumn("s2"); - QTest::addColumn("caseSensitive"); - QTest::addColumn("result"); - QTest::addColumn("swap"); - -#define ROWNAME(name) (qPrintable(QString("prefix=%1, postfix=%2, num=%3, i=%4, test=%5").arg(prefix).arg(postfix).arg(num).arg(i).arg(name))) - - for (int j = 0; j < 4; ++j) { // <- set a prefix and a postfix string (not numbers) - QString prefix = (j == 0 || j == 1) ? "b" : ""; - QString postfix = (j == 1 || j == 2) ? "y" : ""; - - for (int k = 0; k < 3; ++k) { // <- make 0 not a special case - QString num = QString("%1").arg(k); - QString nump = QString("%1").arg(k + 1); - for (int i = 10; i < 12; ++i) { // <- swap s1 and s2 and reverse the result - QTest::newRow(ROWNAME("basic")) << prefix + "0" + postfix << prefix + "0" + postfix << int(Qt::CaseInsensitive) << 0; - - // s1 should always be less then s2 - QTest::newRow(ROWNAME("just text")) << prefix + "fred" + postfix << prefix + "jane" + postfix << int(Qt::CaseInsensitive) << i; - QTest::newRow(ROWNAME("just numbers")) << prefix + num + postfix << prefix + "9" + postfix << int(Qt::CaseInsensitive) << i; - QTest::newRow(ROWNAME("zero")) << prefix + num + postfix << prefix + "0" + nump + postfix << int(Qt::CaseInsensitive) << i; - QTest::newRow(ROWNAME("space b")) << prefix + num + postfix << prefix + " " + nump + postfix << int(Qt::CaseInsensitive) << i; - QTest::newRow(ROWNAME("space a")) << prefix + num + postfix << prefix + nump + " " + postfix << int(Qt::CaseInsensitive) << i; - QTest::newRow(ROWNAME("tab b")) << prefix + num + postfix << prefix + " " + nump + postfix << int(Qt::CaseInsensitive) << i; - QTest::newRow(ROWNAME("tab a")) << prefix + num + postfix << prefix + nump + " " + postfix << int(Qt::CaseInsensitive) << i; - QTest::newRow(ROWNAME("10 vs 2")) << prefix + num + postfix << prefix + "10" + postfix << int(Qt::CaseInsensitive) << i; - QTest::newRow(ROWNAME("diff len")) << prefix + num + postfix << prefix + nump + postfix + "x" << int(Qt::CaseInsensitive) << i; - QTest::newRow(ROWNAME("01 before 1")) << prefix + "0" + num + postfix << prefix + nump + postfix << int(Qt::CaseInsensitive) << i; - QTest::newRow(ROWNAME("mul nums 2nd 1")) << prefix + "1-" + num + postfix << prefix + "1-" + nump + postfix << int(Qt::CaseInsensitive) << i; - QTest::newRow(ROWNAME("mul nums 2nd 2")) << prefix + "10-" + num + postfix<< prefix + "10-10" + postfix << int(Qt::CaseInsensitive) << i; - QTest::newRow(ROWNAME("mul nums 2nd 3")) << prefix + "10-0"+ num + postfix<< prefix + "10-10" + postfix << int(Qt::CaseInsensitive) << i; - QTest::newRow(ROWNAME("mul nums 2nd 4")) << prefix + "10-" + num + postfix<< prefix + "10-010" + postfix << int(Qt::CaseInsensitive) << i; - QTest::newRow(ROWNAME("mul nums big 1")) << prefix + "10-" + num + postfix<< prefix + "20-0" + postfix << int(Qt::CaseInsensitive) << i; - QTest::newRow(ROWNAME("mul nums big 2")) << prefix + "2-" + num + postfix << prefix + "10-0" + postfix << int(Qt::CaseInsensitive) << i; - QTest::newRow(ROWNAME("mul alphabet 1")) << prefix + num + "-a" + postfix << prefix + num + "-c" + postfix << int(Qt::CaseInsensitive) << i; - QTest::newRow(ROWNAME("mul alphabet 2")) << prefix + num + "-a9" + postfix<< prefix + num + "-c0" + postfix << int(Qt::CaseInsensitive) << i; - QTest::newRow(ROWNAME("mul nums w\\0")) << prefix + num + "-"+ num + postfix<< prefix + num+"-0"+nump + postfix << int(Qt::CaseInsensitive) << i; - QTest::newRow(ROWNAME("num first")) << prefix + num + postfix << prefix + "a" + postfix << int(Qt::CaseInsensitive) << i; - } - } - } -#undef ROWNAME -} -#endif - -#ifdef QT_BUILD_INTERNAL -void tst_QFileSystemModel::naturalCompare() -{ - QFETCH(QString, s1); - QFETCH(QString, s2); - QFETCH(int, caseSensitive); - QFETCH(int, result); - - if (result == 10) - QCOMPARE(QFileSystemModelPrivate::naturalCompare(s1, s2, Qt::CaseSensitivity(caseSensitive)), -1); - else - if (result == 11) - QCOMPARE(QFileSystemModelPrivate::naturalCompare(s2, s1, Qt::CaseSensitivity(caseSensitive)), 1); - else - QCOMPARE(QFileSystemModelPrivate::naturalCompare(s2, s1, Qt::CaseSensitivity(caseSensitive)), result); -#if defined(Q_OS_WINCE) - // On Windows CE we need to wait after each test, otherwise no new threads can be - // created. The scheduler takes its time to recognize ended threads. - QTest::qWait(300); -#endif -} -#endif - void tst_QFileSystemModel::readOnly() { QCOMPARE(model->isReadOnly(), true); -- cgit v1.2.3 From ca14600965479dd3d255b734a0fe54bb2ba7892d Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 24 Nov 2015 15:01:53 +0100 Subject: Use natural comparison also for the file types If we want to sort according to file types, we're also sorting user visible strings. For that we can also use the natural comparison collator, as file types should be case insensitive, and won't contain numbers. And even if they do a natual sorting will make it easier for the end user to find what they are looking for. Change-Id: Ie1d7d0af041a08be0f0d1a4eeb2eae9be885ffc7 Reviewed-by: Marc Mutz --- src/widgets/dialogs/qfilesystemmodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp index 1b9a1129b2..cfc6b9c4cc 100644 --- a/src/widgets/dialogs/qfilesystemmodel.cpp +++ b/src/widgets/dialogs/qfilesystemmodel.cpp @@ -1024,7 +1024,7 @@ public: } case 2: { - int compare = QString::localeAwareCompare(l->type(), r->type()); + int compare = naturalCompare.compare(l->type(), r->type()); if (compare == 0) return naturalCompare.compare(l->fileName, r->fileName) < 0; -- cgit v1.2.3 From e808c5fa6096eb4bc84b6d90c9befa9e805fa680 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 24 Nov 2015 09:21:53 +0100 Subject: Don't use QList Change it to use a QVector instead. Change-Id: Ie1749f326ba1165db48c0eb8763eb738672c7afd Reviewed-by: Marc Mutz --- src/widgets/dialogs/qfileinfogatherer.cpp | 6 +++--- src/widgets/dialogs/qfileinfogatherer_p.h | 4 ++-- src/widgets/dialogs/qfilesystemmodel.cpp | 10 +++++----- src/widgets/dialogs/qfilesystemmodel.h | 2 +- src/widgets/dialogs/qfilesystemmodel_p.h | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/widgets/dialogs/qfileinfogatherer.cpp b/src/widgets/dialogs/qfileinfogatherer.cpp index 7329019a87..92d6b8f3be 100644 --- a/src/widgets/dialogs/qfileinfogatherer.cpp +++ b/src/widgets/dialogs/qfileinfogatherer.cpp @@ -287,7 +287,7 @@ void QFileInfoGatherer::getFileInfos(const QString &path, const QStringList &fil } for (int i = infoList.count() - 1; i >= 0; --i) { QString driveName = translateDriveName(infoList.at(i)); - QList > updatedFiles; + QVector > updatedFiles; updatedFiles.append(QPair(driveName, infoList.at(i))); emit updates(path, updatedFiles); } @@ -298,7 +298,7 @@ void QFileInfoGatherer::getFileInfos(const QString &path, const QStringList &fil base.start(); QFileInfo fileInfo; bool firstTime = true; - QList > updatedFiles; + QVector > updatedFiles; QStringList filesToCheck = files; QString itPath = QDir::fromNativeSeparators(files.isEmpty() ? path : QLatin1String("")); @@ -324,7 +324,7 @@ void QFileInfoGatherer::getFileInfos(const QString &path, const QStringList &fil emit directoryLoaded(path); } -void QFileInfoGatherer::fetch(const QFileInfo &fileInfo, QElapsedTimer &base, bool &firstTime, QList > &updatedFiles, const QString &path) { +void QFileInfoGatherer::fetch(const QFileInfo &fileInfo, QElapsedTimer &base, bool &firstTime, QVector > &updatedFiles, const QString &path) { updatedFiles.append(QPair(fileInfo.fileName(), fileInfo)); QElapsedTimer current; current.start(); diff --git a/src/widgets/dialogs/qfileinfogatherer_p.h b/src/widgets/dialogs/qfileinfogatherer_p.h index 6bd15b5388..03f87fdba5 100644 --- a/src/widgets/dialogs/qfileinfogatherer_p.h +++ b/src/widgets/dialogs/qfileinfogatherer_p.h @@ -149,7 +149,7 @@ class Q_AUTOTEST_EXPORT QFileInfoGatherer : public QThread Q_OBJECT Q_SIGNALS: - void updates(const QString &directory, const QList > &updates); + void updates(const QString &directory, const QVector > &updates); void newListOfFiles(const QString &directory, const QStringList &listOfFiles) const; void nameResolved(const QString &fileName, const QString &resolvedName) const; void directoryLoaded(const QString &path); @@ -176,7 +176,7 @@ private: void run() Q_DECL_OVERRIDE; // called by run(): void getFileInfos(const QString &path, const QStringList &files); - void fetch(const QFileInfo &info, QElapsedTimer &base, bool &firstTime, QList > &updatedFiles, const QString &path); + void fetch(const QFileInfo &info, QElapsedTimer &base, bool &firstTime, QVector > &updatedFiles, const QString &path); private: mutable QMutex mutex; diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp index cfc6b9c4cc..5dd8c05734 100644 --- a/src/widgets/dialogs/qfilesystemmodel.cpp +++ b/src/widgets/dialogs/qfilesystemmodel.cpp @@ -1110,7 +1110,7 @@ void QFileSystemModel::sort(int column, Qt::SortOrder order) emit layoutAboutToBeChanged(); QModelIndexList oldList = persistentIndexList(); - QList > oldNodes; + QVector > oldNodes; const int nodeCount = oldList.count(); oldNodes.reserve(nodeCount); for (int i = 0; i < nodeCount; ++i) { @@ -1756,7 +1756,7 @@ void QFileSystemModelPrivate::removeVisibleFile(QFileSystemNode *parentNode, int The thread has received new information about files, update and emit dataChanged if it has actually changed. */ -void QFileSystemModelPrivate::_q_fileSystemChanged(const QString &path, const QList > &updates) +void QFileSystemModelPrivate::_q_fileSystemChanged(const QString &path, const QVector > &updates) { #ifndef QT_NO_FILESYSTEMWATCHER Q_Q(QFileSystemModel); @@ -1875,12 +1875,12 @@ void QFileSystemModelPrivate::_q_resolvedName(const QString &fileName, const QSt void QFileSystemModelPrivate::init() { Q_Q(QFileSystemModel); - qRegisterMetaType > >(); + qRegisterMetaType > >(); #ifndef QT_NO_FILESYSTEMWATCHER q->connect(&fileInfoGatherer, SIGNAL(newListOfFiles(QString,QStringList)), q, SLOT(_q_directoryChanged(QString,QStringList))); - q->connect(&fileInfoGatherer, SIGNAL(updates(QString,QList >)), - q, SLOT(_q_fileSystemChanged(QString,QList >))); + q->connect(&fileInfoGatherer, SIGNAL(updates(QString,QVector >)), + q, SLOT(_q_fileSystemChanged(QString,QVector >))); q->connect(&fileInfoGatherer, SIGNAL(nameResolved(QString,QString)), q, SLOT(_q_resolvedName(QString,QString))); q->connect(&fileInfoGatherer, SIGNAL(directoryLoaded(QString)), diff --git a/src/widgets/dialogs/qfilesystemmodel.h b/src/widgets/dialogs/qfilesystemmodel.h index add1a7241a..515417f225 100644 --- a/src/widgets/dialogs/qfilesystemmodel.h +++ b/src/widgets/dialogs/qfilesystemmodel.h @@ -146,7 +146,7 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_directoryChanged(const QString &directory, const QStringList &list)) Q_PRIVATE_SLOT(d_func(), void _q_performDelayedSort()) - Q_PRIVATE_SLOT(d_func(), void _q_fileSystemChanged(const QString &path, const QList > &)) + Q_PRIVATE_SLOT(d_func(), void _q_fileSystemChanged(const QString &path, const QVector > &)) Q_PRIVATE_SLOT(d_func(), void _q_resolvedName(const QString &fileName, const QString &resolvedName)) friend class QFileDialogPrivate; diff --git a/src/widgets/dialogs/qfilesystemmodel_p.h b/src/widgets/dialogs/qfilesystemmodel_p.h index a35c50bfc7..d2a40a1cb5 100644 --- a/src/widgets/dialogs/qfilesystemmodel_p.h +++ b/src/widgets/dialogs/qfilesystemmodel_p.h @@ -283,7 +283,7 @@ public: void _q_directoryChanged(const QString &directory, const QStringList &list); void _q_performDelayedSort(); - void _q_fileSystemChanged(const QString &path, const QList > &); + void _q_fileSystemChanged(const QString &path, const QVector > &); void _q_resolvedName(const QString &fileName, const QString &resolvedName); static int naturalCompare(const QString &s1, const QString &s2, Qt::CaseSensitivity cs); -- cgit v1.2.3 From 87d6b0514b21c18a9b0dfab1a735fdefa610af0a Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Mon, 30 Nov 2015 13:14:19 +0100 Subject: Doc: Fortune Server Example: fix typo in function name Change-Id: Ib0a5030cc2f88cf90ba7d25c75871c439486abe3 Reviewed-by: Friedemann Kleint --- examples/network/doc/src/fortuneserver.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/network/doc/src/fortuneserver.qdoc b/examples/network/doc/src/fortuneserver.qdoc index c55a1634e4..0b110783aa 100644 --- a/examples/network/doc/src/fortuneserver.qdoc +++ b/examples/network/doc/src/fortuneserver.qdoc @@ -87,7 +87,7 @@ \snippet fortuneserver/server.cpp 7 - We then call QTcpServer::newPendingConnection(), which returns the + We then call QTcpServer::nextPendingConnection(), which returns the QTcpSocket representing the server side of the connection. By connecting QTcpSocket::disconnected() to QObject::deleteLater(), we ensure that the socket will be deleted after disconnecting. -- cgit v1.2.3 From e931ad71101585cf7826641f4c8e373c7b3119b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Thu, 12 Nov 2015 16:22:14 +0100 Subject: Don't use QT_AUTO_SCREEN_SCALE_FACTOR With the addition of Qt::AA_EnableHighDpiScaling testing of the env. variable only is no longer sufficient. Use QHighDpiScaling::isActive() instead, which is available at the time loadAndroidStyle is called. Change-Id: Iaa6bbb5a04a71fa3bd68f3bdc8c8bcdfb5d1778f Reviewed-by: BogDan Vatra Reviewed-by: J-P Nurmi --- src/plugins/platforms/android/qandroidplatformtheme.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/android/qandroidplatformtheme.cpp b/src/plugins/platforms/android/qandroidplatformtheme.cpp index 71a3f910d2..5531910555 100644 --- a/src/plugins/platforms/android/qandroidplatformtheme.cpp +++ b/src/plugins/platforms/android/qandroidplatformtheme.cpp @@ -46,6 +46,7 @@ #include #include +#include #include QT_BEGIN_NAMESPACE @@ -217,7 +218,7 @@ QJsonObject AndroidStyle::loadStyleData() static std::shared_ptr loadAndroidStyle(QPalette *defaultPalette) { - double pixelDensity = qEnvironmentVariableIsSet("QT_AUTO_SCREEN_SCALE_FACTOR") ? QtAndroid::pixelDensity() : 1.0; + double pixelDensity = QHighDpiScaling::isActive() ? QtAndroid::pixelDensity() : 1.0; std::shared_ptr style(new AndroidStyle); style->m_styleData = AndroidStyle::loadStyleData(); if (style->m_styleData.isEmpty()) -- cgit v1.2.3 From eb16f853529e4e0c10816054d2c28030963097ce Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 25 Nov 2015 16:32:37 +0100 Subject: make force_independent live up to its name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit don't install the module .pri file into qtbase even when doing a non-prefix build. this has no effect on modules built as part of a top-level build, as they announce themselves via .qmake.super anyway. however, modules built separately become unavailable unless QMAKEPATH or QMAKEMODULES is set. this is deemed not relevant by the original audience of this feature (the qtwebkit team). Change-Id: I14c170b2c5dbb99608939aef1a541563d5b755d9 Reviewed-by: Tor Arne Vestbø Reviewed-by: Simon Hausmann --- mkspecs/features/qt_build_paths.prf | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/mkspecs/features/qt_build_paths.prf b/mkspecs/features/qt_build_paths.prf index 9163ac30b2..1848f00e90 100644 --- a/mkspecs/features/qt_build_paths.prf +++ b/mkspecs/features/qt_build_paths.prf @@ -20,10 +20,9 @@ isEmpty(MODULE_QMAKE_OUTDIR): MODULE_QMAKE_OUTDIR = $$MODULE_BASE_OUTDIR exists($$MODULE_BASE_INDIR/.git): \ CONFIG += git_build -!prefix_build { - QTDIR = $$[QT_HOST_PREFIX] - # Permit modules to enforce being built outside QTDIR ... - !force_independent: MODULE_BASE_OUTDIR = $$QTDIR - # ... though this sort of breaks the idea. - MODULE_QMAKE_OUTDIR = $$QTDIR +!force_independent { + # If the module is not built independently, everything ends up in qtbase. + # This is the case in non-prefix builds, except for selected modules. + MODULE_BASE_OUTDIR = $$[QT_HOST_PREFIX] + MODULE_QMAKE_OUTDIR = $$[QT_HOST_PREFIX] } -- cgit v1.2.3 From 7733a5fccc39aa5141e5968eef3fa47bc62917d9 Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Wed, 2 Sep 2015 12:54:21 +0200 Subject: msvc: Introduce base config file for all targets Visual Studio version specific changes have been added to msvc- desktop.conf which is not used in WinRT or Windows Phone related builds. Hence take a similar approach to gcc and introduce msvc-base to be used by all configurations for common settings. For WinRT this will only be applied to msvc2015 and later on to not introduce any regressions or behavior changes for previous versions. Change-Id: Ib1a4d539d46d788470c00cb5969fee74a803bd67 Reviewed-by: Oswald Buddenhagen Reviewed-by: Oliver Wolff --- mkspecs/common/msvc-base.conf | 56 ++++++++++++++++++++++++++++++++ mkspecs/common/msvc-desktop.conf | 50 +--------------------------- mkspecs/common/winrt_winphone/qmake.conf | 5 +++ mkspecs/winrt-arm-msvc2015/qmake.conf | 1 + mkspecs/winrt-x64-msvc2015/qmake.conf | 1 + mkspecs/winrt-x86-msvc2015/qmake.conf | 1 + 6 files changed, 65 insertions(+), 49 deletions(-) create mode 100644 mkspecs/common/msvc-base.conf diff --git a/mkspecs/common/msvc-base.conf b/mkspecs/common/msvc-base.conf new file mode 100644 index 0000000000..5bd144faa0 --- /dev/null +++ b/mkspecs/common/msvc-base.conf @@ -0,0 +1,56 @@ +# +# qmake configuration for Microsoft Visual Studio C/C++ Compiler +# This mkspec is used for all win32-msvcXXXX, winrt-XXX-msvcXXX +# and winphone-XXX-msvcXXX specs +# + +# +# Version-specific changes +# + +greaterThan(MSC_VER, 1499) { + # Visual Studio 2008 (9.0) / Visual C++ 15.0 and up + QMAKE_CFLAGS_MP = -MP + QMAKE_CXXFLAGS_MP = $$QMAKE_CFLAGS_MP +} + +greaterThan(MSC_VER, 1599) { + # Visual Studio 2010 (10.0) / Visual C++ 16.0 and up + MAKEFILE_GENERATOR = MSBUILD + + QMAKE_CFLAGS_AVX = -arch:AVX + QMAKE_CFLAGS_AVX2 = -arch:AVX + + VCPROJ_EXTENSION = .vcxproj +} + +greaterThan(MSC_VER, 1699) { + # Visual Studio 2012 (11.0) / Visual C++ 17.0 and up + QMAKE_CXXFLAGS_EXCEPTIONS_OFF = -D_HAS_EXCEPTIONS=0 + QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE@QMAKE_SUBSYSTEM_SUFFIX@ + QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS@QMAKE_SUBSYSTEM_SUFFIX@ + QT_CONFIG += c++11 + CONFIG += c++11 +} + +greaterThan(MSC_VER, 1799) { + # Visual Studio 2013 (12.0) / Visual C++ 18.0 and up + QMAKE_CFLAGS += -FS + QMAKE_CXXFLAGS += -FS + + equals(MSC_VER, 1800) { + QMAKE_CFLAGS_RELEASE += -Zc:strictStrings + QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -Zc:strictStrings + QMAKE_CXXFLAGS_RELEASE += -Zc:strictStrings + QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += -Zc:strictStrings + } +} + +greaterThan(MSC_VER, 1899) { + # Visual Studio 2015 (14.0) / Visual C++ 19.0 and up + QMAKE_CFLAGS += -Zc:strictStrings + QMAKE_CFLAGS_WARN_ON += -w44456 -w44457 -w44458 + QMAKE_CFLAGS_AVX2 = -arch:AVX2 + QMAKE_CXXFLAGS += -Zc:strictStrings -Zc:throwingNew + QMAKE_CXXFLAGS_WARN_ON += -w44456 -w44457 -w44458 -wd4577 +} diff --git a/mkspecs/common/msvc-desktop.conf b/mkspecs/common/msvc-desktop.conf index a1c436388c..3aeb331de6 100644 --- a/mkspecs/common/msvc-desktop.conf +++ b/mkspecs/common/msvc-desktop.conf @@ -97,54 +97,6 @@ VCPROJ_EXTENSION = .vcproj VCSOLUTION_EXTENSION = .sln VCPROJ_KEYWORD = Qt4VSv1.0 -# -# Version-specific changes -# -greaterThan(MSC_VER, 1499) { - # Visual Studio 2008 (9.0) / Visual C++ 15.0 and up - QMAKE_CFLAGS_MP = -MP - QMAKE_CXXFLAGS_MP = $$QMAKE_CFLAGS_MP -} - -greaterThan(MSC_VER, 1599) { - # Visual Studio 2010 (10.0) / Visual C++ 16.0 and up - MAKEFILE_GENERATOR = MSBUILD - - QMAKE_CFLAGS_AVX = -arch:AVX - QMAKE_CFLAGS_AVX2 = -arch:AVX - - VCPROJ_EXTENSION = .vcxproj -} - -greaterThan(MSC_VER, 1699) { - # Visual Studio 2012 (11.0) / Visual C++ 17.0 and up - QMAKE_CXXFLAGS_EXCEPTIONS_OFF = -D_HAS_EXCEPTIONS=0 - QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE@QMAKE_SUBSYSTEM_SUFFIX@ - QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS@QMAKE_SUBSYSTEM_SUFFIX@ - QT_CONFIG += c++11 - CONFIG += c++11 -} - -greaterThan(MSC_VER, 1799) { - # Visual Studio 2013 (12.0) / Visual C++ 18.0 and up - QMAKE_CFLAGS += -FS - QMAKE_CXXFLAGS += -FS - - equals(MSC_VER, 1800) { - QMAKE_CFLAGS_RELEASE += -Zc:strictStrings - QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -Zc:strictStrings - QMAKE_CXXFLAGS_RELEASE += -Zc:strictStrings - QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += -Zc:strictStrings - } -} - -greaterThan(MSC_VER, 1899) { - # Visual Studio 2015 (14.0) / Visual C++ 19.0 and up - QMAKE_CFLAGS += -Zc:strictStrings - QMAKE_CFLAGS_WARN_ON += -w44456 -w44457 -w44458 - QMAKE_CFLAGS_AVX2 = -arch:AVX2 - QMAKE_CXXFLAGS += -Zc:strictStrings -Zc:throwingNew - QMAKE_CXXFLAGS_WARN_ON += -w44456 -w44457 -w44458 -wd4577 -} +include(msvc-base.conf) unset(MSC_VER) diff --git a/mkspecs/common/winrt_winphone/qmake.conf b/mkspecs/common/winrt_winphone/qmake.conf index 288043da88..e94b4b72fa 100644 --- a/mkspecs/common/winrt_winphone/qmake.conf +++ b/mkspecs/common/winrt_winphone/qmake.conf @@ -92,4 +92,9 @@ VCPROJ_EXTENSION = .vcxproj VCSOLUTION_EXTENSION = .sln VCPROJ_KEYWORD = Qt4VSv1.0 WINRT_ASSETS_PATH = $$PWD/assets + +include(../msvc-base.conf) + +unset(MSC_VER) + load(qt_config) diff --git a/mkspecs/winrt-arm-msvc2015/qmake.conf b/mkspecs/winrt-arm-msvc2015/qmake.conf index a5bb342456..7a9375246d 100644 --- a/mkspecs/winrt-arm-msvc2015/qmake.conf +++ b/mkspecs/winrt-arm-msvc2015/qmake.conf @@ -4,6 +4,7 @@ # Written for Microsoft Visual C++ 2015 # +MSC_VER = 1900 include(../common/winrt_winphone/qmake.conf) QMAKE_COMPILER_DEFINES += _MSC_VER=1900 DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 ARM __ARM__ __arm__ diff --git a/mkspecs/winrt-x64-msvc2015/qmake.conf b/mkspecs/winrt-x64-msvc2015/qmake.conf index 5b82f79981..ca2dc88bf0 100644 --- a/mkspecs/winrt-x64-msvc2015/qmake.conf +++ b/mkspecs/winrt-x64-msvc2015/qmake.conf @@ -4,6 +4,7 @@ # Written for Microsoft Visual C++ 2015 # +MSC_VER = 1900 include(../common/winrt_winphone/qmake.conf) QMAKE_COMPILER_DEFINES += _MSC_VER=1900 _WIN32 DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 X64 __X64__ __x64__ diff --git a/mkspecs/winrt-x86-msvc2015/qmake.conf b/mkspecs/winrt-x86-msvc2015/qmake.conf index bc7cf4118e..3b2681e93d 100644 --- a/mkspecs/winrt-x86-msvc2015/qmake.conf +++ b/mkspecs/winrt-x86-msvc2015/qmake.conf @@ -4,6 +4,7 @@ # Written for Microsoft Visual C++ 2015 # +MSC_VER = 1900 include(../common/winrt_winphone/qmake.conf) QMAKE_COMPILER_DEFINES += _MSC_VER=1900 _WIN32 DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 X86 __X86__ __x86__ -- cgit v1.2.3 From 5af6efc911f80b6d8dea4d29879cc9e76da492e6 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Thu, 19 Nov 2015 00:33:10 +0100 Subject: Call setLayoutDirection() in QGuiApplicationPrivate::init() if not called before Without this patch, setLayoutDirection() is called only by LanguageChange event handling, which triggers only upon installing, removing, or clearing QTranslators. This caused two problems: * If the QTranslators are installed in a Q_COREAPP_STARTUP_FUNCTION the event is lost since the QGuiApplication is still not there. * If the application doesn't use QTranslators at all, i.e., uses gettext, some other translation system, or because it has no messages at all, setLayoutDirection() is never called and the layout direction is wrong. The initialization of layout_direction has been changed from Qt::LeftToRight to Qt::LayoutDirectionAuto but that has no impact since QGuiApplication::layoutDirection will make sure Qt::LeftToRight is returned if layout_direction has still not been set. Change-Id: Ic60fe9a318c8afe1c503e3796ec54cfc687e7164 Reviewed-by: Oswald Buddenhagen --- src/gui/kernel/qguiapplication.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 00bad52432..087bed439c 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -163,7 +163,7 @@ int QGuiApplicationPrivate::mouse_double_click_distance = -1; QWindow *QGuiApplicationPrivate::currentMousePressWindow = 0; -static Qt::LayoutDirection layout_direction = Qt::LeftToRight; +static Qt::LayoutDirection layout_direction = Qt::LayoutDirectionAuto; static bool force_reverse = false; QGuiApplicationPrivate *QGuiApplicationPrivate::self = 0; @@ -1273,7 +1273,6 @@ void QGuiApplicationPrivate::init() pluginList << argv[i]; } else if (arg == "-reverse") { force_reverse = true; - QGuiApplication::setLayoutDirection(Qt::RightToLeft); #ifdef Q_OS_MAC } else if (arg.startsWith("-psn_")) { // eat "-psn_xxxx" on Mac, which is passed when starting an app from Finder. @@ -1397,6 +1396,9 @@ void QGuiApplicationPrivate::init() #else Q_UNUSED(loadTestability); #endif // QT_NO_LIBRARY + + if (layout_direction == Qt::LayoutDirectionAuto || force_reverse) + QGuiApplication::setLayoutDirection(qt_detectRTLLanguage() ? Qt::RightToLeft : Qt::LeftToRight); } extern void qt_cleanupFontDatabase(); @@ -3254,7 +3256,10 @@ void QGuiApplication::setLayoutDirection(Qt::LayoutDirection direction) Qt::LayoutDirection QGuiApplication::layoutDirection() { - return layout_direction; + // layout_direction is only ever Qt::LayoutDirectionAuto if setLayoutDirection + // was never called, or called with Qt::LayoutDirectionAuto (which is a no-op). + // In that case we return the default LeftToRight. + return layout_direction == Qt::LayoutDirectionAuto ? Qt::LeftToRight : layout_direction; } /*! -- cgit v1.2.3 From b0ec05f27bff6065c97e6e4a0f1606da7472d18c Mon Sep 17 00:00:00 2001 From: Jan Arve Saether Date: Thu, 29 Oct 2015 13:16:31 +0100 Subject: Rename ANGLE libs in order to not conflict with other ANGLE libs This is needed to be able to use Qt (with dynamic ANGLE) in a plugin while the host runs a different version of Qt (and ANGLE). In addition to changing the LIBEGL_NAME and LIBGLESV2_NAME variables you also need to update the value of the LIBRARY definition in the .def files for ANGLE: qtbase/src/3rdparty/angle/src/libGLESv2/libGLESv2[d?].def qtbase/src/3rdparty/angle/src/libGLESv2/libEGL[d?].def Task-number: QTBUG-48431 Change-Id: Idd00d039ba3e20cc0ec7496bee36ed1c90383b0d Reviewed-by: Friedemann Kleint --- mkspecs/common/angle.conf | 9 +++++++++ mkspecs/common/msvc-desktop.conf | 6 ++++-- mkspecs/common/wince/qmake.conf | 6 ++++-- mkspecs/common/winrt_winphone/qmake.conf | 6 ++++-- mkspecs/win32-g++/qmake.conf | 5 +++-- mkspecs/wince70embedded-armv4i-msvc2008/qmake.conf | 2 +- mkspecs/wince80colibri-armv7-msvc2012/qmake.conf | 2 +- src/angle/src/libEGL/libEGL.pro | 9 +++++---- src/angle/src/libGLESv2/libGLESv2.pro | 6 ++++-- src/plugins/platforms/windows/qwindowseglcontext.cpp | 17 +++++++++-------- src/plugins/platforms/windows/windows.pri | 3 +++ 11 files changed, 47 insertions(+), 24 deletions(-) create mode 100644 mkspecs/common/angle.conf diff --git a/mkspecs/common/angle.conf b/mkspecs/common/angle.conf new file mode 100644 index 0000000000..fffdb581c5 --- /dev/null +++ b/mkspecs/common/angle.conf @@ -0,0 +1,9 @@ +# Renaming these files requires that the LIBRARY entry of their corresponding +# def files are also updated to reflect the name. +# The .def files are found in the angle directories: +# +# qtbase\src\3rdparty\angle\src\libEGL\libEGL[d?].def +# qtbase\src\3rdparty\angle\src\libEGL\libGLESv2[d?].def + +LIBEGL_NAME="libEGL" +LIBGLESV2_NAME="libGLESv2" diff --git a/mkspecs/common/msvc-desktop.conf b/mkspecs/common/msvc-desktop.conf index 3aeb331de6..eec9e1f688 100644 --- a/mkspecs/common/msvc-desktop.conf +++ b/mkspecs/common/msvc-desktop.conf @@ -9,6 +9,8 @@ isEmpty(MSC_VER)|isEmpty(MSVC_VER): error("Source mkspec must set both MSC_VER a # Baseline: Visual Studio 2005 (8.0), VC++ 14.0 # +include(angle.conf) + MAKEFILE_GENERATOR = MSVC.NET QMAKE_PLATFORM = win32 QMAKE_COMPILER = msvc @@ -83,8 +85,8 @@ QMAKE_LIBS_CORE = kernel32.lib user32.lib shell32.lib uuid.lib ole32.lib QMAKE_LIBS_GUI = gdi32.lib comdlg32.lib oleaut32.lib imm32.lib winmm.lib ws2_32.lib ole32.lib user32.lib advapi32.lib QMAKE_LIBS_NETWORK = ws2_32.lib QMAKE_LIBS_OPENGL = glu32.lib opengl32.lib gdi32.lib user32.lib -QMAKE_LIBS_OPENGL_ES2 = libEGL.lib libGLESv2.lib gdi32.lib user32.lib -QMAKE_LIBS_OPENGL_ES2_DEBUG = libEGLd.lib libGLESv2d.lib gdi32.lib user32.lib +QMAKE_LIBS_OPENGL_ES2 = $${LIBEGL_NAME}.lib $${LIBGLESV2_NAME}.lib gdi32.lib user32.lib +QMAKE_LIBS_OPENGL_ES2_DEBUG = $${LIBEGL_NAME}d.lib $${LIBGLESV2_NAME}d.lib gdi32.lib user32.lib QMAKE_LIBS_COMPAT = advapi32.lib shell32.lib comdlg32.lib user32.lib gdi32.lib ws2_32.lib QMAKE_LIBS_QT_ENTRY = -lqtmain diff --git a/mkspecs/common/wince/qmake.conf b/mkspecs/common/wince/qmake.conf index 224c350e2f..fa1a72a1b9 100644 --- a/mkspecs/common/wince/qmake.conf +++ b/mkspecs/common/wince/qmake.conf @@ -2,6 +2,8 @@ # qmake configuration for common Windows CE # +include(../angle.conf) + MAKEFILE_GENERATOR = MSVC.NET QMAKE_PLATFORM += wince win32 CONFIG += incremental flat precompile_header autogen_precompile_source debug_and_release debug_and_release_target @@ -67,8 +69,8 @@ QMAKE_EXTENSION_SHLIB = dll QMAKE_PREFIX_STATICLIB = QMAKE_EXTENSION_STATICLIB = lib -QMAKE_LIBS_EGL = libEGL.lib -QMAKE_LIBS_OPENGL_ES2 = libGLESv2.lib +QMAKE_LIBS_EGL = $${LIBEGL_NAME}.lib +QMAKE_LIBS_OPENGL_ES2 = $${LIBGLESV2_NAME}.lib QMAKE_LIBS_QT_ENTRY = -lqtmain diff --git a/mkspecs/common/winrt_winphone/qmake.conf b/mkspecs/common/winrt_winphone/qmake.conf index e94b4b72fa..bf237882ff 100644 --- a/mkspecs/common/winrt_winphone/qmake.conf +++ b/mkspecs/common/winrt_winphone/qmake.conf @@ -4,6 +4,8 @@ # Written for Microsoft Visual C++ # +include(../angle.conf) + MAKEFILE_GENERATOR = MSBUILD QMAKE_COMPILER = msvc QMAKE_PLATFORM = winrt win32 @@ -79,8 +81,8 @@ QMAKE_LIBS += runtimeobject.lib QMAKE_LIBS_CORE = QMAKE_LIBS_GUI = QMAKE_LIBS_NETWORK = -QMAKE_LIBS_OPENGL_ES2 = libEGL.lib libGLESv2.lib -QMAKE_LIBS_OPENGL_ES2_DEBUG = libEGLd.lib libGLESv2d.lib +QMAKE_LIBS_OPENGL_ES2 = $${LIBEGL_NAME}.lib $${LIBGLESV2_NAME}.lib +QMAKE_LIBS_OPENGL_ES2_DEBUG = $${LIBEGL_NAME}d.lib $${LIBGLESV2_NAME}d.lib QMAKE_LIBS_QT_ENTRY = -lqtmain diff --git a/mkspecs/win32-g++/qmake.conf b/mkspecs/win32-g++/qmake.conf index c00b4cd5ff..9cb811b5bf 100644 --- a/mkspecs/win32-g++/qmake.conf +++ b/mkspecs/win32-g++/qmake.conf @@ -8,6 +8,7 @@ # load(device_config) +include(../common/angle.conf) MAKEFILE_GENERATOR = MINGW QMAKE_PLATFORM = win32 mingw @@ -98,8 +99,8 @@ QMAKE_LIBS_CORE = -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 QMAKE_LIBS_GUI = -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lws2_32 -lole32 -luuid -luser32 -ladvapi32 QMAKE_LIBS_NETWORK = -lws2_32 QMAKE_LIBS_OPENGL = -lglu32 -lopengl32 -lgdi32 -luser32 -QMAKE_LIBS_OPENGL_ES2 = -llibEGL -llibGLESv2 -lgdi32 -luser32 -QMAKE_LIBS_OPENGL_ES2_DEBUG = -llibEGLd -llibGLESv2d -lgdi32 -luser32 +QMAKE_LIBS_OPENGL_ES2 = -l$${LIBEGL_NAME} -l$${LIBGLESV2_NAME} -lgdi32 -luser32 +QMAKE_LIBS_OPENGL_ES2_DEBUG = -l$${LIBEGL_NAME}d -l$${LIBGLESV2_NAME}d -lgdi32 -luser32 QMAKE_LIBS_COMPAT = -ladvapi32 -lshell32 -lcomdlg32 -luser32 -lgdi32 -lws2_32 QMAKE_LIBS_QT_ENTRY = -lmingw32 -lqtmain diff --git a/mkspecs/wince70embedded-armv4i-msvc2008/qmake.conf b/mkspecs/wince70embedded-armv4i-msvc2008/qmake.conf index 772a514b89..860fbc0e6a 100644 --- a/mkspecs/wince70embedded-armv4i-msvc2008/qmake.conf +++ b/mkspecs/wince70embedded-armv4i-msvc2008/qmake.conf @@ -21,7 +21,7 @@ QMAKE_LIBS_NETWORK = ws2.lib $$QMAKE_LIBS_GUI QMAKE_LIBS_OPENGL = QMAKE_LIBS_COMPAT = QMAKE_LIBS_OPENVG = libopenvg.lib -QMAKE_LIBS_OPENGL_ES2 = libEGL.lib libGLESv2.lib +QMAKE_LIBS_OPENGL_ES2 = $${LIBEGL_NAME}.lib $${LIBGLESV2_NAME}.lib QMAKE_RC = rc diff --git a/mkspecs/wince80colibri-armv7-msvc2012/qmake.conf b/mkspecs/wince80colibri-armv7-msvc2012/qmake.conf index 47c512bbda..ea86bc0071 100644 --- a/mkspecs/wince80colibri-armv7-msvc2012/qmake.conf +++ b/mkspecs/wince80colibri-armv7-msvc2012/qmake.conf @@ -36,7 +36,7 @@ QMAKE_LIBS_NETWORK = ws2.lib $$QMAKE_LIBS_GUI QMAKE_LIBS_OPENGL = QMAKE_LIBS_COMPAT = QMAKE_LIBS_OPENVG = -QMAKE_LIBS_OPENGL_ES2 = libEGL.lib libGLESv2.lib +QMAKE_LIBS_OPENGL_ES2 = $${LIBEGL_NAME}.lib $${LIBGLESV2_NAME}.lib QMAKE_LIBDIR_OPENGL_ES2 = $$(NV_WINCE_T2_PLAT)/lib/Test QMAKE_INCDIR_EGL = $$(NV_WINCE_T2_PLAT)/include QMAKE_LIBDIR_EGL = $$(NV_WINCE_T2_PLAT)/lib/Test diff --git a/src/angle/src/libEGL/libEGL.pro b/src/angle/src/libEGL/libEGL.pro index 94fcebda6b..695f7fd50c 100644 --- a/src/angle/src/libEGL/libEGL.pro +++ b/src/angle/src/libEGL/libEGL.pro @@ -1,9 +1,10 @@ CONFIG += installed include(../common/common.pri) - +DEF_FILE_TARGET=$${TARGET} +TARGET=$$qtLibraryTarget($${LIBEGL_NAME}) winrt: LIBS_PRIVATE += -ld3d11 -LIBS_PRIVATE += -ldxguid -L$$QT_BUILD_TREE/lib -l$$qtLibraryTarget(libGLESv2) +LIBS_PRIVATE += -ldxguid -L$$QT_BUILD_TREE/lib -l$$qtLibraryTarget($${LIBGLESV2_NAME}) DEFINES += GL_APICALL= GL_GLEXT_PROTOTYPES= EGLAPI= LIBEGL_IMPLEMENTATION @@ -14,8 +15,8 @@ SOURCES += \ $$ANGLE_DIR/src/libEGL/libEGL.cpp !static { - DEF_FILE = $$ANGLE_DIR/src/libEGL/$${TARGET}.def - mingw:equals(QT_ARCH, i386): DEF_FILE = $$ANGLE_DIR/src/libEGL/$${TARGET}_mingw32.def + DEF_FILE = $$ANGLE_DIR/src/libEGL/$${DEF_FILE_TARGET}.def + mingw:equals(QT_ARCH, i386): DEF_FILE = $$ANGLE_DIR/src/libEGL/$${DEF_FILE_TARGET}_mingw32.def } egl_headers.files = \ diff --git a/src/angle/src/libGLESv2/libGLESv2.pro b/src/angle/src/libGLESv2/libGLESv2.pro index 5979b68098..1da079fd40 100644 --- a/src/angle/src/libGLESv2/libGLESv2.pro +++ b/src/angle/src/libGLESv2/libGLESv2.pro @@ -1,5 +1,7 @@ CONFIG += simd installed include(../common/common.pri) +DEF_FILE_TARGET=$${TARGET} +TARGET=$$qtLibraryTarget($${LIBGLESV2_NAME}) INCLUDEPATH += $$OUT_PWD/.. $$ANGLE_DIR/src/libANGLE @@ -327,8 +329,8 @@ angle_d3d11 { } !static { - DEF_FILE = $$ANGLE_DIR/src/libGLESv2/$${TARGET}.def - mingw:equals(QT_ARCH, i386): DEF_FILE = $$ANGLE_DIR/src/libGLESv2/$${TARGET}_mingw32.def + DEF_FILE = $$ANGLE_DIR/src/libGLESv2/$${DEF_FILE_TARGET}.def + mingw:equals(QT_ARCH, i386): DEF_FILE = $$ANGLE_DIR/src/libGLESv2/$${DEF_FILE_TARGET}_mingw32.def } else { DEFINES += DllMain=DllMain_ANGLE # prevent symbol from conflicting with the user's DllMain } diff --git a/src/plugins/platforms/windows/qwindowseglcontext.cpp b/src/plugins/platforms/windows/qwindowseglcontext.cpp index 21eba6da7e..65a9763be6 100644 --- a/src/plugins/platforms/windows/qwindowseglcontext.cpp +++ b/src/plugins/platforms/windows/qwindowseglcontext.cpp @@ -118,11 +118,11 @@ void *QWindowsLibEGL::resolve(const char *name) bool QWindowsLibEGL::init() { -#ifdef QT_DEBUG - const char dllName[] = "libEGLd.dll"; -#else - const char dllName[] = "libEGL.dll"; + const char dllName[] = QT_STRINGIFY(LIBEGL_NAME) +#if defined(QT_DEBUG) && !defined(Q_OS_WINCE) + "d" #endif + ""; qCDebug(lcQpaGl) << "Qt: Using EGL from" << dllName; @@ -178,11 +178,12 @@ void *QWindowsLibGLESv2::resolve(const char *name) bool QWindowsLibGLESv2::init() { -#ifdef QT_DEBUG - const char dllName[] = "libGLESv2d.dll"; -#else - const char dllName[] = "libGLESv2.dll"; + + const char dllName[] = QT_STRINGIFY(LIBGLESV2_NAME) +#if defined(QT_DEBUG) && !defined(Q_OS_WINCE) + "d" #endif + ""; qCDebug(lcQpaGl) << "Qt: Using OpenGL ES 2.0 from" << dllName; #if !defined(QT_STATIC) || defined(QT_OPENGL_DYNAMIC) diff --git a/src/plugins/platforms/windows/windows.pri b/src/plugins/platforms/windows/windows.pri index 29297116da..065108cb03 100644 --- a/src/plugins/platforms/windows/windows.pri +++ b/src/plugins/platforms/windows/windows.pri @@ -132,3 +132,6 @@ contains(QT_CONFIG, freetype) { } contains(QT_CONFIG, accessibility):include($$PWD/accessible/accessible.pri) + +DEFINES *= LIBEGL_NAME=$${LIBEGL_NAME} +DEFINES *= LIBGLESV2_NAME=$${LIBGLESV2_NAME} -- cgit v1.2.3 From 5d63e325faa44cf1345d6f7b5cb39ec874527675 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 30 Nov 2015 11:31:43 +0100 Subject: Avoid dynamic switching between backingstore composition paths Make it opt-in because doing a normal backingstore flush does not seem to work on Cocoa once we use OpenGL on the window. Windows and Linux should be able to cope with this. This means that platforms outside Windows and Linux will continue to have the problem of having GL-based compositing enabled for ever after having a QOpenGL/QuickWidget shown in the window once, but the issue is most prevalent on Windows anyway, OS X machines can deal with OpenGL better in general. Task-number: QTBUG-49172 Change-Id: I30fd2efa95cc4f6eed9cf7f7613d0750355c775c Reviewed-by: Lars Knoll Reviewed-by: Eike Ziller Reviewed-by: Paul Olav Tvete --- src/gui/kernel/qplatformintegration.h | 3 ++- src/plugins/platforms/windows/qwindowsintegration.cpp | 2 ++ src/plugins/platforms/xcb/qxcbintegration.cpp | 1 + src/widgets/kernel/qwidgetbackingstore.cpp | 17 ++++++++++++++++- 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qplatformintegration.h b/src/gui/kernel/qplatformintegration.h index 00c50a9861..af89a73455 100644 --- a/src/gui/kernel/qplatformintegration.h +++ b/src/gui/kernel/qplatformintegration.h @@ -91,7 +91,8 @@ public: SyncState, RasterGLSurface, AllGLFunctionsQueryable, - ApplicationIcon + ApplicationIcon, + SwitchableWidgetComposition }; virtual ~QPlatformIntegration() { } diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp index 6b50ebe8a1..55e6d55e5b 100644 --- a/src/plugins/platforms/windows/qwindowsintegration.cpp +++ b/src/plugins/platforms/windows/qwindowsintegration.cpp @@ -282,6 +282,8 @@ bool QWindowsIntegration::hasCapability(QPlatformIntegration::Capability cap) co return true; case AllGLFunctionsQueryable: return true; + case SwitchableWidgetComposition: + return true; default: return QPlatformIntegration::hasCapability(cap); } diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp index 9cedfa77ad..19e8b1de7d 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.cpp +++ b/src/plugins/platforms/xcb/qxcbintegration.cpp @@ -252,6 +252,7 @@ bool QXcbIntegration::hasCapability(QPlatformIntegration::Capability cap) const case ForeignWindows: return true; case SyncState: return true; case RasterGLSurface: return true; + case SwitchableWidgetComposition: return true; default: return QPlatformIntegration::hasCapability(cap); } } diff --git a/src/widgets/kernel/qwidgetbackingstore.cpp b/src/widgets/kernel/qwidgetbackingstore.cpp index 6d43adc33b..b86c376385 100644 --- a/src/widgets/kernel/qwidgetbackingstore.cpp +++ b/src/widgets/kernel/qwidgetbackingstore.cpp @@ -104,7 +104,6 @@ void QWidgetBackingStore::qt_flush(QWidget *widget, const QRegion ®ion, QBack #ifndef QT_NO_OPENGL if (widgetTextures) { - Q_ASSERT(!widgetTextures->isEmpty()); qt_window_private(tlw->windowHandle())->compositing = true; widget->window()->d_func()->sendComposeStatus(widget->window(), false); // A window may have alpha even when the app did not request @@ -955,6 +954,8 @@ static void findAllTextureWidgetsRecursively(QWidget *tlw, QWidget *widget) } } +Q_GLOBAL_STATIC(QPlatformTextureList, qt_dummy_platformTextureList) + static QPlatformTextureList *widgetTexturesFor(QWidget *tlw, QWidget *widget) { foreach (QPlatformTextureList *tl, QWidgetPrivate::get(tlw)->topData()->widgetTextures) { @@ -965,6 +966,20 @@ static QPlatformTextureList *widgetTexturesFor(QWidget *tlw, QWidget *widget) return tl; } } + + if (QWidgetPrivate::get(tlw)->textureChildSeen) { + // No render-to-texture widgets in the (sub-)tree due to hidden or native + // children. Returning null results in using the normal backingstore flush path + // without OpenGL-based compositing. This is very desirable normally. However, + // some platforms cannot handle switching between the non-GL and GL paths for + // their windows so it has to be opt-in. + static bool switchableWidgetComposition = + QGuiApplicationPrivate::instance()->platformIntegration() + ->hasCapability(QPlatformIntegration::SwitchableWidgetComposition); + if (!switchableWidgetComposition) + return qt_dummy_platformTextureList(); + } + return 0; } -- cgit v1.2.3 From 5f00d18ad34979f57d6c17770ee9df5a2acb93e6 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 1 Oct 2015 11:40:49 +0200 Subject: Windows QPA: Fix window state transition from minimized to normal. Use SW_SHOWNORMAL instead SW_SHOWNOACTIVATE as a parameter to ShowWindow() to enforce the window to be restored to normal state, even if the state before minimized was maximized. Task-number: QTBUG-48449 Change-Id: I9436623b1495f574a72050e50e8b31bfc83ced5c Reviewed-by: Andy Shaw --- src/plugins/platforms/windows/qwindowswindow.cpp | 2 +- tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index c49682cc26..48484209b5 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1779,7 +1779,7 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowState newState) if ((oldState == Qt::WindowMinimized) != (newState == Qt::WindowMinimized)) { if (visible) ShowWindow(m_data.hwnd, (newState == Qt::WindowMinimized) ? SW_MINIMIZE : - (newState == Qt::WindowMaximized) ? SW_MAXIMIZE : SW_SHOWNOACTIVATE); + (newState == Qt::WindowMaximized) ? SW_MAXIMIZE : SW_SHOWNORMAL); } qCDebug(lcQpaWindows) << '<' << __FUNCTION__ << this << window() << newState; } diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index f3f4467b80..97c23ddf26 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -1860,10 +1860,6 @@ void tst_QWidget::activation() QCOMPARE(QApplication::activeWindow(), &widget1); widget2.showNormal(); QTest::qWait(waitTime); -#ifndef Q_OS_WINCE - if (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA) - QEXPECT_FAIL("", "MS introduced new behavior after XP", Continue); -#endif QTest::qWait(waitTime); QCOMPARE(QApplication::activeWindow(), &widget2); widget2.hide(); -- cgit v1.2.3 From d76be5530a9e8915228db8deeaab3753aebc6367 Mon Sep 17 00:00:00 2001 From: James McDonnell Date: Fri, 27 Nov 2015 10:55:34 -0500 Subject: Use correct test to add C++14 to the project configuration Only add C++14 to the project configuration when C++14 support is available on the platform. Adding it because the platform supports C++11 doesn't work when the platform _only_ supports C++11 (e.g., QNX 6.6.0). Task-number: QTBUG-49491 Change-Id: I15de38bb06d912a314b9dd18c80b513cc06a855e Reviewed-by: Marc Mutz Reviewed-by: Thiago Macieira --- tests/auto/corelib/global/qflags/qflags.pro | 3 ++- tests/auto/corelib/global/qlogging/test/test.pro | 3 ++- tests/auto/corelib/tools/qlatin1string/qlatin1string.pro | 3 ++- tests/auto/corelib/tools/qversionnumber/qversionnumber.pro | 3 ++- tests/auto/other/compiler/compiler.pro | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/auto/corelib/global/qflags/qflags.pro b/tests/auto/corelib/global/qflags/qflags.pro index 3f78bc045b..7602008e22 100644 --- a/tests/auto/corelib/global/qflags/qflags.pro +++ b/tests/auto/corelib/global/qflags/qflags.pro @@ -3,4 +3,5 @@ TARGET = tst_qflags QT = core testlib SOURCES = tst_qflags.cpp DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 -contains(QT_CONFIG, c++11): CONFIG += c++11 c++14 +contains(QT_CONFIG, c++11): CONFIG += c++11 +contains(QT_CONFIG, c++14): CONFIG += c++14 diff --git a/tests/auto/corelib/global/qlogging/test/test.pro b/tests/auto/corelib/global/qlogging/test/test.pro index d4dce4a0c3..fdebf45281 100644 --- a/tests/auto/corelib/global/qlogging/test/test.pro +++ b/tests/auto/corelib/global/qlogging/test/test.pro @@ -1,6 +1,7 @@ CONFIG += testcase parallel_test CONFIG -= app_bundle debug_and_release_target -contains(QT_CONFIG, c++11): CONFIG += c++11 c++14 +contains(QT_CONFIG, c++11): CONFIG += c++11 +contains(QT_CONFIG, c++14): CONFIG += c++14 TARGET = ../tst_qlogging QT = core testlib SOURCES = ../tst_qlogging.cpp diff --git a/tests/auto/corelib/tools/qlatin1string/qlatin1string.pro b/tests/auto/corelib/tools/qlatin1string/qlatin1string.pro index 219afa661b..a996dab23e 100644 --- a/tests/auto/corelib/tools/qlatin1string/qlatin1string.pro +++ b/tests/auto/corelib/tools/qlatin1string/qlatin1string.pro @@ -3,6 +3,7 @@ TARGET = tst_qlatin1string QT = core testlib SOURCES = tst_qlatin1string.cpp DEFINES += QT_NO_CAST_TO_ASCII -contains(QT_CONFIG,c++11): CONFIG += c++11 c++14 +contains(QT_CONFIG,c++11): CONFIG += c++11 +contains(QT_CONFIG,c++14): CONFIG += c++14 DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/tools/qversionnumber/qversionnumber.pro b/tests/auto/corelib/tools/qversionnumber/qversionnumber.pro index ba4b2b40cb..e83a2b507c 100644 --- a/tests/auto/corelib/tools/qversionnumber/qversionnumber.pro +++ b/tests/auto/corelib/tools/qversionnumber/qversionnumber.pro @@ -1,5 +1,6 @@ CONFIG += testcase parallel_test -contains(QT_CONFIG, c++11):CONFIG += c++11 c++14 +contains(QT_CONFIG, c++11):CONFIG += c++11 +contains(QT_CONFIG, c++14):CONFIG += c++14 TARGET = tst_qversionnumber QT = core testlib SOURCES = tst_qversionnumber.cpp diff --git a/tests/auto/other/compiler/compiler.pro b/tests/auto/other/compiler/compiler.pro index 213429050f..356013c8f1 100644 --- a/tests/auto/other/compiler/compiler.pro +++ b/tests/auto/other/compiler/compiler.pro @@ -3,7 +3,8 @@ TARGET = tst_compiler SOURCES += tst_compiler.cpp baseclass.cpp derivedclass.cpp othersource.cpp HEADERS += baseclass.h derivedclass.h QT = core testlib -contains(QT_CONFIG, c++11): CONFIG += c++14 c++11 +contains(QT_CONFIG, c++11): CONFIG += c++11 +contains(QT_CONFIG, c++14): CONFIG += c++14 DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 -- cgit v1.2.3 From 8b8e8a33b35ed7307b95172f9602b458d1b71bc8 Mon Sep 17 00:00:00 2001 From: Mathew Sutcliffe Date: Fri, 27 Nov 2015 18:03:37 +0000 Subject: qmake: Correctly handle shadow build of nested vcsubdirs projects. For some reason, the solution generator was looking for the vcproj files in the source tree. It should look for them in the output tree instead (suggested by Joerg Bornemann). This should handle both in-source and out-of-source builds, and the special-case code for handling out-of-source builds (which had a bug) can be removed. Task-number: QTBUG-49665 Change-Id: I40b5c5907c52ffb074ccb8f297bb5924eacc1cb0 Reviewed-by: Oliver Wolff Reviewed-by: Oswald Buddenhagen Reviewed-by: Andy Shaw Reviewed-by: Joerg Bornemann --- qmake/generators/win32/msvc_vcproj.cpp | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index 47f99a5c8e..c9f0d92eb9 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -532,31 +532,13 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHashfirst("QMAKE_PROJECT_NAME") + project->first("VCPROJ_EXTENSION"); - QString vcprojDir = qmake_getpwd(); + QString vcprojDir = Option::output_dir; // If file doesn't exsist, then maybe the users configuration // doesn't allow it to be created. Skip to next... if (!exists(vcprojDir + Option::dir_sep + vcproj)) { - // Try to find the directory which fits relative - // to the output path, which represents the shadow - // path in case we are shadow building - QStringList list = fi.path().split(QLatin1Char('/')); - QString tmpDir = QFileInfo(Option::output).path() + Option::dir_sep; - bool found = false; - for (int i = list.size() - 1; i >= 0; --i) { - QString curr; - for (int j = i; j < list.size(); ++j) - curr += list.at(j) + Option::dir_sep; - if (exists(tmpDir + curr + vcproj)) { - vcprojDir = QDir::cleanPath(tmpDir + curr); - found = true; - break; - } - } - if (!found) { - warn_msg(WarnLogic, "Ignored (not found) '%s'", QString(vcprojDir + Option::dir_sep + vcproj).toLatin1().constData()); - goto nextfile; // # Dirty! - } + warn_msg(WarnLogic, "Ignored (not found) '%s'", QString(vcprojDir + Option::dir_sep + vcproj).toLatin1().constData()); + goto nextfile; // # Dirty! } VcsolutionDepend *newDep = new VcsolutionDepend; -- cgit v1.2.3 From ad963ef05beeeb86e5c37567ee868b695b66b9fb Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 2 Dec 2015 10:51:39 +0100 Subject: syncqt: fix false positives in header check Restore the condition for deciding what a private header is from fe383e04 to not check *_pch.h files and third party headers. This amends commit eddb938c. Change-Id: Idc55269478e7f2c98fb7debceef8a53c3cb5c657 Reviewed-by: Friedemann Kleint Reviewed-by: Oswald Buddenhagen --- bin/syncqt.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/syncqt.pl b/bin/syncqt.pl index faa39aa351..72b678041f 100755 --- a/bin/syncqt.pl +++ b/bin/syncqt.pl @@ -1005,7 +1005,10 @@ foreach my $lib (@modules_to_sync) { my $iheader = $subdir . "/" . $header; $iheader =~ s/^\Q$basedir\E/$out_basedir/ if ($shadow); if ($check_includes) { - check_header($lib, $header, $iheader, $public_header, !$public_header && !$qpa_header); + # We need both $public_header and $private_header because QPA headers count as neither + my $private_header = !$public_header && !$qpa_header + && $header =~ /_p\.h$/ && $subdir !~ /3rdparty/; + check_header($lib, $header, $iheader, $public_header, $private_header); } my @classes = $public_header && (!$minimal && $is_qt) ? classNames($iheader, \$clean_header) : (); if($showonly) { -- cgit v1.2.3 From 1b6f705ca73f67e91bd75daabeb1945dce4aefb2 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 1 Dec 2015 16:43:18 +0100 Subject: Windows: Load DirectWrite dynamically. DirectWrite is not supported on Windows XP. Task-number: QTBUG-49711 Change-Id: Ie1df6250814226d53fe4fb3a1c6bd024f6018796 Reviewed-by: Joerg Bornemann --- .../platforms/windows/qwindowsfontdatabase.cpp | 52 +++++++++++++++------- src/plugins/platforms/windows/windows.pri | 1 - 2 files changed, 37 insertions(+), 16 deletions(-) diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp index c8eaccd956..334c6a9407 100644 --- a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp +++ b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp @@ -46,6 +46,7 @@ #include #include #include +#include #include @@ -60,6 +61,38 @@ QT_BEGIN_NAMESPACE +#ifndef QT_NO_DIRECTWRITE +// ### fixme: Consider direct linking of dwrite.dll once Windows Vista pre SP2 is dropped (QTBUG-49711) + +typedef HRESULT (WINAPI *DWriteCreateFactoryType)(DWRITE_FACTORY_TYPE, const IID &, IUnknown **); + +static inline DWriteCreateFactoryType resolveDWriteCreateFactory() +{ + if (QSysInfo::windowsVersion() < QSysInfo::WV_VISTA) + return Q_NULLPTR; + QSystemLibrary library(QStringLiteral("dwrite")); + QFunctionPointer result = library.resolve("DWriteCreateFactory"); + if (Q_UNLIKELY(!result)) { + qWarning("Unable to load dwrite.dll"); + return Q_NULLPTR; + } + return reinterpret_cast(result); +} + +static IDWriteFactory *createDirectWriteFactory() +{ + static const DWriteCreateFactoryType dWriteCreateFactory = resolveDWriteCreateFactory(); + if (!dWriteCreateFactory) + return Q_NULLPTR; + IUnknown *result = Q_NULLPTR; + if (FAILED(dWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory), &result))) { + qErrnoWarning("DWriteCreateFactory failed"); + return Q_NULLPTR; + } + return reinterpret_cast(result); +} +#endif // !QT_NO_DIRECTWRITE + // Helper classes for creating font engines directly from font data namespace { @@ -466,14 +499,9 @@ namespace { class CustomFontFileLoader { public: - CustomFontFileLoader() : m_directWriteFactory(0), m_directWriteFontFileLoader(0) + CustomFontFileLoader() : m_directWriteFactory(createDirectWriteFactory()), m_directWriteFontFileLoader(0) { - HRESULT hres = DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, - __uuidof(IDWriteFactory), - reinterpret_cast(&m_directWriteFactory)); - if (FAILED(hres)) { - qErrnoWarning(hres, "%s: DWriteCreateFactory failed.", __FUNCTION__); - } else { + if (m_directWriteFactory) { m_directWriteFontFileLoader = new DirectWriteFontFileLoader(); m_directWriteFactory->RegisterFontFileLoader(m_directWriteFontFileLoader); } @@ -571,15 +599,9 @@ qreal QWindowsFontDatabase::fontSmoothingGamma() static inline bool initDirectWrite(QWindowsFontEngineData *d) { if (!d->directWriteFactory) { - const HRESULT hr = DWriteCreateFactory( - DWRITE_FACTORY_TYPE_SHARED, - __uuidof(IDWriteFactory), - reinterpret_cast(&d->directWriteFactory) - ); - if (FAILED(hr)) { - qErrnoWarning("%s: DWriteCreateFactory failed", __FUNCTION__); + d->directWriteFactory = createDirectWriteFactory(); + if (!d->directWriteFactory) return false; - } } if (!d->directWriteGdiInterop) { const HRESULT hr = d->directWriteFactory->GetGdiInterop(&d->directWriteGdiInterop); diff --git a/src/plugins/platforms/windows/windows.pri b/src/plugins/platforms/windows/windows.pri index 065108cb03..67af5c03ef 100644 --- a/src/plugins/platforms/windows/windows.pri +++ b/src/plugins/platforms/windows/windows.pri @@ -13,7 +13,6 @@ wince: DEFINES *= QT_LIBINFIX=L"\"\\\"$${QT_LIBINFIX}\\\"\"" DEFINES *= QT_NO_CAST_FROM_ASCII contains(QT_CONFIG, directwrite) { - LIBS *= -ldwrite SOURCES += $$PWD/qwindowsfontenginedirectwrite.cpp HEADERS += $$PWD/qwindowsfontenginedirectwrite.h } else { -- cgit v1.2.3 From bc914c234cb1f87ad72cb8cb943af81a88934ca7 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 2 Dec 2015 13:36:41 +0100 Subject: enforce no-undefined on all platforms that support it no idea why it was limited to linux. the variable is already empty on platforms which don't support it anyway. also, for plugins, it's consistently enforced as well. Change-Id: I117f4988a2e301ca98cdc088188d6f8c44ea0ba5 Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_module.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf index e2e56c318f..9a4ed20af8 100644 --- a/mkspecs/features/qt_module.prf +++ b/mkspecs/features/qt_module.prf @@ -93,7 +93,7 @@ INCLUDEPATH *= $$eval(QT.$${MODULE}.includes) $$eval(QT.$${MODULE}_private.inclu contains(QT_CONFIG, build_all):CONFIG += build_all } -linux*:QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF +QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF QT += $$QT_FOR_PRIVATE unset(QT_FOR_PRIVATE) -- cgit v1.2.3 From efcc2d492561a1eb55db3f76124e24ad4ae7d447 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Tue, 1 Dec 2015 13:54:04 +0100 Subject: Break line and end in full-stop in configure.exe failure message. When configure.exe doesn't know what -platform to use, its message is poorly-formatted (and unhelpful). This at least fixes the formatting. Change-Id: I0f9fa3106a86606255ba05e80730031f1548faec Reviewed-by: Oswald Buddenhagen --- tools/configure/configureapp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 3767640536..9422b9fe07 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1416,8 +1416,8 @@ void Configure::parseCmdLine() cout << "QMAKESPEC environment variable is set to \"" << dictionary["QMAKESPEC"] << "\" which is not a supported platform" << endl; } else { // was autodetected from environment - cout << "Unable to detect the platform from environment. Use -platform command line" - "argument or set the QMAKESPEC environment variable and run configure again" << endl; + cout << "Unable to detect the platform from environment. Use -platform command line" << endl + << "argument or set the QMAKESPEC environment variable and run configure again." << endl; } cout << "See the README file for a list of supported operating systems and compilers." << endl; } else { -- cgit v1.2.3 From 8d7d481772e251d979ccf37c1405451e6f6780de Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 30 Nov 2015 10:52:59 -0800 Subject: doc: add a note about cmd.exe and the QProcess string splitting/joining cmd.exe uses a different set of characters to split arguments on, which is not compatible with CommandLineToArgvW(). See https://technet.microsoft.com/en-us/library/bb490880.aspx. Task-number: QTBUG-49641 Change-Id: Ic90fe6b1cbe84978a02fffff141b8f961a43ad28 Reviewed-by: Oswald Buddenhagen --- src/corelib/io/qprocess.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp index b09c99985c..952116b9db 100644 --- a/src/corelib/io/qprocess.cpp +++ b/src/corelib/io/qprocess.cpp @@ -2098,7 +2098,9 @@ QByteArray QProcess::readAllStandardError() \b{Windows:} The arguments are quoted and joined into a command line that is compatible with the \c CommandLineToArgvW() Windows function. For programs that have different command line quoting requirements, - you need to use setNativeArguments(). + you need to use setNativeArguments(). One notable program that does + not follow the \c CommandLineToArgvW() rules is cmd.exe and, by + consequence, all batch scripts. The OpenMode is set to \a mode. -- cgit v1.2.3 From db06745fe2f0e705826f37d11e9d021abbbbf37d Mon Sep 17 00:00:00 2001 From: Matt Hoosier Date: Tue, 1 Dec 2015 18:02:33 -0600 Subject: Fix overflow-checking additions and multiplication on MinGW Intrinsics headers are associated with compilers, not OS's. This change fixes a broken MinGW build triggered by 29bc68cf169b8cf87d306a1c72e12eb9b6fbfce7. Change-Id: Ib9e4ea3e25bf49d38a754a246b9433bc078bbb18 Reviewed-by: Thiago Macieira --- src/corelib/global/qnumeric_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/global/qnumeric_p.h b/src/corelib/global/qnumeric_p.h index e5f9d8e13e..b18d521d05 100644 --- a/src/corelib/global/qnumeric_p.h +++ b/src/corelib/global/qnumeric_p.h @@ -50,7 +50,7 @@ #include -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) +#if defined(Q_CC_MSVC) && !defined(Q_OS_WINCE) # include #elif defined(Q_CC_INTEL) # include // for _addcarry_u -- cgit v1.2.3 From ccc6d545c2511674125adea11dc00d08a34b67b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Fri, 6 Nov 2015 10:51:26 +0100 Subject: Update QHighDpiScaling internal documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Expand section on coordinate systems. Document the AA_EnableHighDpiScaling / AA_DisableHighDpiScaling flags added in commit add58ed. Add some notes for platform plugin work. Change-Id: Ie6fe2d818a88ba784c0ee675fabbd3fc04d64bf1 Reviewed-by: Friedemann Kleint Reviewed-by: Morten Johan Sørvig --- src/gui/kernel/qhighdpiscaling.cpp | 137 ++++++++++++++++++++++++++++++------- 1 file changed, 113 insertions(+), 24 deletions(-) diff --git a/src/gui/kernel/qhighdpiscaling.cpp b/src/gui/kernel/qhighdpiscaling.cpp index 4a0900ad97..a3201aa23f 100644 --- a/src/gui/kernel/qhighdpiscaling.cpp +++ b/src/gui/kernel/qhighdpiscaling.cpp @@ -94,32 +94,121 @@ static inline qreal initialGlobalScaleFactor() plugin interfacing parts of QtGui, for example the QWindow, QScreen and QWindowSystemInterface implementation. - The coordinate system scaling is enabled by setting one or more scale - factors. These will then be factored into the value returned by the - devicePixelRatio() accessors (any native scale factor will also be - included in this value). Several setters are available: - - - A process-global scale factor - - QT_SCALE_FACTOR (environment variable) - - QHighDpiScaling::setGlobalFactor() - - - A per-screen scale factor - - QT_AUTO_SCALE_FACTOR (environment variable) - Setting this to a true-ish value will make QHighDpiScaling - call QPlatformScreen::pixelDensity() - - QHighDpiScaling::setScreenFactor(screen, factor); - - QT_SCREEN_SCALE_FACTORS (environment variable) - Set this to a semicolon-separated list of scale factors - (matching the order of QGuiApplications::screens()), - or to a list of name=value pairs (where name matches - QScreen::name()). - - All scale factors are of type qreal. - - The main scaling functions for use in QtGui are: + There are now up to three active coordinate systems in Qt: + + --------------------------------------------------- + | Application Device Independent Pixels | devicePixelRatio + | Qt Widgets | = + | Qt Gui | + |---------------------------------------------------| Qt Scale Factor + | Qt Gui QPlatform* Native Pixels | * + | Qt platform plugin | + |---------------------------------------------------| OS Scale Factor + | Display Device Pixels | + | (Graphics Buffers) | + ----------------------------------------------------- + + This is an simplification and shows the main coordinate system. All layers + may work with device pixels in specific cases: OpenGL, creating the backing + store, and QPixmap management. The "Native Pixels" coordinate system is + internal to Qt and should not be exposed to Qt users: Seen from the outside + there are only two coordinate systems: device independent pixels and device + pixels. + + The devicePixelRatio seen by applications is the product of the Qt scale + factor and the OS scale factor. The value of the scale factors may be 1, + in which case two or more of the coordinate systems are equivalent. Platforms + that (may) have an OS scale factor include OS X, iOS and Wayland. + + Note that the functions in this file do not work with the OS scale factor + directly and are limited to converting between device independent and native + pixels. The OS scale factor is accunted for by QWindow::devicePixelRatio() + and similar functions. + + Configuration Examples: + + 'Classic': Device Independent Pixels = Native Pixels = Device Pixels + --------------------------------------------------- devicePixelRatio: 1 + | Application / Qt Gui 100 x 100 | + | | Qt Scale Factor: 1 + | Qt Platform / OS 100 x 100 | + | | OS Scale Factor: 1 + | Display 100 x 100 | + ----------------------------------------------------- + + 'Retina Device': Device Independent Pixels = Native Pixels + --------------------------------------------------- devicePixelRatio: 2 + | Application / Qt Gui 100 x 100 | + | | Qt Scale Factor: 1 + | Qt Platform / OS 100 x 100 | + |---------------------------------------------------| OS Scale Factor: 2 + | Display 200 x 200 | + ----------------------------------------------------- + + '2x Qt Scaling': Native Pixels = Device Pixels + --------------------------------------------------- devicePixelRatio: 2 + | Application / Qt Gui 100 x 100 | + |---------------------------------------------------| Qt Scale Factor: 2 + | Qt Platform / OS 200 x 200 | + | | OS Scale Factor: 1 + | Display 200 x 200 | + ----------------------------------------------------- + + The Qt Scale Factor is the product of two sub-scale factors, which + are independently either set or determined by the platform plugin. + Several APIs are offered for this, targeting both developers and + end users. All scale factors are of type qreal. + + 1) A global scale factor + The QT_SCALE_FACTOR environment variable can be used to set + a global scale factor for all windows in the processs. This + is useful for testing and debugging (you can simulate any + devicePixelRatio without needing access to sepcial hardware), + and perhaps also for targeting a specific application to + a specific display type (embedded use cases). + + 2) A per-screen scale factors + Some platform plugins support providing a per-screen scale + factor based on display density information. These platforms + include X11, Windows, and Android. + + There are two APIs for enabling or disabling this behavior: + - The QT_AUTO_SCALE_FACTOR environment variable. + - The AA_EnableHighDpiScaling and AA_DisableHighDpiScaling + application attributes + + Enabling either will make QHighDpiScaling call QPlatformScreen::pixelDensity() + and use the value provided as the scale factor for the screen in + question. Disabling is done on a 'veto' basis where either the + environment or the application source can disable. The intended use + cases are 'My system is not providing correct display density + information' and 'My application needs to work in display pixels', + respectively. + + The QT_SCREEN_SCALE_FACTORS environment variable can be used to set the screen + scale factors manually.Set this to a semicolon-separated + list of scale factors (matching the order of QGuiApplications::screens()), + or to a list of name=value pairs (where name matches QScreen::name()). + + Coordinate conversion functions must be used when writing code that passes + geometry across the Qt Gui / Platform plugin boundary. The main conversion + functions are: T toNativePixels(T, QWindow *) T fromNativePixels(T, QWindow*) - Where T is QPoint, QSize, QRect etc. + + The following classes in QtGui use native pixels, for the convenience of the + plataform plugins: + QPlatformWindow + QPlatformScreen + QWindowSystemInterface (API only - Events are in device independent pixels) + + As a special consideration platform plugin code should be careful about + calling QtGui geometry accessor functions: + QRect r = window->geometry(); + Here the returned geometry is in device independent pixels. Add a conversion call: + QRect r = QHighDpi::toNativePixels(window->geometry()); + (Avoiding calling QWindow and instead using the QPlatformWindow geometry + might be a better course of action in this case.) */ qreal QHighDpiScaling::m_factor = 1.0; -- cgit v1.2.3 From 4f1b6749c3f07bfa44b92f8261a03d650f54166b Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Wed, 2 Dec 2015 00:27:49 -0800 Subject: Fix possible null pointer dereferences. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This follows up 130c2baa9376dcf525916620294bd9996bdf41f3. Change-Id: I2f6c9b4f995af427cec9a2162b782039debf8564 Reviewed-by: Simon Hausmann Reviewed-by: Jędrzej Nowacki --- src/gui/image/qicon.cpp | 8 ++++++++ tests/auto/gui/image/qicon/tst_qicon.cpp | 15 +++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index b2d9ed18f5..dc6cbfed1f 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -1208,6 +1208,12 @@ bool QIcon::hasThemeIcon(const QString &name) */ void QIcon::setIsMask(bool isMask) { + if (!d) { + d = new QIconPrivate; + d->engine = new QPixmapIconEngine; + } else { + detach(); + } d->is_mask = isMask; } @@ -1222,6 +1228,8 @@ void QIcon::setIsMask(bool isMask) */ bool QIcon::isMask() const { + if (!d) + return false; return d->is_mask; } diff --git a/tests/auto/gui/image/qicon/tst_qicon.cpp b/tests/auto/gui/image/qicon/tst_qicon.cpp index 9ed3873682..7333dd739f 100644 --- a/tests/auto/gui/image/qicon/tst_qicon.cpp +++ b/tests/auto/gui/image/qicon/tst_qicon.cpp @@ -53,6 +53,7 @@ private slots: void actualSize2_data(); // test with 2 pixmaps with different aspect ratio void actualSize2(); void isNull(); + void isMask(); void swap(); void bestMatch(); void cacheKey(); @@ -218,6 +219,20 @@ void tst_QIcon::isNull() { QVERIFY(iconSupportedFormat.actualSize(QSize(32, 32)).isValid()); } +void tst_QIcon::isMask() +{ + QIcon icon; + icon.setIsMask(true); + icon.addPixmap(QPixmap()); + QVERIFY(icon.isMask()); + + QIcon icon2; + icon2.setIsMask(true); + QVERIFY(icon2.isMask()); + icon2.setIsMask(false); + QVERIFY(!icon2.isMask()); +} + void tst_QIcon::swap() { QPixmap p1(1, 1), p2(2, 2); -- cgit v1.2.3 From d6b9ae201b6473de680a75079978203cfcc60126 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Str=C3=B8mme?= Date: Sat, 28 Nov 2015 15:15:22 +0100 Subject: Android: Add function to check permissions at run-time. This is convenient when we you want to check which permissions the application has been granted at run-time. On Android device running Android 6.0 or newer the permissions might be changed by the user, so there are cases where this will be needed to determine what APIs are available. On older devices or if the application is built for an older SDK version, the old behavior is used, that is, the permissions from the manifest is the permissions the application has. Change-Id: I17ad588b35b26dd7ab26fa4b749764c1602c6854 Reviewed-by: Eskil Abrahamsen Blomfeldt --- .../src/org/qtproject/qt5/android/QtNative.java | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java index 1b7ec8abbb..602b25eb45 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java @@ -41,6 +41,7 @@ import java.util.concurrent.Semaphore; import android.app.Activity; import android.content.Context; import android.content.Intent; +import android.content.pm.PackageManager; import android.net.Uri; import android.os.Handler; import android.os.Looper; @@ -53,6 +54,7 @@ import android.view.Menu; import android.view.MotionEvent; import android.view.View; +import java.lang.reflect.Method; import java.security.KeyStore; import java.security.cert.X509Certificate; import java.util.Iterator; @@ -81,6 +83,7 @@ public class QtNative private static int m_oldx, m_oldy; private static final int m_moveThreshold = 0; private static ClipboardManager m_clipboardManager = null; + private static Method m_checkSelfPermissionMethod = null; private static ClassLoader m_classLoader = null; public static ClassLoader classLoader() @@ -393,6 +396,29 @@ public class QtNative } } + public static int checkSelfPermission(final String permission) + { + int perm = PackageManager.PERMISSION_DENIED; + synchronized (m_mainActivityMutex) { + if (m_activity == null) + return perm; + try { + if (Build.VERSION.SDK_INT >= 23) { + if (m_checkSelfPermissionMethod == null) + m_checkSelfPermissionMethod = Context.class.getMethod("checkSelfPermission", String.class); + perm = (Integer)m_checkSelfPermissionMethod.invoke(m_activity, permission); + } else { + final PackageManager pm = m_activity.getPackageManager(); + perm = pm.checkPermission(permission, m_activity.getPackageName()); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + return perm; + } + private static void updateSelection(final int selStart, final int selEnd, final int candidatesStart, -- cgit v1.2.3 From 96cc7fe5c26e2b2fb3e49813ff9beadd38ef5992 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Fri, 27 Nov 2015 14:37:07 +0100 Subject: DirectWrite: Inherit synthesized properties for fallback fonts When a fallback font is selected, we need to copy out the properties from the main font which can be synthesized by the font engine. In particular, this is weight > normal, and oblique style. This is the DirectWrite equivalent of a856c4a902816a7d691ca50e6f556521287be441. Change-Id: I5d1215c66a433c8a8029c06e7a3dcee287f3f76f Reviewed-by: Konstantin Ritt --- src/plugins/platforms/windows/qwindowsfontengine.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/windows/qwindowsfontengine.cpp b/src/plugins/platforms/windows/qwindowsfontengine.cpp index 3685197430..4a799af44e 100644 --- a/src/plugins/platforms/windows/qwindowsfontengine.cpp +++ b/src/plugins/platforms/windows/qwindowsfontengine.cpp @@ -1357,6 +1357,11 @@ QFontEngine *QWindowsMultiFontEngine::loadEngine(int at) QWindowsFontEngineDirectWrite *fedw = new QWindowsFontEngineDirectWrite(directWriteFontFace, fontEngine->fontDef.pixelSize, data); + if (fontEngine->fontDef.weight > QFont::Normal) + fedw->fontDef.weight = fontEngine->fontDef.weight; + if (fontEngine->fontDef.style > QFont::StyleNormal) + fedw->fontDef.style = fontEngine->fontDef.style; + fedw->fontDef.family = fam; return fedw; } else { qErrnoWarning("%s: CreateFontFace failed", __FUNCTION__); @@ -1368,7 +1373,13 @@ QFontEngine *QWindowsMultiFontEngine::loadEngine(int at) // Get here if original font is not DirectWrite or DirectWrite creation failed for some // reason - return new QWindowsFontEngine(fam, lf, data); + QFontEngine *fe = new QWindowsFontEngine(fam, lf, data); + if (fontEngine->fontDef.weight > QFont::Normal) + fe->fontDef.weight = fontEngine->fontDef.weight; + if (fontEngine->fontDef.style > QFont::StyleNormal) + fe->fontDef.style = fontEngine->fontDef.style; + fe->fontDef.family = fam; + return fe; } bool QWindowsFontEngine::supportsTransformation(const QTransform &transform) const -- cgit v1.2.3 From a2ef3479b8e6fcebf97e6c67f4eb1910db66cdba Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 19 Nov 2015 17:49:46 +0100 Subject: Differ between vertical and no hinting on Windows Symmetric text rendering seems to be the equivalent to no hinting at all since it does subpixel antialiasing in both horizontal and vertical directions. Let people select non-symmetric, natural rendering as well, by setting vertical hinting on the font. This is the mode used for many UI elements in newer versions of Windows (like the title bar of windows etc.) [ChangeLog][Windows] Added differentiation between vertical hinting and no hinting in DirectWrite font engine. Task-number: QTBUG-48546 Change-Id: I2f75ae2d16fdf26706587d92da43daf29afbbcf2 Reviewed-by: Konstantin Ritt Reviewed-by: Friedemann Kleint --- src/plugins/platforms/windows/qwindowsfontdatabase.cpp | 4 +++- src/plugins/platforms/windows/qwindowsfontengine.cpp | 2 ++ .../platforms/windows/qwindowsfontenginedirectwrite.cpp | 14 ++++++++++---- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp index 334c6a9407..8a2fbe1f6d 100644 --- a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp +++ b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp @@ -1239,11 +1239,13 @@ QT_WARNING_POP fontFile->Release(); - fontEngine = new QWindowsFontEngineDirectWrite(directWriteFontFace, pixelSize, + fontEngine = new QWindowsFontEngineDirectWrite(directWriteFontFace, + pixelSize, fontEngineData); // Get font family from font data fontEngine->fontDef.family = font.familyName(); + fontEngine->fontDef.hintingPreference = hintingPreference; directWriteFontFace->Release(); } diff --git a/src/plugins/platforms/windows/qwindowsfontengine.cpp b/src/plugins/platforms/windows/qwindowsfontengine.cpp index 4a799af44e..30417f7cee 100644 --- a/src/plugins/platforms/windows/qwindowsfontengine.cpp +++ b/src/plugins/platforms/windows/qwindowsfontengine.cpp @@ -1362,6 +1362,7 @@ QFontEngine *QWindowsMultiFontEngine::loadEngine(int at) if (fontEngine->fontDef.style > QFont::StyleNormal) fedw->fontDef.style = fontEngine->fontDef.style; fedw->fontDef.family = fam; + fedw->fontDef.hintingPreference = fontEngine->fontDef.hintingPreference; return fedw; } else { qErrnoWarning("%s: CreateFontFace failed", __FUNCTION__); @@ -1379,6 +1380,7 @@ QFontEngine *QWindowsMultiFontEngine::loadEngine(int at) if (fontEngine->fontDef.style > QFont::StyleNormal) fe->fontDef.style = fontEngine->fontDef.style; fe->fontDef.family = fam; + fe->fontDef.hintingPreference = fontEngine->fontDef.hintingPreference; return fe; } diff --git a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp index 75449e22ed..593ac7d810 100644 --- a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp +++ b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp @@ -196,8 +196,8 @@ namespace { */ QWindowsFontEngineDirectWrite::QWindowsFontEngineDirectWrite(IDWriteFontFace *directWriteFontFace, - qreal pixelSize, - const QSharedPointer &d) + qreal pixelSize, + const QSharedPointer &d) : QFontEngine(DirectWrite) , m_fontEngineData(d) , m_directWriteFontFace(directWriteFontFace) @@ -547,12 +547,17 @@ QImage QWindowsFontEngineDirectWrite::imageForGlyph(glyph_t t, transform.m21 = xform.m21(); transform.m22 = xform.m22(); + DWRITE_RENDERING_MODE renderMode = + fontDef.hintingPreference == QFont::PreferNoHinting + ? DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC + : DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL; + IDWriteGlyphRunAnalysis *glyphAnalysis = NULL; HRESULT hr = m_fontEngineData->directWriteFactory->CreateGlyphRunAnalysis( &glyphRun, 1.0f, &transform, - DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC, + renderMode, DWRITE_MEASURING_MODE_NATURAL, 0.0, 0.0, &glyphAnalysis @@ -626,7 +631,8 @@ QImage QWindowsFontEngineDirectWrite::alphaRGBMapForGlyph(glyph_t t, QFontEngine *QWindowsFontEngineDirectWrite::cloneWithSize(qreal pixelSize) const { QFontEngine *fontEngine = new QWindowsFontEngineDirectWrite(m_directWriteFontFace, - pixelSize, m_fontEngineData); + pixelSize, + m_fontEngineData); fontEngine->fontDef = fontDef; fontEngine->fontDef.pixelSize = pixelSize; -- cgit v1.2.3 From bf0af8b5a24de7e595929a64948a3548936aaaee Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 19 Nov 2015 18:10:20 +0100 Subject: Round advances if subpixel position not supported Due to kerning and other OpenType features, it's possible that the advances from the shaping process are fractional, but this gives uneven glyph positioning for font engines that don't support subpixel positioning (since the glyph will not match the expected position, some gaps will look too large and some too small). To match how e.g. GDI renders this, we round the advances before setting the glyph positions for engines that do not support subpixel positions. [ChangeLog][Windows] Fixed uneven kerning for some fonts. Task-number: QTBUG-48546 Change-Id: Ic00dc402abf7149aab6bf9b05b42827b805c1a15 Reviewed-by: Konstantin Ritt --- src/gui/text/qtextengine.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 31b1109b6a..1c924175e2 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -1277,14 +1277,14 @@ int QTextEngine::shapeTextWithHarfbuzzNG(const QScriptItem &si, const ushort *st for (uint i = 0; i < num_glyphs; ++i) g.advances[i] *= stretch; } - - if (actualFontEngine->fontDef.styleStrategy & QFont::ForceIntegerMetrics) { - for (uint i = 0; i < num_glyphs; ++i) - g.advances[i] = g.advances[i].round(); - } } #endif + if (!actualFontEngine->supportsSubPixelPositions() || (actualFontEngine->fontDef.styleStrategy & QFont::ForceIntegerMetrics)) { + for (uint i = 0; i < num_glyphs; ++i) + g.advances[i] = g.advances[i].round(); + } + glyphs_shaped += num_glyphs; } -- cgit v1.2.3