Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/5.6' into 5.7
Browse files Browse the repository at this point in the history
Conflicts:
	src/corelib/global/qlogging.cpp

Change-Id: I9cc8f25ad897efab6a42cb5c5161b1c9402952f0
  • Loading branch information
liangqi committed Sep 23, 2016
2 parents bde3384 + d95cb94 commit 680dd33
Show file tree
Hide file tree
Showing 12 changed files with 83 additions and 35 deletions.
8 changes: 7 additions & 1 deletion mkspecs/macx-ios-clang/xcodebuild.mk
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,20 @@ 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) \
on '$(DESTINATION_NAME)' ($(DESTINATION_ID))$(if $(DESTINATION_OS),$(,) $(DESTINATION_PLATFORM) $(DESTINATION_OS),)"

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 _, ,$@))

Expand Down
48 changes: 30 additions & 18 deletions qmake/generators/mac/pbuilder_pbx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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"));
Expand Down
1 change: 1 addition & 0 deletions src/corelib/global/qlogging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion src/gui/kernel/qwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 4 additions & 3 deletions src/gui/painting/qdrawhelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
16 changes: 16 additions & 0 deletions src/gui/text/qrawfont.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion src/widgets/dialogs/qfontdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/widgets/graphicsview/qgraphicsscene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}

Expand Down
1 change: 1 addition & 0 deletions src/widgets/kernel/qtooltip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(); }
};
Expand All @@ -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));
}
}

Expand Down
6 changes: 3 additions & 3 deletions tests/auto/xml/dom/qdom/tst_qdom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down

0 comments on commit 680dd33

Please sign in to comment.