diff options
author | Liang Qi <liang.qi@qt.io> | 2017-01-14 21:58:02 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-01-14 22:02:55 +0100 |
commit | 00935bf8c29d54fcd794ce5673cb5f973808cbf9 (patch) | |
tree | 52b470f84397b023edeb67e8ec42c01337825980 /src | |
parent | 6292ecdf6da6c13942dd3f39c9cd164c29c7ab37 (diff) | |
parent | cfd069181c01bbade16c173a96100819aa719613 (diff) |
Merge remote-tracking branch 'origin/5.8.0' into 5.8
Conflicts:
src/gui/painting/qcoregraphics.mm
Change-Id: I4d49535cd75f2cdf0151c1dbff312cce5e159760
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/itemmodels/qitemselectionmodel.h | 18 | ||||
-rw-r--r-- | src/corelib/tools/qvector.h | 2 | ||||
-rw-r--r-- | src/dbus/qdbusxmlparser.cpp | 5 | ||||
-rw-r--r-- | src/gui/kernel/qplatformsystemtrayicon.cpp | 14 | ||||
-rw-r--r-- | src/gui/painting/qcoregraphics.mm | 2 | ||||
-rw-r--r-- | src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp | 13 | ||||
-rw-r--r-- | src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp | 13 | ||||
-rw-r--r-- | src/printsupport/kernel/qprinter.cpp | 4 | ||||
-rw-r--r-- | src/testlib/3rdparty/VALGRIND_LICENSE.txt (renamed from src/testlib/3rdparty/CALLGRIND_LICENSE.txt) | 4 | ||||
-rw-r--r-- | src/testlib/3rdparty/qt_attribution.json | 11 |
10 files changed, 67 insertions, 19 deletions
diff --git a/src/corelib/itemmodels/qitemselectionmodel.h b/src/corelib/itemmodels/qitemselectionmodel.h index 3d3cb00750..c22ac6dbe5 100644 --- a/src/corelib/itemmodels/qitemselectionmodel.h +++ b/src/corelib/itemmodels/qitemselectionmodel.h @@ -251,6 +251,24 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QItemSelectionModel::SelectionFlags) // dummy implentation of qHash() necessary for instantiating QList<QItemSelectionRange>::toSet() with MSVC inline uint qHash(const QItemSelectionRange &) { return 0; } +#ifdef Q_CC_MSVC + +/* + ### Qt 6: + ### This needs to be removed for next releases of Qt. It is a workaround for vc++ because + ### Qt exports QItemSelection that inherits QList<QItemSelectionRange>. +*/ + +# ifndef Q_TEMPLATE_EXTERN +# if defined(QT_BUILD_CORE_LIB) +# define Q_TEMPLATE_EXTERN +# else +# define Q_TEMPLATE_EXTERN extern +# endif +# endif +Q_TEMPLATE_EXTERN template class Q_CORE_EXPORT QList<QItemSelectionRange>; +#endif // Q_CC_MSVC + class Q_CORE_EXPORT QItemSelection : public QList<QItemSelectionRange> { public: diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index 4dbf95c315..5225b68d40 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -982,11 +982,13 @@ QT_BEGIN_INCLUDE_NAMESPACE #include <QtCore/qpoint.h> QT_END_INCLUDE_NAMESPACE +#ifndef Q_TEMPLATE_EXTERN #if defined(QT_BUILD_CORE_LIB) #define Q_TEMPLATE_EXTERN #else #define Q_TEMPLATE_EXTERN extern #endif +#endif Q_TEMPLATE_EXTERN template class Q_CORE_EXPORT QVector<QPointF>; Q_TEMPLATE_EXTERN template class Q_CORE_EXPORT QVector<QPoint>; #endif diff --git a/src/dbus/qdbusxmlparser.cpp b/src/dbus/qdbusxmlparser.cpp index 3618c76a1d..94223e1574 100644 --- a/src/dbus/qdbusxmlparser.cpp +++ b/src/dbus/qdbusxmlparser.cpp @@ -385,6 +385,11 @@ QDBusXmlParser::QDBusXmlParser(const QString& service, const QString& path, case QXmlStreamReader::Comment: // ignore comments and processing instructions break; + case QXmlStreamReader::Characters: + // ignore whitespace + if (xml.isWhitespace()) + break; + Q_FALLTHROUGH(); default: qDBusParserError() << "unknown token" << xml.name() << xml.tokenString(); break; diff --git a/src/gui/kernel/qplatformsystemtrayicon.cpp b/src/gui/kernel/qplatformsystemtrayicon.cpp index 30db966df7..973b998059 100644 --- a/src/gui/kernel/qplatformsystemtrayicon.cpp +++ b/src/gui/kernel/qplatformsystemtrayicon.cpp @@ -40,6 +40,9 @@ #include "qplatformsystemtrayicon.h" +#include <QtGui/private/qguiapplication_p.h> +#include <QtGui/qpa/qplatformtheme.h> + #ifndef QT_NO_SYSTEMTRAYICON QT_BEGIN_NAMESPACE @@ -158,11 +161,10 @@ QPlatformSystemTrayIcon::~QPlatformSystemTrayIcon() */ /*! - This method is called in case there is no QPlatformMenu available when - updating the menu. This allows the abstraction to provide a menu for the - system tray icon even if normally a non-native menu is used. - - The default implementation returns a null pointer. + This method allows platforms to use a different QPlatformMenu for system + tray menus than what would normally be used for e.g. menu bars. The default + implementation falls back to a platform menu created by the platform theme, + which may be null on platforms without native menus. \sa updateMenu() \since 5.3 @@ -170,7 +172,7 @@ QPlatformSystemTrayIcon::~QPlatformSystemTrayIcon() QPlatformMenu *QPlatformSystemTrayIcon::createMenu() const { - return Q_NULLPTR; + return QGuiApplicationPrivate::platformTheme()->createPlatformMenu(); } QT_END_NAMESPACE diff --git a/src/gui/painting/qcoregraphics.mm b/src/gui/painting/qcoregraphics.mm index 804c40ecbb..803328c10f 100644 --- a/src/gui/painting/qcoregraphics.mm +++ b/src/gui/painting/qcoregraphics.mm @@ -495,7 +495,7 @@ QMacCGContext::QMacCGContext(QPaintDevice *paintDevice) : context(0) context = CGBitmapContextCreate(image->bits(), image->width(), image->height(), 8, image->bytesPerLine(), colorspace, flags); CGContextTranslateCTM(context, 0, image->height()); - qreal devicePixelRatio = paintDevice->devicePixelRatioF(); + const qreal devicePixelRatio = paintDevice->devicePixelRatioF(); CGContextScaleCTM(context, devicePixelRatio, devicePixelRatio); CGContextScaleCTM(context, 1, -1); } diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp index 1c615e06ed..887123083a 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp +++ b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp @@ -1159,7 +1159,7 @@ void QWindowsFontDatabase::populateFamily(const QString &familyName) ReleaseDC(0, dummy); } -static int QT_WIN_CALLBACK populateFontFamilies(const LOGFONT *logFont, const TEXTMETRIC *, +static int QT_WIN_CALLBACK populateFontFamilies(const LOGFONT *logFont, const TEXTMETRIC *textmetric, DWORD, LPARAM) { // the "@family" fonts are just the same as "family". Ignore them. @@ -1168,6 +1168,13 @@ static int QT_WIN_CALLBACK populateFontFamilies(const LOGFONT *logFont, const TE if (faceNameW[0] && faceNameW[0] != L'@' && wcsncmp(faceNameW, L"WST_", 4)) { const QString faceName = QString::fromWCharArray(faceNameW); QPlatformFontDatabase::registerFontFamily(faceName); + // Register current font's english name as alias + const bool ttf = (textmetric->tmPitchAndFamily & TMPF_TRUETYPE); + if (ttf && qt_localizedName(faceName)) { + const QString englishName = qt_getEnglishName(faceName); + if (!englishName.isEmpty()) + QPlatformFontDatabase::registerAliasToFontFamily(faceName, englishName); + } } return 1; // continue } @@ -1183,7 +1190,9 @@ void QWindowsFontDatabase::populateFontDatabase() EnumFontFamiliesEx(dummy, &lf, populateFontFamilies, 0, 0); ReleaseDC(0, dummy); // Work around EnumFontFamiliesEx() not listing the system font. - QPlatformFontDatabase::registerFontFamily(QWindowsFontDatabase::systemDefaultFont().family()); + QString systemDefaultFamily = QWindowsFontDatabase::systemDefaultFont().family(); + if (QPlatformFontDatabase::resolveFontFamilyAlias(systemDefaultFamily).isEmpty()) + QPlatformFontDatabase::registerFontFamily(systemDefaultFamily); } typedef QSharedPointer<QWindowsFontEngineData> QWindowsFontEngineDataPtr; diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp index df84198862..ebb82baf6f 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp +++ b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp @@ -362,8 +362,15 @@ static int QT_WIN_CALLBACK populateFontFamilies(const LOGFONT *logFont, const TE if (!key && ttf && qt_localizedName(faceName)) key = findFontKey(qt_getEnglishName(faceName)); } - if (key) + if (key) { QPlatformFontDatabase::registerFontFamily(faceName); + // Register current font's english name as alias + if (ttf && qt_localizedName(faceName)) { + const QString englishName = qt_getEnglishName(faceName); + if (!englishName.isEmpty()) + QPlatformFontDatabase::registerAliasToFontFamily(faceName, englishName); + } + } } return 1; // continue } @@ -378,7 +385,9 @@ void QWindowsFontDatabaseFT::populateFontDatabase() EnumFontFamiliesEx(dummy, &lf, populateFontFamilies, 0, 0); ReleaseDC(0, dummy); // Work around EnumFontFamiliesEx() not listing the system font - QPlatformFontDatabase::registerFontFamily(QWindowsFontDatabase::systemDefaultFont().family()); + QString systemDefaultFamily = QWindowsFontDatabase::systemDefaultFont().family(); + if (QPlatformFontDatabase::resolveFontFamilyAlias(systemDefaultFamily).isEmpty()) + QPlatformFontDatabase::registerFontFamily(systemDefaultFamily); } QFontEngine * QWindowsFontDatabaseFT::fontEngine(const QFontDef &fontDef, void *handle) diff --git a/src/printsupport/kernel/qprinter.cpp b/src/printsupport/kernel/qprinter.cpp index 6d6d61b343..7824d28ac5 100644 --- a/src/printsupport/kernel/qprinter.cpp +++ b/src/printsupport/kernel/qprinter.cpp @@ -2326,4 +2326,8 @@ QPrinter::PrintRange QPrinter::printRange() const QT_END_NAMESPACE +#elif defined(Q_OS_WINRT) +QT_BEGIN_NAMESPACE +bool Q_PRINTSUPPORT_EXPORT qt_winrt_export_lib_creation_variable; +QT_END_NAMESPACE #endif // QT_NO_PRINTER diff --git a/src/testlib/3rdparty/CALLGRIND_LICENSE.txt b/src/testlib/3rdparty/VALGRIND_LICENSE.txt index 0a6a793422..714b75e6d1 100644 --- a/src/testlib/3rdparty/CALLGRIND_LICENSE.txt +++ b/src/testlib/3rdparty/VALGRIND_LICENSE.txt @@ -1,6 +1,4 @@ - This file is part of callgrind, a valgrind tool for cache simulation - and call tree tracing. - + Copyright (C) 2000-2007 Julian Seward Copyright (C) 2003-2007 Josef Weidendorfer. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/src/testlib/3rdparty/qt_attribution.json b/src/testlib/3rdparty/qt_attribution.json index d8b0ad1fc7..49d12580bd 100644 --- a/src/testlib/3rdparty/qt_attribution.json +++ b/src/testlib/3rdparty/qt_attribution.json @@ -1,17 +1,18 @@ [ { - "Id": "callgrind", - "Name": "Callgrind", + "Id": "valgrind", + "Name": "Valgrind", "QDocModule": "qttestlib", "QtUsage": "Used on Linux ond MacOS in the Qt Test module.", "Files": "valgrind_p.h callgrind_p.h", - "Description": "Part of Valgrind: an instrumentation framework for building dynamic analysis tools.", + "Description": "An instrumentation framework for building dynamic analysis tools.", "Homepage": "http://valgrind.org/", "License": "BSD 4-clause \"Original\" or \"Old\" License", "LicenseId": "BSD-4-Clause", - "LicenseFile": "CALLGRIND_LICENSE.txt", - "Copyright": "Copyright (C) 2003-2007 Josef Weidendorfer. All rights reserved." + "LicenseFile": "VALGRIND_LICENSE.txt", + "Copyright": "Copyright (C) 2000-2007 Julian Seward +Copyright (C) 2003-2007 Josef Weidendorfer." }, { "Id": "cycle", |