diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2016-03-22 07:24:57 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2016-03-22 07:28:42 +0100 |
commit | a02863234d76abb6c9f289026ae4ea3145924f30 (patch) | |
tree | aef6381d0000a78ba69ac80eb03739b1c8ca5fc3 /src/platformsupport | |
parent | e77b13621f0057374d83a2b884f03dd2e5b7b88c (diff) | |
parent | e4d79e1fdeb6b26ba0b12b578daacf7cd672b960 (diff) |
Merge remote-tracking branch 'origin/5.7' into dev
Conflicts:
configure
mkspecs/common/wince/qplatformdefs.h
src/plugins/platforms/directfb/qdirectfbbackingstore.cpp
src/plugins/platforms/xcb/qxcbbackingstore.cpp
Change-Id: Ied4d31264a9afca9514b51a7eb1494c28712793c
Diffstat (limited to 'src/platformsupport')
14 files changed, 45 insertions, 65 deletions
diff --git a/src/platformsupport/cglconvenience/cglconvenience.mm b/src/platformsupport/cglconvenience/cglconvenience.mm index aafd4db863..a18510a9e2 100644 --- a/src/platformsupport/cglconvenience/cglconvenience.mm +++ b/src/platformsupport/cglconvenience/cglconvenience.mm @@ -42,19 +42,7 @@ #include <QtCore/private/qcore_mac_p.h> #include <AppKit/AppKit.h> #include <QVector> - -void (*qcgl_getProcAddress(const QByteArray &procName))() -{ - CFURLRef url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, - CFSTR("/System/Library/Frameworks/OpenGL.framework"), kCFURLPOSIXPathStyle, false); - CFBundleRef bundle = CFBundleCreate(kCFAllocatorDefault, url); - CFStringRef procNameCF = QCFString::toCFStringRef(QString::fromLatin1(procName.constData())); - void *proc = CFBundleGetFunctionPointerForName(bundle, procNameCF); - CFRelease(url); - CFRelease(bundle); - CFRelease(procNameCF); - return (void (*) ())proc; -} +#include <qdebug.h> // Match up with createNSOpenGLPixelFormat below! QSurfaceFormat qcgl_surfaceFormat() diff --git a/src/platformsupport/cglconvenience/cglconvenience_p.h b/src/platformsupport/cglconvenience/cglconvenience_p.h index cb0820263a..e531e73549 100644 --- a/src/platformsupport/cglconvenience/cglconvenience_p.h +++ b/src/platformsupport/cglconvenience/cglconvenience_p.h @@ -55,7 +55,6 @@ #include <QString> #include <OpenGL/OpenGL.h> -void (*qcgl_getProcAddress(const QByteArray &procName))(); QSurfaceFormat qcgl_surfaceFormat(); void *qcgl_createNSOpenGLPixelFormat(const QSurfaceFormat &format); diff --git a/src/platformsupport/clipboard/qmacmime.mm b/src/platformsupport/clipboard/qmacmime.mm index 8a750b8dcb..2ad734b8b9 100644 --- a/src/platformsupport/clipboard/qmacmime.mm +++ b/src/platformsupport/clipboard/qmacmime.mm @@ -643,7 +643,7 @@ QList<QByteArray> QMacPasteboardMimeFileUri::convertFromMime(const QString &mime QUrl url = urls.at(i).toUrl(); if (url.scheme().isEmpty()) url.setScheme(QLatin1String("file")); - if (url.scheme().toLower() == QLatin1String("file")) { + if (url.scheme() == QLatin1String("file")) { if (url.host().isEmpty()) url.setHost(QLatin1String("localhost")); url.setPath(url.path().normalized(QString::NormalizationForm_D)); @@ -722,7 +722,7 @@ QList<QByteArray> QMacPasteboardMimeUrl::convertFromMime(const QString &mime, QV QUrl url = urls.at(i).toUrl(); if (url.scheme().isEmpty()) url.setScheme(QLatin1String("file")); - if (url.scheme().toLower() == QLatin1String("file")) { + if (url.scheme() == QLatin1String("file")) { if (url.host().isEmpty()) url.setHost(QLatin1String("localhost")); url.setPath(url.path().normalized(QString::NormalizationForm_D)); diff --git a/src/platformsupport/dbusmenu/qdbusmenubar.cpp b/src/platformsupport/dbusmenu/qdbusmenubar.cpp index 7d53de6db4..76d658f51a 100644 --- a/src/platformsupport/dbusmenu/qdbusmenubar.cpp +++ b/src/platformsupport/dbusmenu/qdbusmenubar.cpp @@ -133,6 +133,11 @@ QPlatformMenu *QDBusMenuBar::menuForTag(quintptr tag) const return nullptr; } +QPlatformMenu *QDBusMenuBar::createMenu() const +{ + return new QDBusPlatformMenu; +} + void QDBusMenuBar::registerMenuBar() { static uint menuBarId = 0; diff --git a/src/platformsupport/dbusmenu/qdbusmenubar_p.h b/src/platformsupport/dbusmenu/qdbusmenubar_p.h index 157befe9e3..8266a395f5 100644 --- a/src/platformsupport/dbusmenu/qdbusmenubar_p.h +++ b/src/platformsupport/dbusmenu/qdbusmenubar_p.h @@ -72,6 +72,7 @@ public: void syncMenu(QPlatformMenu *menu) Q_DECL_OVERRIDE; void handleReparent(QWindow *newParentWindow) Q_DECL_OVERRIDE; QPlatformMenu *menuForTag(quintptr tag) const Q_DECL_OVERRIDE; + QPlatformMenu *createMenu() const Q_DECL_OVERRIDE; private: QDBusPlatformMenu *m_menu; diff --git a/src/platformsupport/eglconvenience/eglconvenience.pri b/src/platformsupport/eglconvenience/eglconvenience.pri index f1e0d58a6d..fe6d0eb748 100644 --- a/src/platformsupport/eglconvenience/eglconvenience.pri +++ b/src/platformsupport/eglconvenience/eglconvenience.pri @@ -26,4 +26,6 @@ contains(QT_CONFIG,egl) { LIBS_PRIVATE += $$QMAKE_LIBS_X11 } CONFIG += egl + + LIBS_PRIVATE += $$QMAKE_LIBS_DYNLOAD } diff --git a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp index 9e7298b89a..bd7254b73a 100644 --- a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp +++ b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp @@ -48,6 +48,9 @@ #ifdef Q_OS_ANDROID #include <QtCore/private/qjnihelpers_p.h> #endif +#ifndef Q_OS_WIN +#include <dlfcn.h> +#endif QT_BEGIN_NAMESPACE @@ -440,10 +443,15 @@ void QEGLPlatformContext::swapBuffers(QPlatformSurface *surface) } } -void (*QEGLPlatformContext::getProcAddress(const QByteArray &procName)) () +QFunctionPointer QEGLPlatformContext::getProcAddress(const char *procName) { eglBindAPI(m_api); - return eglGetProcAddress(procName.constData()); + QFunctionPointer proc = (QFunctionPointer) eglGetProcAddress(procName); +#ifndef Q_OS_WIN + if (!proc) + proc = (QFunctionPointer) dlsym(RTLD_DEFAULT, procName); +#endif + return proc; } QSurfaceFormat QEGLPlatformContext::format() const diff --git a/src/platformsupport/eglconvenience/qeglplatformcontext_p.h b/src/platformsupport/eglconvenience/qeglplatformcontext_p.h index 2679c3b9f8..e772f5df89 100644 --- a/src/platformsupport/eglconvenience/qeglplatformcontext_p.h +++ b/src/platformsupport/eglconvenience/qeglplatformcontext_p.h @@ -76,7 +76,7 @@ public: bool makeCurrent(QPlatformSurface *surface) Q_DECL_OVERRIDE; void doneCurrent() Q_DECL_OVERRIDE; void swapBuffers(QPlatformSurface *surface) Q_DECL_OVERRIDE; - QFunctionPointer getProcAddress(const QByteArray &procName) Q_DECL_OVERRIDE; + QFunctionPointer getProcAddress(const char *procName) Q_DECL_OVERRIDE; QSurfaceFormat format() const Q_DECL_OVERRIDE; bool isSharing() const Q_DECL_OVERRIDE { return m_shareContext != EGL_NO_CONTEXT; } diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp index 5ca0749787..b288a05e32 100644 --- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp +++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp @@ -868,7 +868,7 @@ void QFontconfigDatabase::setupFontEngine(QFontEngineFT *engine, const QFontDef const QPlatformServices *services = QGuiApplicationPrivate::platformIntegration()->services(); bool useXftConf = (services && (services->desktopEnvironment() == "GNOME" || services->desktopEnvironment() == "UNITY")); - if (useXftConf) { + if (useXftConf && !forcedAntialiasSetting) { void *antialiasResource = QGuiApplication::platformNativeInterface()->nativeResourceForScreen("antialiasingEnabled", QGuiApplication::primaryScreen()); diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm index 9dba1ca1f1..f5372151b7 100644 --- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm +++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm @@ -524,9 +524,6 @@ QStringList QCoreTextFontDatabase::fallbacksForFamily(const QString &family, QFo if (&CTFontCopyDefaultCascadeListForLanguages) #endif { - if (fallbackLists.contains(family)) - return fallbackLists.value(family); - QCFType<CFMutableDictionaryRef> attributes = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); CFDictionaryAddValue(attributes, kCTFontFamilyNameAttribute, QCFString(family)); if (QCFType<CTFontDescriptorRef> fontDescriptor = CTFontDescriptorCreateWithAttributes(attributes)) { @@ -554,12 +551,9 @@ QStringList QCoreTextFontDatabase::fallbacksForFamily(const QString &family, QFo fallbackList.append(QStringLiteral("Arial Unicode MS")); #endif - fallbackLists[family] = fallbackList; + return fallbackList; } } - - if (fallbackLists.contains(family)) - return fallbackLists.value(family); } } #endif @@ -1003,7 +997,7 @@ QFontEngine *QCoreTextFontDatabase::freeTypeFontEngine(const QFontDef &fontDef, } if (!engine->init(faceId, antialias, format, fontData) || engine->invalid()) { - qWarning() << "QCoreTextFontDatabase::freeTypefontEngine Failed to create engine"; + qWarning("QCoreTextFontDatabase::freeTypefontEngine Failed to create engine"); return Q_NULLPTR; } engine->setQtDefaultHintStyle(static_cast<QFont::HintingPreference>(fontDef.hintingPreference)); diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp index cec596ebb2..6b98ed30a9 100644 --- a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp +++ b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp @@ -538,9 +538,16 @@ void QEvdevTouchScreenData::processInputEvent(input_event *data) it.next(); Contact &contact(it.value()); int key = m_typeB ? it.key() : contact.trackingId; - if (!m_contacts.contains(key)) { - contact.state = Qt::TouchPointReleased; - addTouchPoint(contact, &combinedStates); + if (m_typeB) { + if (contact.trackingId != m_contacts[key].trackingId && contact.state) { + contact.state = Qt::TouchPointReleased; + addTouchPoint(contact, &combinedStates); + } + } else { + if (!m_contacts.contains(key)) { + contact.state = Qt::TouchPointReleased; + addTouchPoint(contact, &combinedStates); + } } } diff --git a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp index d982c5afff..2b81de43a7 100644 --- a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp +++ b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp @@ -783,7 +783,7 @@ void AtSpiAdaptor::updateEventListeners() } m_applicationAdaptor->sendEvents(!evList.isEmpty()); } else { - qAtspiDebug() << "Could not query active accessibility event listeners."; + qAtspiDebug("Could not query active accessibility event listeners."); } } @@ -944,7 +944,7 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event) if (sendObject || sendObject_text_changed) { QAccessibleInterface * iface = event->accessibleInterface(); if (!iface || !iface->textInterface()) { - qAtspiDebug() << "Received text event for invalid interface."; + qAtspiDebug("Received text event for invalid interface."); return; } QString path = pathForInterface(iface); @@ -1030,7 +1030,7 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event) if (sendObject || sendObject_value_changed || sendObject_property_change_accessible_value) { QAccessibleInterface * iface = event->accessibleInterface(); if (!iface) { - qWarning() << "ValueChanged event from invalid accessible."; + qWarning("ValueChanged event from invalid accessible."); return; } if (iface->valueInterface()) { @@ -1059,7 +1059,7 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event) case QAccessible::Selection: { QAccessibleInterface * iface = event->accessibleInterface(); if (!iface) { - qWarning() << "Selection event from invalid accessible."; + qWarning("Selection event from invalid accessible."); return; } QString path = pathForInterface(iface); @@ -1076,7 +1076,7 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event) if (stateChange.checked) { QAccessibleInterface * iface = event->accessibleInterface(); if (!iface) { - qWarning() << "StateChanged event from invalid accessible."; + qWarning("StateChanged event from invalid accessible."); return; } int checked = iface->state().checked; @@ -1481,7 +1481,7 @@ QStringList AtSpiAdaptor::accessibleInterfaces(QAccessibleInterface *interface) } #ifdef ACCESSIBLE_CREATION_DEBUG else { - qAtspiDebug() << " IS NOT a component"; + qAtspiDebug(" IS NOT a component"); } #endif if (interface->role() == QAccessible::Application) @@ -1538,7 +1538,7 @@ QString AtSpiAdaptor::pathForObject(QObject *object) const Q_ASSERT(object); if (inheritsQAction(object)) { - qAtspiDebug() << "AtSpiAdaptor::pathForObject: warning: creating path with QAction as object."; + qAtspiDebug("AtSpiAdaptor::pathForObject: warning: creating path with QAction as object."); } QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(object); @@ -1669,18 +1669,18 @@ bool AtSpiAdaptor::componentInterface(QAccessibleInterface *interface, const QSt // int width = message.arguments().at(2).toInt(); // int height = message.arguments().at(3).toInt(); // uint coordinateType = message.arguments().at(4).toUInt(); - qAtspiDebug() << "SetExtents is not implemented."; + qAtspiDebug("SetExtents is not implemented."); sendReply(connection, message, false); } else if (function == QLatin1String("SetPosition")) { // int x = message.arguments().at(0).toInt(); // int y = message.arguments().at(1).toInt(); // uint coordinateType = message.arguments().at(2).toUInt(); - qAtspiDebug() << "SetPosition is not implemented."; + qAtspiDebug("SetPosition is not implemented."); sendReply(connection, message, false); } else if (function == QLatin1String("SetSize")) { // int width = message.arguments().at(0).toInt(); // int height = message.arguments().at(1).toInt(); - qAtspiDebug() << "SetSize is not implemented."; + qAtspiDebug("SetSize is not implemented."); sendReply(connection, message, false); } else { qAtspiDebug() << "WARNING: AtSpiAdaptor::componentInterface does not implement " << function << message.path(); diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp index aee12eed76..720b032ea5 100644 --- a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp +++ b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp @@ -191,13 +191,6 @@ QStringList QGenericUnixTheme::xdgIconThemePaths() } #ifndef QT_NO_DBUS -QPlatformMenu *QGenericUnixTheme::createPlatformMenu() const -{ - if (isDBusGlobalMenuAvailable()) - return new QDBusPlatformMenu(); - return nullptr; -} - QPlatformMenuBar *QGenericUnixTheme::createPlatformMenuBar() const { if (isDBusGlobalMenuAvailable()) @@ -594,13 +587,6 @@ QPlatformTheme *QKdeTheme::createKdeTheme() } #ifndef QT_NO_DBUS -QPlatformMenu *QKdeTheme::createPlatformMenu() const -{ - if (isDBusGlobalMenuAvailable()) - return new QDBusPlatformMenu(); - return nullptr; -} - QPlatformMenuBar *QKdeTheme::createPlatformMenuBar() const { if (isDBusGlobalMenuAvailable()) @@ -706,13 +692,6 @@ QString QGnomeTheme::gtkFontName() const } #ifndef QT_NO_DBUS -QPlatformMenu *QGnomeTheme::createPlatformMenu() const -{ - if (isDBusGlobalMenuAvailable()) - return new QDBusPlatformMenu(); - return nullptr; -} - QPlatformMenuBar *QGnomeTheme::createPlatformMenuBar() const { if (isDBusGlobalMenuAvailable()) diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h b/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h index b7e0d53d6f..952658e130 100644 --- a/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h +++ b/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h @@ -86,7 +86,6 @@ public: static QStringList xdgIconThemePaths(); #ifndef QT_NO_DBUS - QPlatformMenu *createPlatformMenu() const Q_DECL_OVERRIDE; QPlatformMenuBar *createPlatformMenuBar() const Q_DECL_OVERRIDE; #endif #if !defined(QT_NO_DBUS) && !defined(QT_NO_SYSTEMTRAYICON) @@ -112,7 +111,6 @@ public: const QFont *font(Font type) const Q_DECL_OVERRIDE; #ifndef QT_NO_DBUS - QPlatformMenu *createPlatformMenu() const Q_DECL_OVERRIDE; QPlatformMenuBar *createPlatformMenuBar() const Q_DECL_OVERRIDE; #endif #if !defined(QT_NO_DBUS) && !defined(QT_NO_SYSTEMTRAYICON) @@ -136,7 +134,6 @@ public: virtual QString gtkFontName() const; #ifndef QT_NO_DBUS - QPlatformMenu *createPlatformMenu() const Q_DECL_OVERRIDE; QPlatformMenuBar *createPlatformMenuBar() const Q_DECL_OVERRIDE; #endif #if !defined(QT_NO_DBUS) && !defined(QT_NO_SYSTEMTRAYICON) |