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

Conflicts:
	src/corelib/global/qlogging.cpp

Change-Id: I9cc8f25ad897efab6a42cb5c5161b1c9402952f0
This commit is contained in:
Liang Qi 2016-09-23 22:28:33 +02:00
commit 680dd3313c
12 changed files with 83 additions and 35 deletions

View File

@ -76,6 +76,12 @@ IPHONESIMULATOR_GENERIC_DESTINATION := "id=$(shell $(SPECDIR)/ios_devices.pl "iP
DESTINATION = $(if $(DESTINATION_ID),"id=$(DESTINATION_ID)",$(value $(call toupper,$(call basesdk,$(SDK)))_GENERIC_DESTINATION))
XCODE_VERSION_MAJOR := $(shell xcodebuild -version | grep Xcode | sed -e 's/Xcode //' | sed -e 's/\..*//')
ifeq ($(shell test $(XCODE_VERSION_MAJOR) -gt 7; echo $$?),0)
XCODEBUILD_FLAGS += $(shell echo "$(MAKEFLAGS)" | sed -e 's/\([^ ]*\).*/\1/' | grep -qv 's' || echo -quiet)
endif
# Xcodebuild
DESTINATION_MESSAGE = "Running $(call tolower,$(CONFIGURATION)) $(ACTION) \
@ -83,7 +89,7 @@ DESTINATION_MESSAGE = "Running $(call tolower,$(CONFIGURATION)) $(ACTION) \
xcodebuild-%:
@$(if $(DESTINATION_NAME), echo $(DESTINATION_MESSAGE),)
xcodebuild $(ACTION) -scheme $(TARGET) $(if $(SDK), -sdk $(SDK),) $(if $(CONFIGURATION), -configuration $(CONFIGURATION),) $(if $(DESTINATION), -destination $(DESTINATION) -destination-timeout 1,)
xcodebuild $(ACTION) $(XCODEBUILD_FLAGS) -scheme $(TARGET) $(if $(SDK), -sdk $(SDK),) $(if $(CONFIGURATION), -configuration $(CONFIGURATION),) $(if $(DESTINATION), -destination $(DESTINATION) -destination-timeout 1,)
xcodebuild-check-device_%: DESTINATION_ID=$(lastword $(subst _, ,$@))

View File

@ -491,6 +491,32 @@ static QString xcodeFiletypeForFilename(const QString &filename)
return QString();
}
static bool compareProvisioningTeams(const QVariantMap &a, const QVariantMap &b)
{
int aFree = a.value(QLatin1String("isFreeProvisioningTeam")).toBool() ? 1 : 0;
int bFree = b.value(QLatin1String("isFreeProvisioningTeam")).toBool() ? 1 : 0;
return aFree < bFree;
}
static QList<QVariantMap> provisioningTeams()
{
const QSettings xcodeSettings(
QDir::homePath() + QLatin1String("/Library/Preferences/com.apple.dt.Xcode.plist"),
QSettings::NativeFormat);
const QVariantMap teamMap = xcodeSettings.value(QLatin1String("IDEProvisioningTeams")).toMap();
QList<QVariantMap> flatTeams;
for (QVariantMap::const_iterator it = teamMap.begin(), end = teamMap.end(); it != end; ++it) {
const QString emailAddress = it.key();
QVariantMap team = it.value().toMap();
team[QLatin1String("emailAddress")] = emailAddress;
flatTeams.append(team);
}
// Sort teams so that Free Provisioning teams come last
std::sort(flatTeams.begin(), flatTeams.end(), ::compareProvisioningTeams);
return flatTeams;
}
bool
ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
{
@ -1405,25 +1431,11 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
QMap<QString, QString> settings;
if (!project->isActiveConfig("no_xcode_development_team")) {
const QSettings xcodeSettings(
QDir::homePath() + QLatin1String("/Library/Preferences/com.apple.dt.Xcode.plist"),
QSettings::NativeFormat);
const QVariantMap teams = xcodeSettings.value(QLatin1String("IDEProvisioningTeams")).toMap();
const QList<QVariantMap> teams = provisioningTeams();
if (!teams.isEmpty()) {
for (QVariantMap::const_iterator it = teams.begin(), end = teams.end(); it != end; ++it) {
const QVariantMap team = it.value().toMap();
const QString teamType = team.value(QLatin1String("teamType")).toString();
// Skip Company teams because signing permissions may not be available under all
// circumstances for users who are not the Team Agent
if (teamType != QLatin1String("Company")) {
const QString teamId = team.value(QLatin1String("teamID")).toString();
settings.insert("DEVELOPMENT_TEAM", teamId);
// first suitable team we found is the one we'll use by default
break;
}
}
// first suitable team we find is the one we'll use by default
settings.insert("DEVELOPMENT_TEAM",
teams.first().value(QLatin1String("teamID")).toString());
}
}
settings.insert("COPY_PHASE_STRIP", (as_release ? "YES" : "NO"));

View File

@ -1136,6 +1136,7 @@ void QMessagePattern::setPattern(const QString &pattern)
backtraceArgs.append(backtraceParams);
#else
error += QLatin1String("QT_MESSAGE_PATTERN: %{backtrace} is not supported by this Qt build\n");
tokens[i] = "";
#endif
}

View File

@ -2392,7 +2392,7 @@ void QWindowPrivate::maybeQuitOnLastWindowClosed()
bool lastWindowClosed = true;
for (int i = 0; i < list.size(); ++i) {
QWindow *w = list.at(i);
if (!w->isVisible() || w->transientParent())
if (!w->isVisible() || w->transientParent() || w->type() == Qt::ToolTip)
continue;
lastWindowClosed = false;
break;

View File

@ -5637,15 +5637,16 @@ static void qt_gradient_quint16(int count, const QSpan *spans, void *userData)
int yinc = int((linear.dy * data->m22 * gss) * FIXPT_SIZE);
int off = int((((linear.dy * (data->m22 * qreal(0.5) + data->dy) + linear.off) * gss) * FIXPT_SIZE));
QRgba64 oldColor = data->solid.color;
// Save the fillData since we overwrite it when setting solid.color.
QGradientData gradient = data->gradient;
while (count--) {
int y = spans->y;
data->solid.color = QRgba64::fromArgb32(qt_gradient_pixel_fixed(&data->gradient, yinc * y + off));
data->solid.color = QRgba64::fromArgb32(qt_gradient_pixel_fixed(&gradient, yinc * y + off));
blend_color_rgb16(1, spans, userData);
++spans;
}
data->solid.color = oldColor;
data->gradient = gradient;
} else {
blend_src_generic(count, spans, userData);

View File

@ -317,6 +317,13 @@ bool QRawFont::operator==(const QRawFont &other) const
/*!
Returns the ascent of this QRawFont in pixel units.
The ascent of a font is the distance from the baseline to the
highest position characters extend to. In practice, some font
designers break this rule, e.g. when they put more than one accent
on top of a character, or to accommodate an unusual character in
an exotic language, so it is possible (though rare) that this
value will be too small.
\sa QFontMetricsF::ascent()
*/
qreal QRawFont::ascent() const
@ -327,6 +334,11 @@ qreal QRawFont::ascent() const
/*!
Returns the descent of this QRawFont in pixel units.
The descent is the distance from the base line to the lowest point
characters extend to. In practice, some font designers break this rule,
e.g. to accommodate an unusual character in an exotic language, so
it is possible (though rare) that this value will be too small.
\sa QFontMetricsF::descent()
*/
qreal QRawFont::descent() const
@ -337,6 +349,8 @@ qreal QRawFont::descent() const
/*!
Returns the xHeight of this QRawFont in pixel units.
This is often but not always the same as the height of the character 'x'.
\sa QFontMetricsF::xHeight()
*/
qreal QRawFont::xHeight() const
@ -347,6 +361,8 @@ qreal QRawFont::xHeight() const
/*!
Returns the leading of this QRawFont in pixel units.
This is the natural inter-line spacing.
\sa QFontMetricsF::leading()
*/
qreal QRawFont::leading() const

View File

@ -362,6 +362,12 @@ static const char *getFcFamilyForStyleHint(const QFont::StyleHint style)
return stylehint;
}
static inline bool requiresOpenType(int writingSystem)
{
return ((writingSystem >= QFontDatabase::Syriac && writingSystem <= QFontDatabase::Sinhala)
|| writingSystem == QFontDatabase::Khmer || writingSystem == QFontDatabase::Nko);
}
static void populateFromPattern(FcPattern *pattern)
{
QString familyName;
@ -430,7 +436,7 @@ static void populateFromPattern(FcPattern *pattern)
FcLangResult langRes = FcLangSetHasLang(langset, lang);
if (langRes != FcLangDifferentLang) {
#if FC_VERSION >= 20297
if (capabilityForWritingSystem[j] != Q_NULLPTR) {
if (capabilityForWritingSystem[j] != Q_NULLPTR && requiresOpenType(j)) {
if (cap == Q_NULLPTR)
capRes = FcPatternGetString(pattern, FC_CAPABILITY, 0, &cap);
if (capRes == FcResultMatch && strstr(reinterpret_cast<const char *>(cap), capabilityForWritingSystem[j]) == 0)

View File

@ -1036,7 +1036,9 @@ void QFontDialog::done(int result)
bool QFontDialogPrivate::canBeNativeDialog() const
{
Q_Q(const QFontDialog);
// Don't use Q_Q here! This function is called from ~QDialog,
// so Q_Q calling q_func() invokes undefined behavior (invalid cast in q_func()).
const QDialog * const q = static_cast<const QDialog*>(q_ptr);
if (nativeDialogInUse)
return true;
if (QCoreApplication::testAttribute(Qt::AA_DontUseNativeDialogs)

View File

@ -717,7 +717,7 @@ void QGraphicsScenePrivate::removeItemHelper(QGraphicsItem *item)
++it;
}
QGraphicsObject *dummy = static_cast<QGraphicsObject *>(item);
QGraphicsObject *dummy = item->toGraphicsObject();
cachedTargetItems.removeOne(dummy);
cachedItemGestures.remove(dummy);
cachedAlreadyDeliveredGestures.remove(dummy);
@ -996,7 +996,7 @@ void QGraphicsScenePrivate::ungrabMouse(QGraphicsItem *item, bool itemIsDying)
// If the item is a popup, go via removePopup to ensure state
// consistency and that it gets hidden correctly - beware that
// removePopup() reenters this function to continue removing the grab.
removePopup((QGraphicsWidget *)item, itemIsDying);
removePopup(popupWidgets.constLast(), itemIsDying);
return;
}

View File

@ -342,6 +342,7 @@ bool QTipLabel::eventFilter(QObject *o, QEvent *e)
case QEvent::FocusIn:
case QEvent::FocusOut:
#endif
case QEvent::Close: // For QTBUG-55523 (QQC) specifically: Hide tooltip when windows are closed
case QEvent::MouseButtonPress:
case QEvent::MouseButtonRelease:
case QEvent::MouseButtonDblClick:

View File

@ -5062,9 +5062,10 @@ void tst_QGraphicsItem::sceneEventFilter()
delete ti;
}
class GeometryChanger : public QGraphicsItem
class GeometryChanger : public QGraphicsRectItem
{
public:
explicit GeometryChanger(QRectF r) : QGraphicsRectItem(r) {}
void changeGeometry()
{ prepareGeometryChange(); }
};
@ -5073,10 +5074,12 @@ void tst_QGraphicsItem::prepareGeometryChange()
{
{
QGraphicsScene scene;
QGraphicsItem *item = scene.addRect(QRectF(0, 0, 100, 100));
QVERIFY(scene.items(QRectF(0, 0, 100, 100)).contains(item));
((GeometryChanger *)item)->changeGeometry();
QVERIFY(scene.items(QRectF(0, 0, 100, 100)).contains(item));
const QRectF rect(0, 0, 100, 100);
GeometryChanger item(rect);
scene.addItem(&item);
QVERIFY(scene.items(rect).contains(&item));
item.changeGeometry();
QVERIFY(scene.items(rect).contains(&item));
}
}

View File

@ -1718,14 +1718,14 @@ void tst_QDom::germanUmlautToFile() const
QDomDocument d("test");
d.appendChild(d.createElement(name));
QFile file("germanUmlautToFile.xml");
QVERIFY(file.open(QIODevice::WriteOnly));
QTemporaryFile file;
QVERIFY(file.open());
QTextStream ts(&file);
ts.setCodec("UTF-8");
ts << d.toString();
file.close();
QFile inFile("germanUmlautToFile.xml");
QFile inFile(file.fileName());
QVERIFY(inFile.open(QIODevice::ReadOnly));
QString baseline(QLatin1String("<!DOCTYPE test>\n<german"));