Merge remote-tracking branch 'origin/5.7' into 5.8

Conflicts:
	src/gui/painting/qcoregraphics.mm
	src/gui/painting/qcoregraphics_p.h
	src/plugins/platforms/cocoa/qcocoahelpers.h
	src/plugins/platforms/cocoa/qcocoahelpers.mm

Change-Id: Ibe5efcae73526b3d3931ed22730b13d372dcf54e
This commit is contained in:
Liang Qi 2016-11-25 14:39:51 +01:00
commit bce25a6340
16 changed files with 323 additions and 77 deletions

221
dist/changes-5.7.1 vendored Normal file
View File

@ -0,0 +1,221 @@
Qt 5.7.1 is a bug-fix release. It maintains both forward and backward
compatibility (source and binary) with Qt 5.7.0.
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.7 series is binary compatible with the 5.6.x series.
Applications compiled for 5.6 will continue to run with 5.7.
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.6.2 release.
****************************************************************************
* Important Behavior Changes *
****************************************************************************
- [QTBUG-45031] The NSURLConnection backend of QNetworkAccessManager has
been removed, since SecureTransport is the default SSL backend on iOS
and is enabled by default. This means that building with -no-openssl
-no-securetransport will no longer provide SSL capabilities on iOS.
- QtCore / QDataStream:
* [QTBUG-54022] Incomplete reads of Qt containers are now handled same
way as for primitive types, meaning that previous errors are latched.
****************************************************************************
* Library *
****************************************************************************
QtCore
------
- QLockFile:
* Fixed permissions on lock files on Unix to allow for adjustments via
umask.
- QMimeType:
* [QTBUG-50776] QMimeType::comment() now uses the default locale rather
than system locale, so that applications can control which language is
being used.
- QUrl:
* QUrl::resolved() no longer treats a URL with a scheme as a relative URL
if it matches this URL's scheme. For now it still treats "file:name.txt"
as relative for compatibility, but be warned that in Qt 5.8 it will no
longer consider those to be relative. Both isRelative() and RFC 3986 say
that such URLs are not relative, so starting from Qt 5.8, resolved() will
return them as is.
- QXmlStreamReader:
* Fixed a bug in the XML parser that prevented to load XML that
contained invalid characters for XML 1.0.
- QXmlStreamWriter:
* Fixed a bug that prevented the generation of valid XML files when
using encoding with 8 bit per character but not ASCII compatible.
QXMLStreamWriter generated XML markup using always ASCII in this case.
QtGui
-----
- QGuiApplication:
* [QTBUG-51703] Fixed a bug that would cause QGuiApplication::sync() to
be left undefined for Qt builds without session management support.
- QIconLoaderEngine:
* Fixed theme lookup for scalable entries
- QTextDocument:
* [QTBUG-48182] Fixed a bug that would return a wrong position when
searching backward from the end of the document.
- Text:
* [QTBUG-49452] Fixed a performance regression in Freetype engine that
was introduced in Qt 5.5.
* [QTBUG-53911] Fixed a crash that could happen if you were doing many
different text layouts with different fonts and superscript or
subscript alignment.
* [QTBUG-42033] Fixed bug where a QTextLayout with
ShowLineAndParagraphSeparators would modify the layout's input string.
* [QTBUG-54180] Fixed performance regression when rapidly switching
between a large set of fonts.
QtNetwork
---------
- QSslSocket:
* [QTBUG-55170] Fixed a bug in SecureTransport backend that would cause
a memory usage growth in case 'readBufferMaxSize' is set.
* [QTBUG-52975] Fixed a bug in SecureTransport backend where transmit
was using invalid SSL context and reporting (incorrectly) some irrelevant
errors as a result.
QtSql
-----
- [QTBUG-53969][QTBUG-53237] Fixed QSqlQuery::prepare value truncation
error when using UNSIGNED values in a MySQL database.
QtWidgets
---------
- QAbstractItemDelegate:
* [QTBUG-16469] Show localized detailed tooltips and "What's this?"
texts.
- QTreeView:
* [QTBUG-52793] Fixed a key navigation bug when the columns were
reordered.
****************************************************************************
* Platform-specific Changes *
****************************************************************************
Android
-------
- [QTBUG-50724] Added support for clang compiler
- [QTBUG-53511] Fixed CJK font resolution on Android 7.
FreeBSD
-------
- The freebsd-g++ mkspec was moved back and no longer requires the
"unsupported/" prefix, matching the FreeBSD ports tree, as FreeBSD 9.3
still defaults to using GCC. Users of GCC that did not previously use
the ports patch will need to adapt their build scripts and drop the
"unsupported/" prefix.
Linux
-----
- [QTBUG-54733] It is now possible to opt out from installing signal
handlers when running with eglfs and linuxfb by setting the
QT_QPA_NO_SIGNAL_HANDLER environment variable to a non-zero value.
- [QTBUG-55140] xcb with EGL and OpenGL ES, as well as eglfs with the
eglfs_x11 backend, are now supported on DRIVE CX boards when using the
linux-drive-cx-g++ device spec.
Windows
-------
- [QTBUG-41186] QWindow::fromWinId() may return 0 when passing invalid
window handles.
- [QTBUG-55595] Fixed crash when loading color fonts from data.
- [QTBUG-55097] Fixed rendering Adobe/Mozilla format color fonts with
other colors than black after Windows 10 Anniversary update.
- [QTBUG-54494] Fixed stretch when combined with either no or vertical
hinting preference or a device pixel ratio different from 1.
- [QTBUG-51024] Fixed height of text bounding box when using no or
vertical hinting preference, or when the device pixel ratio is
different from 1.
****************************************************************************
* Tools *
****************************************************************************
configure & build system
------------------------
- [QTBUG-35886][QTBUG-51417] Fixed Fontconfig vs. system FreeType
configuration.
- [QTBUG-43784][X11] Fixed detection of GLX with -qt-xcb.
- [QTBUG-51534][Windows] The configure.exe bootstrapping now prefers
cl over clang-cl, to avoid header incompatibility problems.
- [QTBUG-52940] Fixed missing plugins.qmltypes files in static builds.
- [QTBUG-52951] Fixed dynamic library support detection for platforms
without libdl.
- [QTBUG-53038] Fixed running of configure tests outside qtbase when
cross compiling on Windows (for example for Android).
- [QTBUG-53312] The flags supplied by the configure -D/-I/-L/-l options
are now applied after Qt's own flags. This helps in some cases when
the provided paths contain files which conflict with the Qt build.
- [QTBUG-53926] Fixed linkage of QML plugins in static prefix builds.
- [QTBUG-55011][Unix] Fixed -no-pkg-config being ignored by some
configure tests, which led to build failures later on.
- Fixed configure tests outside qtbase when $MAKEFLAGS contains the
-i flag.
- [Android] Some unused plugins are not built anymore.
- [MinGW] Added support for -separate-debug-info.
- [Unix] Added configure -no-opengles3 option.
- [Unix] Fixed MySQL detection/use on RHEL 6.6.
qmake
-----
- [QTBUG-41830] Fixed nested custom functions inheriting their callers'
arguments.
- [QTBUG-53895][MSVC] Started using separate PDB files for compiling
and linking.
- [QTBUG-54036][Darwin] Fixed installation of debug symbols.
- [QTBUG-54299] Various QMAKE_EXTRA_COMPILERS' .depends entries are now
appended to rather than overwritten.
- [QTBUG-54346][MSys/Apple] Fixed detection of QMAKE_DEFAULT_{INC,LIB}DIRS.
- [QTBUG-54550] Fixed access to freed memory in $$absolute_path().
- [QTBUG-54674] The obsolete -target xp is now properly rejected.
- [QTBUG-55183][nmake] _WINDLL is now automatically defined when building
a DLL, consistently with Visual Studio.
- [QTBUG-55505] Fixed build of projects with spaces in the source or build
path against static builds of Qt.
- [QTBUG-55649][QTBUG-55915][Xcode] Fixed support for Xcode 8.
- [QTBUG-56162][MinGW] Fixed -release -force-debug-info missing both
optimization and debug info.
- Fixed several cases where the error() function would not abort qmake.
- Interrupting a command run via system() will now abort qmake as well.
- The packagesExist() function will now warn when used when Qt was
configured with -no-pkg-config.
- [Android] The default compiler flags were adjusted to match newer
NDK versions.
- [Darwin] Fixed detection of QMAKE_DEFAULT_INCDIRS.
- [Darwin][make] Added support for building Xcode asset catalogs.

View File

@ -6,6 +6,7 @@ QMAKE_COMPILER = gcc clang llvm
CONFIG += android_install unversioned_soname unversioned_libname plugin_with_soname android_deployment_settings
include(../common/linux.conf)
include(../common/gcc-base-unix.conf)
include(../common/clang.conf)
include(../common/android-base-head.conf)

View File

@ -308,7 +308,12 @@ void MingwMakefileGenerator::writeBuildRulesPart(QTextStream &t)
{
t << "first: all\n";
t << "all: " << escapeDependencyPath(fileFixify(Option::output.fileName()))
<< ' ' << depVar("ALL_DEPS") << " $(DESTDIR_TARGET)\n\n";
<< ' ' << depVar("ALL_DEPS");
if (project->first("TEMPLATE") == "aux") {
t << "\n\n";
return;
}
t << " $(DESTDIR_TARGET)\n\n";
t << "$(DESTDIR_TARGET): " << depVar("PRE_TARGETDEPS") << " $(OBJECTS) " << depVar("POST_TARGETDEPS");
if(!project->isEmpty("QMAKE_PRE_LINK"))
t << "\n\t" <<var("QMAKE_PRE_LINK");
@ -318,7 +323,7 @@ void MingwMakefileGenerator::writeBuildRulesPart(QTextStream &t)
} else {
t << "\n\t" << objectsLinkLine << " " ;
}
} else if (project->first("TEMPLATE") != "aux") {
} else {
t << "\n\t$(LINKER) $(LFLAGS) " << var("QMAKE_LINK_O_FLAG") << "$(DESTDIR_TARGET) " << objectsLinkLine << " $(LIBS)";
}
if(!project->isEmpty("QMAKE_POST_LINK"))

View File

@ -517,7 +517,12 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t)
t << "first: all\n";
t << "all: " << escapeDependencyPath(fileFixify(Option::output.fileName()))
<< ' ' << depVar("ALL_DEPS") << " $(DESTDIR_TARGET)\n\n";
<< ' ' << depVar("ALL_DEPS");
if (templateName == "aux") {
t << "\n\n";
return;
}
t << " $(DESTDIR_TARGET)\n\n";
t << "$(DESTDIR_TARGET): " << depVar("PRE_TARGETDEPS") << " $(OBJECTS) " << depVar("POST_TARGETDEPS");
if(!project->isEmpty("QMAKE_PRE_LINK"))
@ -526,7 +531,7 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t)
t << "\n\t$(LIBAPP) $(LIBFLAGS) " << var("QMAKE_LINK_O_FLAG") << "$(DESTDIR_TARGET) @<<\n\t "
<< "$(OBJECTS)"
<< "\n<<";
} else if (templateName != "aux") {
} else {
const bool embedManifest = ((templateName == "app" && project->isActiveConfig("embed_manifest_exe"))
|| (templateName == "lib" && project->isActiveConfig("embed_manifest_dll")
&& !(project->isActiveConfig("plugin") && project->isActiveConfig("no_plugin_manifest"))

View File

@ -568,16 +568,18 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
t << "####### Build rules\n\n";
writeBuildRulesPart(t);
if(project->isActiveConfig("shared") && !project->values("DLLDESTDIR").isEmpty()) {
const ProStringList &dlldirs = project->values("DLLDESTDIR");
for (ProStringList::ConstIterator dlldir = dlldirs.begin(); dlldir != dlldirs.end(); ++dlldir) {
t << "\t-$(COPY_FILE) $(DESTDIR_TARGET) "
<< escapeFilePath(Option::fixPathToTargetOS((*dlldir).toQString(), false)) << endl;
if (project->first("TEMPLATE") != "aux") {
if (project->isActiveConfig("shared") && !project->values("DLLDESTDIR").isEmpty()) {
const ProStringList &dlldirs = project->values("DLLDESTDIR");
for (ProStringList::ConstIterator dlldir = dlldirs.begin(); dlldir != dlldirs.end(); ++dlldir) {
t << "\t-$(COPY_FILE) $(DESTDIR_TARGET) "
<< escapeFilePath(Option::fixPathToTargetOS((*dlldir).toQString(), false)) << endl;
}
}
}
t << endl;
t << endl;
writeRcFilePart(t);
writeRcFilePart(t);
}
writeMakeQmake(t);
@ -601,8 +603,10 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
const ProStringList &quc = project->values("QMAKE_EXTRA_COMPILERS");
for (ProStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) {
const ProStringList &inputs = project->values(ProKey(*it + ".input"));
for (ProStringList::ConstIterator input = inputs.begin(); input != inputs.end(); ++input)
t << escapeFilePath(*input) << ' ';
for (ProStringList::ConstIterator input = inputs.begin(); input != inputs.end(); ++input) {
const ProStringList &val = project->values((*input).toKey());
t << escapeFilePaths(val).join(' ') << ' ';
}
}
}
t << endl << endl;

View File

@ -500,9 +500,10 @@ namespace {
memcpy(newValues, data, size*sizeof(QJsonPrivate::Value));
data = newValues;
} else {
data = static_cast<QJsonPrivate::Value *>(realloc(data, alloc*sizeof(QJsonPrivate::Value)));
if (!data)
void *newValues = realloc(data, alloc * sizeof(QJsonPrivate::Value));
if (!newValues)
return false;
data = static_cast<QJsonPrivate::Value *>(newValues);
}
return true;
}

View File

@ -108,11 +108,12 @@ private:
inline int reserveSpace(int space) {
if (current + space >= dataLength) {
dataLength = 2*dataLength + space;
data = (char *)realloc(data, dataLength);
if (!data) {
char *newData = (char *)realloc(data, dataLength);
if (!newData) {
lastError = QJsonParseError::DocumentTooLarge;
return -1;
}
data = newData;
}
int pos = current;
current += space;

View File

@ -264,7 +264,7 @@ bool QMimeDatabasePrivate::inherits(const QString &mime, const QString &parent)
\code
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/vnd.nokia.qt.qmakeprofile">
<mime-type type="application/vnd.qt.qmakeprofile">
<comment xml:lang="en">Qt qmake Profile</comment>
<glob pattern="*.pro" weight="50"/>
</mime-type>

View File

@ -3835,7 +3835,7 @@ QString QDateTime::toString(Qt::DateFormat format) const
\li the abbreviated localized day name (e.g. 'Mon' to 'Sun').
Uses the system locale to localize the name, i.e. QLocale::system().
\row \li dddd
\li the long localized day name (e.g. 'Monday' to 'Qt::Sunday').
\li the long localized day name (e.g. 'Monday' to 'Sunday').
Uses the system locale to localize the name, i.e. QLocale::system().
\row \li M \li the month as number without a leading zero (1-12)
\row \li MM \li the month as number with a leading zero (01-12)

View File

@ -104,14 +104,6 @@ public:
none.zeroesAdded = 0;
}
virtual ~QDateTimeParser() {}
enum AmPmFinder {
Neither = -1,
AM = 0,
PM = 1,
PossibleAM = 2,
PossiblePM = 3,
PossibleBoth = 4
};
enum Section {
NoSection = 0x00000,
@ -187,50 +179,11 @@ public:
#ifndef QT_NO_DATESTRING
StateNode parse(QString &input, int &cursorPosition, const QDateTime &currentValue, bool fixup) const;
#endif
int sectionMaxSize(int index) const;
int sectionSize(int index) const;
int sectionMaxSize(Section s, int count) const;
int sectionPos(int index) const;
int sectionPos(const SectionNode &sn) const;
const SectionNode &sectionNode(int index) const;
Section sectionType(int index) const;
QString sectionText(int sectionIndex) const;
QString sectionText(const QString &text, int sectionIndex, int index) const;
int getDigit(const QDateTime &dt, int index) const;
bool setDigit(QDateTime &t, int index, int newval) const;
int parseSection(const QDateTime &currentValue, int sectionIndex, QString &txt, int &cursorPosition,
int index, QDateTimeParser::State &state, int *used = 0) const;
int absoluteMax(int index, const QDateTime &value = QDateTime()) const;
int absoluteMin(int index) const;
bool parseFormat(const QString &format);
#ifndef QT_NO_DATESTRING
bool fromString(const QString &text, QDate *date, QTime *time) const;
#endif
#ifndef QT_NO_TEXTDATE
int findMonth(const QString &str1, int monthstart, int sectionIndex,
QString *monthName = 0, int *used = 0) const;
int findDay(const QString &str1, int intDaystart, int sectionIndex,
QString *dayName = 0, int *used = 0) const;
#endif
AmPmFinder findAmPm(QString &str, int index, int *used = 0) const;
bool potentialValue(const QStringRef &str, int min, int max, int index,
const QDateTime &currentValue, int insert) const;
bool potentialValue(const QString &str, int min, int max, int index,
const QDateTime &currentValue, int insert) const
{
return potentialValue(QStringRef(&str), min, max, index, currentValue, insert);
}
bool skipToNextSection(int section, const QDateTime &current, const QStringRef &sectionText) const;
bool skipToNextSection(int section, const QDateTime &current, const QString &sectionText) const
{
return skipToNextSection(section, current, QStringRef(&sectionText));
}
QString stateName(State s) const;
enum FieldInfoFlag {
Numeric = 0x01,
FixedWidth = 0x02,
@ -242,17 +195,68 @@ public:
FieldInfo fieldInfo(int index) const;
void setDefaultLocale(const QLocale &loc) { defaultLocale = loc; }
virtual QString displayText() const { return text; }
private:
int sectionMaxSize(Section s, int count) const;
QString sectionText(const QString &text, int sectionIndex, int index) const;
int parseSection(const QDateTime &currentValue, int sectionIndex, QString &txt, int &cursorPosition,
int index, QDateTimeParser::State &state, int *used = 0) const;
#ifndef QT_NO_TEXTDATE
int findMonth(const QString &str1, int monthstart, int sectionIndex,
QString *monthName = 0, int *used = 0) const;
int findDay(const QString &str1, int intDaystart, int sectionIndex,
QString *dayName = 0, int *used = 0) const;
#endif
enum AmPmFinder {
Neither = -1,
AM = 0,
PM = 1,
PossibleAM = 2,
PossiblePM = 3,
PossibleBoth = 4
};
AmPmFinder findAmPm(QString &str, int index, int *used = 0) const;
bool potentialValue(const QStringRef &str, int min, int max, int index,
const QDateTime &currentValue, int insert) const;
bool potentialValue(const QString &str, int min, int max, int index,
const QDateTime &currentValue, int insert) const
{
return potentialValue(QStringRef(&str), min, max, index, currentValue, insert);
}
protected: // for the benefit of QDateTimeEditPrivate
int sectionSize(int index) const;
int sectionMaxSize(int index) const;
int sectionPos(int index) const;
int sectionPos(const SectionNode &sn) const;
const SectionNode &sectionNode(int index) const;
Section sectionType(int index) const;
QString sectionText(int sectionIndex) const;
int getDigit(const QDateTime &dt, int index) const;
bool setDigit(QDateTime &t, int index, int newval) const;
int absoluteMax(int index, const QDateTime &value = QDateTime()) const;
int absoluteMin(int index) const;
bool skipToNextSection(int section, const QDateTime &current, const QStringRef &sectionText) const;
bool skipToNextSection(int section, const QDateTime &current, const QString &sectionText) const
{
return skipToNextSection(section, current, QStringRef(&sectionText));
}
QString stateName(State s) const;
virtual QDateTime getMinimum() const;
virtual QDateTime getMaximum() const;
virtual int cursorPosition() const { return -1; }
virtual QString displayText() const { return text; }
virtual QString getAmPmText(AmPm ap, Case cs) const;
virtual QLocale locale() const { return defaultLocale; }
mutable int currentSectionIndex;
Sections display;
/*
This stores the stores the most recently selected day.
This stores the most recently selected day.
It is useful when considering the following scenario:
1. Date is: 31/01/2000
@ -272,9 +276,7 @@ public:
QString displayFormat;
QLocale defaultLocale;
QVariant::Type parserType;
bool fixday;
Qt::TimeSpec spec; // spec if used by QDateTimeEdit
Context context;
};

View File

@ -146,13 +146,16 @@ NSImage *qt_mac_create_nsimage(const QPixmap &pm)
return nsImage;
}
NSImage *qt_mac_create_nsimage(const QIcon &icon)
NSImage *qt_mac_create_nsimage(const QIcon &icon, int defaultSize)
{
if (icon.isNull())
return nil;
NSImage *nsImage = [[NSImage alloc] init];
foreach (QSize size, icon.availableSizes()) {
QList<QSize> availableSizes = icon.availableSizes();
if (availableSizes.isEmpty() && defaultSize > 0)
availableSizes << QSize(defaultSize, defaultSize);
foreach (QSize size, availableSizes) {
QPixmap pm = icon.pixmap(size);
QImage image = pm.toImage();
CGImageRef cgImage = qt_mac_toCGImage(image);

View File

@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE
#ifdef Q_OS_MACOS
Q_GUI_EXPORT NSImage *qt_mac_create_nsimage(const QPixmap &pm);
Q_GUI_EXPORT NSImage *qt_mac_create_nsimage(const QIcon &icon);
Q_GUI_EXPORT NSImage *qt_mac_create_nsimage(const QIcon &icon, int defaultSize = 0);
Q_GUI_EXPORT QPixmap qt_mac_toQPixmap(const NSImage *image, const QSizeF &size);
#endif
Q_GUI_EXPORT CGImageRef qt_mac_toCGImage(const QImage &qImage);

View File

@ -1654,7 +1654,7 @@ void QNetworkAccessManagerPrivate::_q_networkSessionClosed()
QObject::disconnect(networkSession.data(), SIGNAL(closed()), q, SLOT(_q_networkSessionClosed()));
QObject::disconnect(networkSession.data(), SIGNAL(stateChanged(QNetworkSession::State)),
q, SLOT(_q_networkSessionStateChanged(QNetworkSession::State)));
QObject::disconnect(networkSessionStrongRef.data(), SIGNAL(error(QNetworkSession::SessionError)),
QObject::disconnect(networkSession.data(), SIGNAL(error(QNetworkSession::SessionError)),
q, SLOT(_q_networkSessionFailed(QNetworkSession::SessionError)));
networkSessionStrongRef.clear();

View File

@ -360,7 +360,7 @@ NSMenuItem *QCocoaMenuItem::sync()
NSImage *img = nil;
if (!m_icon.isNull()) {
img = qt_mac_create_nsimage(m_icon);
img = qt_mac_create_nsimage(m_icon, m_iconSize);
[img setSize:NSMakeSize(m_iconSize, m_iconSize)];
}
[m_native setImage:img];

View File

@ -837,6 +837,9 @@ bool QWindowsKeyMapper::translateKeyEvent(QWindow *widget, HWND hwnd,
bool QWindowsKeyMapper::translateMultimediaKeyEventInternal(QWindow *window, const MSG &msg)
{
#if defined(WM_APPCOMMAND)
// QTBUG-57198, do not send mouse-synthesized commands as key events in addition
if (GET_DEVICE_LPARAM(msg.lParam) == FAPPCOMMAND_MOUSE)
return false;
const int cmd = GET_APPCOMMAND_LPARAM(msg.lParam);
const int dwKeys = GET_KEYSTATE_LPARAM(msg.lParam);
int state = 0;

View File

@ -1624,7 +1624,7 @@ QString QMYSQLDriver::formatValue(const QSqlField &field, bool trimStrings) cons
Q_D(const QMYSQLDriver);
QString r;
if (field.isNull()) {
r = QLatin1String("NULL");
r = QStringLiteral("NULL");
} else {
switch(field.type()) {
case QVariant::Double: