From b29b9041b5109eb908ce5a7829b6c9c3182febb7 Mon Sep 17 00:00:00 2001 From: Jani Heikkinen Date: Wed, 30 Nov 2016 15:12:33 +0200 Subject: [PATCH 1/9] Add changes file for 5.8.0 Change-Id: Ie1185b165fc706f3fcc87014d4eefd1e2c6fb771 Done-with: Oswald Buddenhagen Done-with: Thiago Maciiera Reviewed-by: Kai Koehne Reviewed-by: Shawn Rutledge Reviewed-by: Lars Knoll --- dist/changes-5.8.0 | 497 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 497 insertions(+) create mode 100644 dist/changes-5.8.0 diff --git a/dist/changes-5.8.0 b/dist/changes-5.8.0 new file mode 100644 index 0000000000..8d93863087 --- /dev/null +++ b/dist/changes-5.8.0 @@ -0,0 +1,497 @@ +Qt 5.8 introduces many new features and improvements as well as bugfixes +over the 5.7.x series. For more details, refer to the online documentation +included in this distribution. The documentation is also available online: + + http://doc.qt.io/qt-5/index.html + +The Qt version 5.8 series is binary compatible with the 5.7.x series. +Applications compiled for 5.7 will continue to run with 5.8. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + + https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +This release contains all fixes included in the Qt 5.7.1 release. + +**************************************************************************** +* License Changes * +**************************************************************************** + + Static libraries that are linked into executables (winmain and + qopenglextensions) are now licensed under BSD _and_ commercial licenses. + +**************************************************************************** +* Deprecation Notice * +**************************************************************************** + + - The following platforms or toolchains are deprecated and will be + removed as of Qt 5.9: + * Apple OS X Mavericks (v10.9) + * Apple iOS 7.x + + Deprecated platforms and toolchains continue to work until removed. + + - The Q_OBJECT_CHECK macro is deprecated and will be removed in Qt 6. The + internal, template function qt_check_for_QOBJECT_macro that it created in + QObject-derived classes will be removed in Qt 5.9. + +**************************************************************************** +* Important Behavior Changes * +**************************************************************************** + + - Support for the following platforms was removed in this version: + * Apple OS X Mountain Lion (v10.8) + * Apple iOS 6.x + +configure & build system +------------------------ + + - The configuration system has been rewritten almost from scratch. This + improved the consistency between builds on Unix and Windows, but some + subtle unintended behavior changes are also possible. Also, some + obsolete options have been entirely removed and will now cause errors. + - It is not permissible any more to manually #define QT_NO_ + anywhere. Instead, configure's -no-feature-* options must be used. + Note that this does not apply to defines which modify behavior rather + than entirely removing features. + - Configure test results are now cached. Use -recheck or -recheck-all + to discard them. + - [QTBUG-32530][QTBUG-42962] The Unix configure won't pick up CFLAGS and + related environment variables any more. Instead, it now accepts QMAKE_* + variable assignments on the command line. + - [QTBUG-52266] Configure won't pick up QMAKESPEC from the environment + any more. Use the -platform option instead. + - Device and simulator libraries are now combined on Apple device + platforms (iOS). This means that there will no longer be any + *_simulator.a libraries and the simulator architectures will simply + reside alongside the device architectures in a single Mach-O file. + - [Darwin] Project files may not override QMAKE_MAC_SDK any more. + +QtCore +------ + + - qFatal will now use std::abort to terminate the application on all + operating systems. Previously, ::abort() or ::exit(1) were called, + depending on the operating system. + - QLibraryInfo::licensee()/licensedProducts() were deprecated and + return empty strings now. + - Destroying a QThread which is still running will now result in + immediate and abnormal program termination. + +QtGui +----- + + - [QTBUG-54936] QFont::toString() and QFont::key() were modified to save + the font's style name if one is set, invalidating any stored font + identifiers. QFont::fromString() was also adjusted to accommodate the + change. + +QtNetwork +--------- + + - Proxies from system settings will now be used by default. Configure + with -no-system-proxies to disable. + - [QTBUG-53649] libproxy is now turned off by default. Configure with + -libproxy in order to enable it again. + +**************************************************************************** +* Library * +**************************************************************************** + +QtCore +------ + + - Disambiguated the relational operators comparing QByteArray with + QStringRef (and vice versa). + - Added qHash() overloads for QHash, QMultiHash. + - Added QDeadlineTimer, a counterpart to QElapsedTimer, used to mark a + time point in the future (a deadline) and determine whether such a + deadline has passed. + - Qt now relies on type traits from the C++11 standard library. + - [QTBUG-54981] Added Q_NAMESPACE, which can be used to add Q_ENUM_NS/ + Q_ENUMS, Q_FLAG_NS/Q_FLAGS and Q_CLASSINFO to a namespace. + - Q_IS_ENUM was deprecated. Use std::is_enum<>::value instead. + + - QChar: + * Added missing operator{<,>,<=,>=} comparing against QLatin1String and + QStringRef. + * Added missing operator{==,!=} comparing against QLatin1String. + + - QCommandLineOption: + * Added flags() and setFlags() methods. Added ShortOptionStyle and + HiddenFromHelp flags. + + - QDateTime: + * Introduced toSecsSinceEpoch, fromSecsSinceEpoch and setSecsSinceEpoch + functions, which use 64-bit integers to represent the number of + seconds. + * The toTime_t, fromTime_t and setTime_t functions are deprecated and + will be removed in Qt 6.0. For new code, use the equivalent functions + with "SecsSinceEpoch" in the name, or the equivalent ones with + millisecond accurancy that have existed since Qt 4.7. + * Added string formatting type Qt::ISODateWithMs. + + - QFileInfo: + * QFileInfo now reports file times with millisecond precision on Unix + systems. + + - QFileSystemWatcher: + * [QTBUG-55896] Fixed a bug that caused QFileSystemWatcher to mis-handle + file paths that contained non-US-ASCII characters on Apple platforms. + + - QJsonDocument: + * [QTBUG-39751] fromVariant can now take a QVariantHash argument. + * Fixed a number of bugs that could cause crashes when loading corrupt + binary JSON data. + + - QJsonValue: + * [QTBUG-43077] QJsonValue(Null).toVariant() now returns a QVariant of + type QMetaType::Nullptr instead of an invalid QVariant. + + - QLatin1String: + * Added at(), operator[](), mid(), right(), left(). + + - QLibraryInfo: + * Added QLibraryInfo::version(), which returns the current version of + the Qt library as a QVersionNumber object. + + - QLine/QLineF: + * Added center(). + + - QLockFile: + * Fixed a bug that caused QLockFile to over-sleep while waiting for the + lock file to become available. + + - QMetaType: + * std::nullptr_t is now a built-in Qt metatype. + + - QModelIndex: + * QModelIndex::child has been deprecated due to its lack of generality. + Use model->index(row, column, index) instead. + + - QMutex: + * QMutex now fully models the TimedLockable concept by providing the + try_lock, try_lock_for and try_lock_until functions, therefore making + it usable in Standard Library lock management classes and functions. + + - QObject: + * The QT_NO_NARROWING_CONVERSIONS_IN_CONNECT macro has been added. When + using the new connection syntax (PMF-based) this macro makes it + illegal to narrow the arguments carried by the signal, and/or to + perform floating point to integral implicit conversions on them. When + the macro is defined, depending on your compiler a QObject::connect() + statement triggering such conversions will now fail to compile. + + - QPersistentModelIndex: + * QPersistentModelIndex::child has been deprecated due to its lack of + generality. Use model->index(row, column, index) instead. + + - QStringList: + * Added join(QLatin1String) overload. + + - QStringRef: + * Added missing operator{<,>,<=,>=} comparing against QLatin1String and + QString. + + - QSysInfo: + * The output of QSysInfo::prettyProductName now includes the Windows + OS/kernel version number. In case of future versions of Windows, a + valid string is now returned. + + - QSettings: + * [QTBUG-56124] Fixed a bug that caused QSettings to fail on Apple + platforms when strings with embedded null (\0) bytes were present + + - QSharedPointer: + * [QTBUG-52369] Fixed a bug that caused QSharedPointer to fail to compile + if it was initialized with a nullptr literal. + * Fixed a bug that made QSharedPointer delete the pointer it held with the + wrong destructor if the type of the QSharedPointer and that of the object + passed on the constructor were different. Its behavior is now the same as + std::shared_ptr. + + - QStandardPaths: + * [QTBUG-55507] Fixed the QStandardPaths::FontsLocation on XDG systems to + be $XDG_DATA_DIR/fonts. + * Fixed handling of potential paths that do not exist on Windows. Now, + QStandardPaths may return storage locations that may not exist on all + platforms. + + - QTimer: + * Added support for std::chrono duration objects for QTimer methods, + like QTimer::singleShot and QTimer::setInterval. + + - QWaitCondition: + * Added notify_one() and notify_all() to make QWaitCondition be usable from + algorithms that use the Standard Library naming convention. + +QtDBus +------ + + - QDBusConnection: + * Fixed a bug that would cause QDBusConnection::connect() to return true + if a slot was already connected to the same D-Bus signal. QtDBus does + not support multiple connections. + +QtGui +----- + + - [QFileDialogOptions/QFontDialogOptions/QMessageDialogOptions/ + QColorDialogOptions] These classes no longer have value semantics, but + need to be held in QSharedPointer (as they always were). To copy an + instance, use the clone() method. + - QOpenGLTextureBlitter, a utility class to draw textured quads, has been + made public. + - [QTBUG-38825] Fixed QTextEdit to match undo functionality of QLineEdit + to group two sequential inserts into one undo action. + - [QTBUG-51844] Added rotation and uniqueId properties to + QTouchEvent::TouchPoint. This is mainly for the benefit of the TUIO + plugin so far: it now supports tracking physical objects (fiducials) + on the touchscreen surface, as long as the object's ID can fit in a + 64-bit integer. QPointingDeviceUniqueId is a wrapper for the ID, + designed to be extensible to support other types of IDs in the future. + - [QTBUG-52510] A stationary touchpoint event is delivered if its + velocity changes. This is to ensure that the application will be + notified when a TUIO fiducial object comes to rest. + - [QTBUG-53076] Add QGuiApplication::applicationDisplayNameChanged() + signal. + + - QAbstractTextDocumentLayout: + * Added imageAt() and formatAt() methods, which respectively can be used + to retrieve the source link of the image under the cursor, or the + QTextFormat of the text under the cursor. + + - QFont: + * [QTBUG-48043] The default value of QFont::stretch() is now 0 to + indicate any default stretch is acceptable. + + - QRegion: + * Is now iterable as a container of QRects: added {c,}{r,}{begin,end}(). + + - Text handling: + * [QTBUG-51411] Fixed performance hit from showing large QTextDocuments + in a QTextEdit or QTextBrowser. (Regression introduced in Qt 5.3.0) + * [QTBUG-50090] Fixed line spacing with some scalable fonts containing + bitmaps with the Freetype font engine. + * [QTBUG-56346] Fixed QStaticText when manually breaking lines and no + text width was set. + * [QTBUG-56659] Fixed a regression where raster fonts on Windows were + detected as smoothly scalable and thus rendering with said fonts in Qt + Quick would break. + * [QTBUG-51223] Fixed synthesized oblique for non-latin text on + platforms using the basic font database, such as Android. + * [QTBUG-56672] Fixed list of supported sizes for bitmap fonts on + Windows. + * [QTBUG-56714] Fixed a bug where a no-break space would sometimes cause + the first character of the containing line to not be displayed. + * [QTBUG-55856] Fixed rendering of large fonts when a device pixel ratio + is set and the Freetype engine is used. + +QtNetwork +--------- + + - Added QNetworkDatagram class, along with new function receiveDatagram() + in QUdpSocket that returns it, and an overload to writeDatagram() that + can accept it. + - Added QSctpServer and QSctpSocket classes. Note that these need to be + explicitly enabled via a configure option. + - [QTBUG-50956] Added support for HTTP/2 protocol + + - QSslSocket: + * [QTBUG-39077] TLS PSK ciphers are possible in server sockets. + * It is now possible to set custom Diffie-Hellman parameters for + QSslSocket-based servers. + + - QTcpServer: + * [QTBUG-51288] It is now possible to use QTcpServer with an externally + created QTcpSocket. + +QtSql +----- + + - QSqlDatabase: + * When connecting to a MySQL server whose version is 5.5.3 or higher, + the default connection charset is now utf8mb4 instead of utf8 to allow + 4-byte UTF-8 encodings. + + - SQLite: + * Added notification feature to SQLite driver + +QTestLib +-------- + + - [QTBUG-44030] Added QTest::createTouchDevice() for use in autotests + which generate touch events. + - Added ref-cycles perf counter. + - QFETCH variables can now be declared const (QFETCH(const T, name)). + - It is now possible to use variables of types with an explicit operator + bool in the QVERIFY macro. + +QtWidgets +--------- + + - QFormLayout: + * [QTBUG-15990] Added removeRow(), takeRow(). + + - QMainWindow: + * [QTBUG-56628] Fixed crash using takeCentralWidget when the central + widget was not set. + +**************************************************************************** +* Platform-specific Changes * +**************************************************************************** + + - Added technology preview support for Apple tvOS and Apple watchOS. + - Added initial support for Microsoft Visual Studio 2017, which uses the + mkspec "win32-msvc2017". Full support will happen after the final release + of that compiler. + +Android +------- + + - [QTBUG-48948] Show password while typing is now supported + - [QTBUG-55035][QTBUG-50759] Introduced a mechanism to forward + permission related callbacks on Activity objects to interested + parties. + +Apple platforms +--------------- + + - Added QImage::toCGImage() that returns a CGImage. + - Added functions that convert Qt types QPoint/QPointF, QRect/QRectF and + QSize/QSizeF to and from CGPoint, CGRect and CGSize. Note that QPoint, + QRect and QSize do not provide fromCGXxx functions since that would + silently lose precision. + +iOS +--- + + - Precompiled headers are now supported on iOS. + - Starting from iOS 10, Apple requires all apps that need access to photos + to have the key 'NSPhotoLibraryUsageDescription' in the Info.plist. + Therefore, to get the same support in Qt (when, e.g., using a file + dialog), the Info.plist assigned to QMAKE_INFO_PLIST will need this key + as well. + +macOS +----- + + - Speech to text dictation now works for Qt text input. + - [QTBUG-33708] Fixed underline position in font rendering. + +Linux +----- + + - [QTBUG-39959] QWidget-based applications running on the eglfs platform + plugin can now request 180 or 90 degrees rotated output by setting the + QT_QPA_EGLFS_ROTATION environment variable. + - KDE/Gnome themes now implement QPlatformTheme::fileIconPixmap(), showing + file icons. + +Windows +------- + + - [QTBUG-31476] QFactoryLoader now filters potential plugins by the + ".dll" suffix. + - [QTBUG-56239] 'What's this' button is now shown by default only for + QWidget dialogs. + - [QTBUG-53833] QProcess::startDetached() changed behavior on Windows: + it no longer creates a new console window unconditionally, instead it + passes the same creation flags to CreateProcess as QProcess::start(). + + - Text handling: + * [QTBUG-54740] Fixed embedding fonts in PDF when dpi scaling is active + or when the hinting preference was none or vertical hinting. + * [QTBUG-47485] Fix selecting non-regular fonts when using the Freetype + engine. + * [QTBUG-49346] Fixed rendering error when using the MingLiU fonts at + certain combinations of pixel size and scale. + +**************************************************************************** +* Tools * +**************************************************************************** + +configure & build system +------------------------ + + - The -no-feature-* option family was integrated with the rest of the + configuration system. Numerous existing features were made optional, + and build problems in various reduced configurations were fixed. + This is an ongoing effort known as "Qt Lite". + - Numerous Qt modules outside qtbase now support configure options. + In a module-by-module build, these can be passed to qmake itself, + after a -- option. + - Introduced the qtConfig() qmake function to replace the + patterns contains(QT_CONFIG, ) and load(qfeatures)+ + contains(QT_DISABLED_FEATURES, ). + Likewise, the C++ macro QT_CONFIG() was introduced to + replace the pattern !defined(QT_NO_). + The old methods are effectively deprecated and will stop working at + some point in the near future. + - Use of -sysroot will now trigger a cross-build even if -platform and + -xplatform are the same. + - The JPEG & GIF handlers and the SQL drivers are now always built as + plugins, even in static builds (static "plugins" in this case). + - [GCC] Include paths from system libraries are now marked as such, + resulting in fewer warnings the user cannot do anything about. + - [Windows] config.status.bat is now created, like on Unix. + - [QTBUG-46974] Fixed location of config.status in top-level builds. + - [QTBUG-38792][Unix] The -redo option is now accepted, like on Windows. + - It's now possible to add more arguments when -redo is used. Note that + these arguments are not saved in turn. Likewise for config.status. + - [QTBUG-32896][iOS/clang] Added missing CFBundleIdentifier to library + template. + - [QTBUG-47624] Fixed abort when some, but not all, XCB dependencies + are met. The feature is now disabled instead, as expected. + - [QTBUG-50838] The Raspberry Pi EGL detection now uses pkg-config. + - [QTBUG-52112][Android] Plugins now have a SONAME, as required by + Android 6+. + - [QTBUG-54438] Fixed launching tests, examples, and build tools in + some configurations. + - [QTBUG-56289][GCC@Windows] Fixed -separate-debug-info. + - [QTBUG-57086] Added support for Visual Studio 2017. + +qdbusxml2cpp +------------ + + - [QTBUG-34126] qdbusxml2cpp now supports the --verbose switch, which + provides more details when parsing invalid XML sources. + +qmake +----- + + - Added the $$take_first(), $$take_last(), $$num_add(), $$str_size(), + $$str_member(), and $$sorted() functions. + - The error() function can now be called without arguments to exit + silently. Use after write_file() and similar functions which already + print an error message. + - The $$system() function can return the command's exit code now. + - The $$prompt() function can now print the prompt verbatim. + - QMAKE_EXTRA_TARGETS will now consistently treat the target as a file + name (separator adjustment and quoting). + - [QTBUG-16904][VS] Fixed warning about circular dependencies when + Q_OBJECT is used in .cpp files. + - [QTBUG-36256] packageExists() and PKGCONFIG can now be used + regardless of whether Qt itself was built with pkg-config support. + - [QTBUG-43468][WinRT] Added option to use verbatim manifest files. + - [QTBUG-53905] Fixed OBJECTIVE_SOURCES being moc'd twice. + - [QTBUG-55591][VS2015] Added support for the /DEBUG:FASTLINK option. + - [QTBUG-56507] Fixed parallel builds when a lex source refers to a + file generated from a yacc source. + - [QTBUG-56594][MSVC] Fixed PDB files not being installed for static + libraries. + +moc +--- + + - [MSVC] qmake and moc now cooperate to use the Visual Studio environment + variables (set by the VCVARSALL.BAT script) to find system include + files. A possible consequence is that moc parses application headers + slightly differently, depending on #if conditions that depended on + macros that previous versions had not seen #define'd. Implementers of + other buildsystems are advised to pass the --compiler-flavor=msvc option + to moc. From f55db6738bb5a14ba6ebcfe840225fe9d2ae98c2 Mon Sep 17 00:00:00 2001 From: Robert Griebl Date: Thu, 22 Dec 2016 03:59:08 +0100 Subject: [PATCH 2/9] Silence bogus whitespace "errors" from the DBus XML parser Any amount of whitespace between elements is now reported as an error starting with 5.8. This is (a) wrong and (b) very confusing for users. Change-Id: I2530b2138f95912e5be07e94b7d7fdab49dedbb1 Reviewed-by: Thiago Macieira Reviewed-by: Lars Knoll --- src/dbus/qdbusxmlparser.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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; From 39e80062d0cf0c25b456bd89be827e50a6077efa Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 16 Dec 2016 12:48:18 -0800 Subject: [PATCH 3/9] Work around MSVC ABI stupidity in exporting inline members of base class In this case, the issue was ICC, when compiling QtQml: qv4sequenceobject.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl QList::replace(int,class QItemSelectionRange const &)" (__imp_?replace@?$QList@VQItemSelectionRange@@@@QEAAXHAEBVQItemSelectionRange@@@Z) referenced in function "public: static bool __cdecl QV4::QQmlSequence::deleteIndexedProperty(struct QV4::Managed *,unsigned int)" (?deleteIndexedProperty@?$QQmlSequence@VQItemSelection@@@QV4@@SA_NPEAUManaged@2@I@Z) This applies the same fix as qvector.h has had for ages due to QPolygon. Change-Id: I15b62e0f9cec482fbb40fffd1490d791db5056bc Reviewed-by: Marc Mutz Reviewed-by: Lars Knoll --- src/corelib/itemmodels/qitemselectionmodel.h | 18 ++++++++++++++++++ src/corelib/tools/qvector.h | 2 ++ 2 files changed, 20 insertions(+) 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::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. +*/ + +# 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; +#endif // Q_CC_MSVC + class Q_CORE_EXPORT QItemSelection : public QList { 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 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; Q_TEMPLATE_EXTERN template class Q_CORE_EXPORT QVector; #endif From 86abf43122c0b41371d1f6eee7311079ed7cf2bb Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Tue, 3 Jan 2017 16:53:35 -0800 Subject: [PATCH 4/9] QMacCGContext: Take paint device pixel ratio into account This seems to have been omitted in c52bb0309071bed9e040c79d87f764bac6a396b8. Change-Id: If8cde889af75934c85d9b21bd22095b7e5a4bf32 Task-number: QTBUG-57894 Reviewed-by: Jake Petroules --- src/gui/painting/qcoregraphics.mm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/painting/qcoregraphics.mm b/src/gui/painting/qcoregraphics.mm index 466b18d59b..803328c10f 100644 --- a/src/gui/painting/qcoregraphics.mm +++ b/src/gui/painting/qcoregraphics.mm @@ -495,6 +495,8 @@ QMacCGContext::QMacCGContext(QPaintDevice *paintDevice) : context(0) context = CGBitmapContextCreate(image->bits(), image->width(), image->height(), 8, image->bytesPerLine(), colorspace, flags); CGContextTranslateCTM(context, 0, image->height()); + const qreal devicePixelRatio = paintDevice->devicePixelRatioF(); + CGContextScaleCTM(context, devicePixelRatio, devicePixelRatio); CGContextScaleCTM(context, 1, -1); } From 04b095b24bb335c5e1d28f3470c2c8033df26634 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Fri, 2 Dec 2016 16:25:54 +0100 Subject: [PATCH 5/9] Doc: Properly mention valgrind & callgrind MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Julian Seward is the author mentioned in valgrind_p.h. Also call the whole thing valgrind, since callgrind is part of valgrind. Change-Id: Iaf5958c520b919c1acf93ce368b0839bd06ccd46 Reviewed-by: Friedemann Kleint Reviewed-by: hjk Reviewed-by: Topi Reiniƶ --- .../{CALLGRIND_LICENSE.txt => VALGRIND_LICENSE.txt} | 4 +--- src/testlib/3rdparty/qt_attribution.json | 11 ++++++----- 2 files changed, 7 insertions(+), 8 deletions(-) rename src/testlib/3rdparty/{CALLGRIND_LICENSE.txt => VALGRIND_LICENSE.txt} (94%) diff --git a/src/testlib/3rdparty/CALLGRIND_LICENSE.txt b/src/testlib/3rdparty/VALGRIND_LICENSE.txt similarity index 94% rename from src/testlib/3rdparty/CALLGRIND_LICENSE.txt rename to 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", From 7e3e5b2dcf2e2576065ca9f9850cd1f2126f397f Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 5 Jan 2017 11:28:45 +0100 Subject: [PATCH 6/9] Fix regression in handling Chinese system default font Register font's english name as alias when populating font families. This was incorrectly undone when support for subfamilies was added. Task-number: QTBUG-57856 Change-Id: Ib71f905bb00db86d44fa0921ec56c8c76c332e06 Reviewed-by: Friedemann Kleint Reviewed-by: Liang Qi Reviewed-by: Eskil Abrahamsen Blomfeldt --- .../fontdatabases/windows/qwindowsfontdatabase.cpp | 13 +++++++++++-- .../windows/qwindowsfontdatabase_ft.cpp | 13 +++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) 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 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) From 4a738424aaef7958917b92bd64a08eb6208d9c06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 5 Jan 2017 15:01:02 +0100 Subject: [PATCH 7/9] Fall back to platform theme in QPlatformSystemTrayIcon::createMenu() Commit 824f08046 introduced QPlatformSystemTrayIcon::createMenu() as a way for platforms to provide a system tray menu independently of the menu created by QPlatformTheme::createPlatformMenu(), which would on some platforms be null. Commit 063997f44ffc then made menu creation lazy, which meant that the logic in QSystemTrayIconPrivate::addPlatformMenu() to create the menu turned from "create menu via QPSTI::createMenu() if QPT::createPlatformMenu() returned null", to "create menu via QPSTI::createMenu() if menu was not created yet". The latter logic relied on each platform having implementations of QPlatformSystemTrayIcon::createMenu() which they didn't, resulting in missing menus for system trays on e.g. macOS. With the new lazy logic, the reasonable approach is for the default implementation of createMenu() to use createPlatformMenu(), which will ensure system tray menus on platforms that implement createPlatformMenu(), while still allowing platforms that don't to override createMenu() for special-casing system tray menus. Task-number: QTBUG-57365 Change-Id: Id393e802ac0435200fc885a7f4436b744962f27f Reviewed-by: J-P Nurmi --- src/gui/kernel/qplatformsystemtrayicon.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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 +#include + #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 From be00e37bb35eadcb990b1b9a71b668c83cb89eaf Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 19 Dec 2016 18:56:43 +0100 Subject: [PATCH 8/9] Fix unnecessary regeneration of mocables in VS projects Change dcd2f829 introduced fake files with the extension .cbt for custom build tools that generate code from C++ source inputs. The moc_predefs.h header file falls into this category, because it is generated from dummy.cpp. It turns out that these fake files have to exist. Otherwise the custom build step is executed on every build. That means re-moccing all mocables on every build. Fix this by actually creating the fake .cbt files with some explanatory comment in them. Task-number: QTBUG-57695 Change-Id: I251294334425d9914677787d8ba6da1169b4cca5 Reviewed-by: Oswald Buddenhagen Reviewed-by: Oliver Wolff (cherry picked from commit 5fc2337d740963d019a1e31960a4d12dfec36ea9) Reviewed-by: Maurice Kalinowski --- qmake/generators/win32/msvc_vcproj.cpp | 25 +++++++++++++++++++++---- qmake/generators/win32/msvc_vcproj.h | 1 + 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index 21bdad1bbf..9d04a66ff4 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -760,6 +760,21 @@ bool VcprojGenerator::hasBuiltinCompiler(const QString &file) return false; } +void VcprojGenerator::createCustomBuildToolFakeFile(const QString &cbtFilePath, + const QString &realOutFilePath) +{ + QFile file(fileFixify(cbtFilePath, FileFixifyFromOutdir | FileFixifyAbsolute)); + if (file.exists()) + return; + if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) { + warn_msg(WarnLogic, "Cannot create '%s'.", qPrintable(file.fileName())); + return; + } + file.write("This is a dummy file needed to create "); + file.write(qPrintable(realOutFilePath)); + file.write("\n"); +} + void VcprojGenerator::init() { is64Bit = (project->first("QMAKE_TARGET.arch") == "x86_64"); @@ -887,12 +902,14 @@ void VcprojGenerator::init() if (!hasBuiltinCompiler(file)) { extraCompilerSources[file] += quc.toQString(); } else { - // Use a fake file name foo.moc.cbt for the project view. + // Create a fake file foo.moc.cbt for the project view. // This prevents VS from complaining about a circular // dependency from foo.moc -> foo.moc. - QString out = Option::fixPathToTargetOS(replaceExtraCompilerVariables( - compiler_out, file, QString(), NoShell), false); - out += customBuildToolFilterFileSuffix; + QString realOut = replaceExtraCompilerVariables( + compiler_out, file, QString(), NoShell); + QString out = realOut + customBuildToolFilterFileSuffix; + createCustomBuildToolFakeFile(out, realOut); + out = Option::fixPathToTargetOS(out, false); extraCompilerSources[out] += quc.toQString(); extraCompilerOutputs[out] = file; } diff --git a/qmake/generators/win32/msvc_vcproj.h b/qmake/generators/win32/msvc_vcproj.h index e3e67d64b9..4882296b46 100644 --- a/qmake/generators/win32/msvc_vcproj.h +++ b/qmake/generators/win32/msvc_vcproj.h @@ -130,6 +130,7 @@ private: bool isStandardSuffix(const QString &suffix) const; ProString firstInputFileName(const ProString &extraCompilerName) const; QString firstExpandedOutputFileName(const ProString &extraCompilerName); + void createCustomBuildToolFakeFile(const QString &cbtFilePath, const QString &realOutFilePath); friend class VCFilter; }; From cfd069181c01bbade16c173a96100819aa719613 Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Thu, 12 Jan 2017 11:31:17 +0100 Subject: [PATCH 9/9] winrt: Fix Qt5PrintSupport(d).lib generation With QT_NO_PRINTER set via the feature system there is no symbol exported at all in a packaging build. This implies that no .lib is generated. When an application has QT+=printsupport the build will fail due to a missing file. For android and ios it only worked as there is no separation and linker works against the .so file Task-number: QTBUG-56321 Change-Id: I389adaca61669b302b6c431effed2ef6d1c499a3 Reviewed-by: Simon Hausmann Reviewed-by: Friedemann Kleint --- src/printsupport/kernel/qprinter.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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