From 124da59cb40df5e47e7183dfef90bcd5957ed71f Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Fri, 8 Mar 2013 11:24:36 +0100 Subject: Fix static builds with ICU Make sure we actually link against the static version of the ICU libs for static builds. Task-number: QTBUG-29478 Change-Id: Ida7b439f11c5393bee43bfe804f9ec84bf272b34 Reviewed-by: Friedemann Kleint Reviewed-by: Oswald Buddenhagen Reviewed-by: Joerg Bornemann --- src/corelib/tools/tools.pri | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri index 564aff9ab9..72a873235a 100644 --- a/src/corelib/tools/tools.pri +++ b/src/corelib/tools/tools.pri @@ -122,8 +122,19 @@ contains(QT_CONFIG, zlib) { contains(QT_CONFIG,icu) { SOURCES += tools/qlocale_icu.cpp DEFINES += QT_USE_ICU - win32:LIBS_PRIVATE += -licuin -licuuc - else:LIBS_PRIVATE += -licui18n -licuuc + win32 { + CONFIG(static, static|shared) { + CONFIG(debug, debug|release) { + LIBS_PRIVATE += -lsicuind -lsicuucd -lsicudtd + } else { + LIBS_PRIVATE += -lsicuin -lsicuuc -lsicudt + } + } else { + LIBS_PRIVATE += -licuin -licuuc + } + } else { + LIBS_PRIVATE += -licui18n -licuuc + } } pcre { -- cgit v1.2.3 From 6bc691dde53a3056d708d94d8bb1317d622835b0 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Wed, 6 Mar 2013 10:00:09 +0100 Subject: Revert 6497649730daeab5d3dfac7e806105e99a237656 and clarify docs. It introduced a regression by requiring that a p/P was also present: QTime time = QTime::currentTime(); qDebug() << time.toString("h:mm:ss a"); // Outputs "10:05:42 am" in Qt 4.8. // Outputs "10:05:42 a" with 6497649730daeab5d3dfac7e806105e99a237656. This patch also clarifies the QTime::toString(QString) documentation. Change-Id: I4d73a959c2ca76304f03a4ce9717b540ad4e8811 Reviewed-by: Andy Shaw --- src/corelib/tools/qdatetime.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index 4b6e739759..bf3cc68c06 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -1560,9 +1560,9 @@ QString QTime::toString(Qt::DateFormat format) const \row \li z \li the milliseconds without leading zeroes (0 to 999) \row \li zzz \li the milliseconds with leading zeroes (000 to 999) \row \li AP or A - \li use AM/PM display. \e AP will be replaced by either "AM" or "PM". + \li use AM/PM display. \e A/AP will be replaced by either "AM" or "PM". \row \li ap or a - \li use am/pm display. \e ap will be replaced by either "am" or "pm". + \li use am/pm display. \e a/ap will be replaced by either "am" or "pm". \row \li t \li the timezone (for example "CEST") \endtable @@ -3759,8 +3759,7 @@ static bool hasUnquotedAP(const QString &f) for (int i=0; i Date: Mon, 11 Mar 2013 13:58:35 +0100 Subject: Correct QString's warnings involving QRegularExpression. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaces "QRegularExpresssion" with "QRegularExpression" and adds some auto tests for the warning itself. Task-number: QTBUG-30054 Change-Id: Iba333a4388795eccca809fb430c295f503794263 Reviewed-by: Jędrzej Nowacki --- src/corelib/tools/qstring.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 61d5073a1f..6c64ea9f6d 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -2948,7 +2948,7 @@ QString& QString::replace(const QRegExp &rx, const QString &after) QString &QString::replace(const QRegularExpression &re, const QString &after) { if (!re.isValid()) { - qWarning("QString::replace: invalid QRegularExpresssion object"); + qWarning("QString::replace: invalid QRegularExpression object"); return *this; } @@ -3273,7 +3273,7 @@ int QString::count(const QRegExp& rx) const int QString::indexOf(const QRegularExpression& re, int from) const { if (!re.isValid()) { - qWarning("QString::indexOf: invalid QRegularExpresssion object"); + qWarning("QString::indexOf: invalid QRegularExpression object"); return -1; } @@ -3299,7 +3299,7 @@ int QString::indexOf(const QRegularExpression& re, int from) const int QString::lastIndexOf(const QRegularExpression &re, int from) const { if (!re.isValid()) { - qWarning("QString::lastIndexOf: invalid QRegularExpresssion object"); + qWarning("QString::lastIndexOf: invalid QRegularExpression object"); return -1; } @@ -3328,7 +3328,7 @@ int QString::lastIndexOf(const QRegularExpression &re, int from) const bool QString::contains(const QRegularExpression &re) const { if (!re.isValid()) { - qWarning("QString::contains: invalid QRegularExpresssion object"); + qWarning("QString::contains: invalid QRegularExpression object"); return false; } QRegularExpressionMatch match = re.match(*this); @@ -3350,7 +3350,7 @@ bool QString::contains(const QRegularExpression &re) const int QString::count(const QRegularExpression &re) const { if (!re.isValid()) { - qWarning("QString::count: invalid QRegularExpresssion object"); + qWarning("QString::count: invalid QRegularExpression object"); return 0; } int count = 0; -- cgit v1.2.3 From c7191d3e214b9cdb17ec383b61f7e21e784f80d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Thu, 14 Mar 2013 08:51:07 +0100 Subject: Fixed artifacts when drawing same line with different clips. Expanding on the change fixing QTBUG-24762 with the realization that any line needs to be drawn in a consistent way regardless of system or painter clip, not just dashed lines. Task-number: QTBUG-25036 Change-Id: Ief7ef19cc92c52e7d792500a581a072ba032767e Reviewed-by: Gunnar Sletta --- src/gui/painting/qcosmeticstroker.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/gui/painting/qcosmeticstroker.cpp b/src/gui/painting/qcosmeticstroker.cpp index 1de955bc13..3659c56ac7 100644 --- a/src/gui/painting/qcosmeticstroker.cpp +++ b/src/gui/painting/qcosmeticstroker.cpp @@ -290,14 +290,14 @@ void QCosmeticStroker::setup() ppl = buffer->bytesPerLine()>>2; } - // dashes are sensitive to clips, so we need to clip consistently when painting to the same device - QRect clipRect = strokeSelection & Dashed ? deviceRect : clip; + // line drawing produces different results with different clips, so + // we need to clip consistently when painting to the same device // setup FP clip bounds - xmin = clipRect.left() - 1; - xmax = clipRect.right() + 2; - ymin = clipRect.top() - 1; - ymax = clipRect.bottom() + 2; + xmin = deviceRect.left() - 1; + xmax = deviceRect.right() + 2; + ymin = deviceRect.top() - 1; + ymax = deviceRect.bottom() + 2; lastPixel.x = -1; } -- cgit v1.2.3 From 958b621ba2f13535cd6873ceeaee096c13737549 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Fri, 8 Mar 2013 15:52:27 +0100 Subject: Correct QDate and QTime documentation. Task-number: QTBUG-30055 Change-Id: I94c8e023f5e3d23ff2f1c74d0763b1c825deb3d1 Reviewed-by: Jerome Pasion --- src/corelib/tools/qdatetime.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index bf3cc68c06..86a6a020cd 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -265,8 +265,7 @@ static QString fmtDateTime(const QString& f, const QTime* dt = 0, const QDate* d If the specified date is invalid, the date is not set and isValid() returns false. - \warning Years 0 to 99 are interpreted as is, i.e., years - 0-99. + \warning Years 1 to 99 are interpreted as is. Year 0 is invalid. \sa isValid() */ @@ -1488,10 +1487,7 @@ int QTime::msec() const If \a format is Qt::ISODate, the string format corresponds to the ISO 8601 extended specification for representations of dates, - which is also HH:MM:SS. (However, contrary to ISO 8601, dates - before 15 October 1582 are handled as Julian dates, not Gregorian - dates. See \l{QDate G and J} {Use of Gregorian and Julian - Calendars}. This might change in a future version of Qt.) + which is also HH:MM:SS. If the \a format is Qt::SystemLocaleShortDate or Qt::SystemLocaleLongDate, the string format depends on the locale -- cgit v1.2.3 From 40236c35a62e0838cf150a6e0876e7d4f88e5a35 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Thu, 14 Mar 2013 12:48:35 +0100 Subject: Fixed crash when VNCing and trying to use non-present XFixes extension. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-29978 Change-Id: I1a6759bafaac7a1d2b598412f0d32077a42192a4 Reviewed-by: Samuel Rødal --- src/plugins/platforms/xcb/qxcbcursor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/platforms/xcb/qxcbcursor.cpp b/src/plugins/platforms/xcb/qxcbcursor.cpp index e29b21c9c8..b40fdb0e92 100644 --- a/src/plugins/platforms/xcb/qxcbcursor.cpp +++ b/src/plugins/platforms/xcb/qxcbcursor.cpp @@ -482,7 +482,7 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape) 0xFFFF, 0xFFFF, 0xFFFF, 0, 0, 0); } - if (cursor && cshape >= 0 && cshape < Qt::LastCursor) { + if (cursor && cshape >= 0 && cshape < Qt::LastCursor && connection()->hasXFixes()) { const char *name = cursorNames[cshape]; xcb_xfixes_set_cursor_name(conn, cursor, strlen(name), name); } -- cgit v1.2.3 From d76b0d9c6f55982192be17a8164a0cfed45d063d Mon Sep 17 00:00:00 2001 From: Jan Arve Saether Date: Thu, 14 Mar 2013 12:26:06 +0100 Subject: Don't call updateAccessibility from graphicsview Graphics items are not accessible anyway, so it doesn't make much sense. Task-number: QTBUG-30169 Change-Id: Id10b0897bce88d9b91db84609a09495aac41b0b4 Reviewed-by: Frederik Gladhorn --- src/widgets/graphicsview/qgraphicsitem.cpp | 9 --------- src/widgets/graphicsview/qgraphicsscene.cpp | 11 ----------- 2 files changed, 20 deletions(-) (limited to 'src') diff --git a/src/widgets/graphicsview/qgraphicsitem.cpp b/src/widgets/graphicsview/qgraphicsitem.cpp index 5c9651f1c9..fd13ee83cd 100644 --- a/src/widgets/graphicsview/qgraphicsitem.cpp +++ b/src/widgets/graphicsview/qgraphicsitem.cpp @@ -745,9 +745,6 @@ #include #include #include -#ifndef QT_NO_ACCESSIBILITY -# include "qaccessible.h" -#endif #include #include @@ -7322,12 +7319,6 @@ void QGraphicsItem::updateMicroFocus() if (scene()->views().at(i) == fw) { if (qApp) qApp->inputMethod()->update(Qt::ImQueryAll); - -#ifndef QT_NO_ACCESSIBILITY - // ##### is this correct - if (toGraphicsObject()) - QAccessible::updateAccessibility(toGraphicsObject(), 0, QAccessible::StateChanged); -#endif break; } } diff --git a/src/widgets/graphicsview/qgraphicsscene.cpp b/src/widgets/graphicsview/qgraphicsscene.cpp index a9c045ea80..cea376fea8 100644 --- a/src/widgets/graphicsview/qgraphicsscene.cpp +++ b/src/widgets/graphicsview/qgraphicsscene.cpp @@ -245,9 +245,6 @@ #include #include #include -#ifndef QT_NO_ACCESSIBILITY -# include -#endif #include #include #include @@ -836,14 +833,6 @@ void QGraphicsScenePrivate::setFocusItemHelper(QGraphicsItem *item, focusItem = item; updateInputMethodSensitivityInViews(); -#ifndef QT_NO_ACCESSIBILITY - if (focusItem) { - if (QGraphicsObject *focusObj = focusItem->toGraphicsObject()) { - QAccessibleEvent event(focusObj, QAccessible::Focus); - QAccessible::updateAccessibility(&event); - } - } -#endif if (item) { QFocusEvent event(QEvent::FocusIn, focusReason); sendEvent(item, &event); -- cgit v1.2.3 From f523883c2f6974d9ac261aa40e349c42aefa45f3 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Thu, 14 Mar 2013 15:35:59 +0100 Subject: Make QVariant docs refer to QMetaType::Type. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-30014 Change-Id: Ie4c0df92345bcb79ef44fb6f345cba9fc934d32f Reviewed-by: Jędrzej Nowacki --- src/corelib/kernel/qvariant.cpp | 280 +++++++++++++++++++++++----------------- 1 file changed, 165 insertions(+), 115 deletions(-) (limited to 'src') diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index d70d8d9a68..ad7ce708ad 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -1938,9 +1938,10 @@ inline T qVariantToHelper(const QVariant::Private &d, const HandlersManager &han /*! \fn QStringList QVariant::toStringList() const - Returns the variant as a QStringList if the variant has type() - StringList, \l String, or \l List of a type that can be converted - to QString; otherwise returns an empty list. + Returns the variant as a QStringList if the variant has userType() + \l QMetaType::QStringList, \l QMetaType::QString, or + \l QMetaType::QVariantList of a type that can be converted to QString; + otherwise returns an empty list. \sa canConvert(), convert() */ @@ -1950,10 +1951,12 @@ QStringList QVariant::toStringList() const } /*! - Returns the variant as a QString if the variant has type() \l - String, \l Bool, \l ByteArray, \l Char, \l Date, \l DateTime, \l - Double, \l Int, \l LongLong, \l StringList, \l Time, \l UInt, or - \l ULongLong; otherwise returns an empty string. + Returns the variant as a QString if the variant has userType() \l + QMetaType::QString, \l QMetaType::Bool, \l QMetaType::QByteArray, + \l QMetaType::QChar, \l QMetaType::QDate, \l QMetaType::QDateTime, + \l QMetaType::Double, \l QMetaType::Int, \l QMetaType::LongLong, + \l QMetaType::QStringList, \l QMetaType::QTime, \l QMetaType::UInt, or + \l QMetaType::ULongLong; otherwise returns an empty string. \sa canConvert(), convert() */ @@ -1964,7 +1967,7 @@ QString QVariant::toString() const /*! Returns the variant as a QMap if the variant - has type() \l Map; otherwise returns an empty map. + has type() \l QMetaType::QVariantMap; otherwise returns an empty map. \sa canConvert(), convert() */ @@ -1975,7 +1978,7 @@ QVariantMap QVariant::toMap() const /*! Returns the variant as a QHash if the variant - has type() \l Hash; otherwise returns an empty map. + has type() \l QMetaType::QVariantHash; otherwise returns an empty map. \sa canConvert(), convert() */ @@ -1987,11 +1990,12 @@ QVariantHash QVariant::toHash() const /*! \fn QDate QVariant::toDate() const - Returns the variant as a QDate if the variant has type() \l Date, - \l DateTime, or \l String; otherwise returns an invalid date. + Returns the variant as a QDate if the variant has userType() + \l QMetaType::QDate, \l QMetaType::QDateTime, or \l QMetaType::QString; + otherwise returns an invalid date. - If the type() is \l String, an invalid date will be returned if the - string cannot be parsed as a Qt::ISODate format date. + If the type() is \l QMetaType::QString, an invalid date will be returned if + the string cannot be parsed as a Qt::ISODate format date. \sa canConvert(), convert() */ @@ -2003,10 +2007,11 @@ QDate QVariant::toDate() const /*! \fn QTime QVariant::toTime() const - Returns the variant as a QTime if the variant has type() \l Time, - \l DateTime, or \l String; otherwise returns an invalid time. + Returns the variant as a QTime if the variant has userType() + \l QMetaType::QTime, \l QMetaType::QDateTime, or \l QMetaType::QString; + otherwise returns an invalid time. - If the type() is \l String, an invalid time will be returned if + If the type() is \l QMetaType::QString, an invalid time will be returned if the string cannot be parsed as a Qt::ISODate format time. \sa canConvert(), convert() @@ -2019,12 +2024,12 @@ QTime QVariant::toTime() const /*! \fn QDateTime QVariant::toDateTime() const - Returns the variant as a QDateTime if the variant has type() \l - DateTime, \l Date, or \l String; otherwise returns an invalid - date/time. + Returns the variant as a QDateTime if the variant has userType() + \l QMetaType::QDateTime, \l QMetaType::QDate, or \l QMetaType::QString; + otherwise returns an invalid date/time. - If the type() is \l String, an invalid date/time will be returned - if the string cannot be parsed as a Qt::ISODate format date/time. + If the type() is \l QMetaType::QString, an invalid date/time will be + returned if the string cannot be parsed as a Qt::ISODate format date/time. \sa canConvert(), convert() */ @@ -2037,8 +2042,8 @@ QDateTime QVariant::toDateTime() const \since 4.7 \fn QEasingCurve QVariant::toEasingCurve() const - Returns the variant as a QEasingCurve if the variant has type() \l - EasingCurve; otherwise returns a default easing curve. + Returns the variant as a QEasingCurve if the variant has userType() + \l QMetaType::QEasingCurve; otherwise returns a default easing curve. \sa canConvert(), convert() */ @@ -2052,9 +2057,9 @@ QEasingCurve QVariant::toEasingCurve() const /*! \fn QByteArray QVariant::toByteArray() const - Returns the variant as a QByteArray if the variant has type() \l - ByteArray or \l String (converted using QString::fromUtf8()); - otherwise returns an empty byte array. + Returns the variant as a QByteArray if the variant has userType() + \l QMetaType::QByteArray or \l QMetaType::QString (converted using + QString::fromUtf8()); otherwise returns an empty byte array. \sa canConvert(), convert() */ @@ -2067,8 +2072,9 @@ QByteArray QVariant::toByteArray() const /*! \fn QPoint QVariant::toPoint() const - Returns the variant as a QPoint if the variant has type() - \l Point or \l PointF; otherwise returns a null QPoint. + Returns the variant as a QPoint if the variant has userType() + \l QMetaType::QPointF or \l QMetaType::QPointF; otherwise returns a null + QPoint. \sa canConvert(), convert() */ @@ -2080,8 +2086,8 @@ QPoint QVariant::toPoint() const /*! \fn QRect QVariant::toRect() const - Returns the variant as a QRect if the variant has type() \l Rect; - otherwise returns an invalid QRect. + Returns the variant as a QRect if the variant has userType() + \l QMetaType::QRect; otherwise returns an invalid QRect. \sa canConvert(), convert() */ @@ -2093,8 +2099,8 @@ QRect QVariant::toRect() const /*! \fn QSize QVariant::toSize() const - Returns the variant as a QSize if the variant has type() \l Size; - otherwise returns an invalid QSize. + Returns the variant as a QSize if the variant has userType() + \l QMetaType::QSize; otherwise returns an invalid QSize. \sa canConvert(), convert() */ @@ -2106,8 +2112,8 @@ QSize QVariant::toSize() const /*! \fn QSizeF QVariant::toSizeF() const - Returns the variant as a QSizeF if the variant has type() \l - SizeF; otherwise returns an invalid QSizeF. + Returns the variant as a QSizeF if the variant has userType() \l + QMetaType::QSizeF; otherwise returns an invalid QSizeF. \sa canConvert(), convert() */ @@ -2119,8 +2125,9 @@ QSizeF QVariant::toSizeF() const /*! \fn QRectF QVariant::toRectF() const - Returns the variant as a QRectF if the variant has type() \l Rect - or \l RectF; otherwise returns an invalid QRectF. + Returns the variant as a QRectF if the variant has userType() + \l QMetaType::QRect or \l QMetaType::QRectF; otherwise returns an invalid + QRectF. \sa canConvert(), convert() */ @@ -2132,8 +2139,8 @@ QRectF QVariant::toRectF() const /*! \fn QLineF QVariant::toLineF() const - Returns the variant as a QLineF if the variant has type() \l - LineF; otherwise returns an invalid QLineF. + Returns the variant as a QLineF if the variant has userType() + \l QMetaType::QLineF; otherwise returns an invalid QLineF. \sa canConvert(), convert() */ @@ -2145,8 +2152,8 @@ QLineF QVariant::toLineF() const /*! \fn QLine QVariant::toLine() const - Returns the variant as a QLine if the variant has type() \l Line; - otherwise returns an invalid QLine. + Returns the variant as a QLine if the variant has userType() + \l QMetaType::QLine; otherwise returns an invalid QLine. \sa canConvert(), convert() */ @@ -2158,8 +2165,9 @@ QLine QVariant::toLine() const /*! \fn QPointF QVariant::toPointF() const - Returns the variant as a QPointF if the variant has type() \l - Point or \l PointF; otherwise returns a null QPointF. + Returns the variant as a QPointF if the variant has userType() \l + QMetaType::QPoint or \l QMetaType::QPointF; otherwise returns a null + QPointF. \sa canConvert(), convert() */ @@ -2174,8 +2182,8 @@ QPointF QVariant::toPointF() const /*! \fn QUrl QVariant::toUrl() const - Returns the variant as a QUrl if the variant has type() - \l Url; otherwise returns an invalid QUrl. + Returns the variant as a QUrl if the variant has userType() + \l QMetaType::QUrl; otherwise returns an invalid QUrl. \sa canConvert(), convert() */ @@ -2188,8 +2196,8 @@ QUrl QVariant::toUrl() const /*! \fn QLocale QVariant::toLocale() const - Returns the variant as a QLocale if the variant has type() - \l Locale; otherwise returns an invalid QLocale. + Returns the variant as a QLocale if the variant has userType() + \l QMetaType::QLocale; otherwise returns an invalid QLocale. \sa canConvert(), convert() */ @@ -2202,8 +2210,8 @@ QLocale QVariant::toLocale() const \fn QRegExp QVariant::toRegExp() const \since 4.1 - Returns the variant as a QRegExp if the variant has type() \l - RegExp; otherwise returns an empty QRegExp. + Returns the variant as a QRegExp if the variant has userType() + \l QMetaType::QRegExp; otherwise returns an empty QRegExp. \sa canConvert(), convert() */ @@ -2218,7 +2226,7 @@ QRegExp QVariant::toRegExp() const \fn QRegularExpression QVariant::toRegularExpression() const \since 5.0 - Returns the variant as a QRegularExpression if the variant has type() \l + Returns the variant as a QRegularExpression if the variant has userType() \l QRegularExpression; otherwise returns an empty QRegularExpression. \sa canConvert(), convert() @@ -2234,7 +2242,7 @@ QRegularExpression QVariant::toRegularExpression() const /*! \since 5.0 - Returns the variant as a QUuid if the variant has type() \l + Returns the variant as a QUuid if the variant has userType() \l QUuid; otherwise returns a default constructed QUuid. \sa canConvert(), convert() @@ -2247,7 +2255,7 @@ QUuid QVariant::toUuid() const /*! \since 5.0 - Returns the variant as a QModelIndex if the variant has type() \l + Returns the variant as a QModelIndex if the variant has userType() \l QModelIndex; otherwise returns a default constructed QModelIndex. \sa canConvert(), convert() @@ -2260,7 +2268,7 @@ QModelIndex QVariant::toModelIndex() const /*! \since 5.0 - Returns the variant as a QJsonValue if the variant has type() \l + Returns the variant as a QJsonValue if the variant has userType() \l QJsonValue; otherwise returns a default constructed QJsonValue. \sa canConvert(), convert() @@ -2273,7 +2281,7 @@ QJsonValue QVariant::toJsonValue() const /*! \since 5.0 - Returns the variant as a QJsonObject if the variant has type() \l + Returns the variant as a QJsonObject if the variant has userType() \l QJsonObject; otherwise returns a default constructed QJsonObject. \sa canConvert(), convert() @@ -2286,7 +2294,7 @@ QJsonObject QVariant::toJsonObject() const /*! \since 5.0 - Returns the variant as a QJsonArray if the variant has type() \l + Returns the variant as a QJsonArray if the variant has userType() \l QJsonArray; otherwise returns a default constructed QJsonArray. \sa canConvert(), convert() @@ -2299,7 +2307,7 @@ QJsonArray QVariant::toJsonArray() const /*! \since 5.0 - Returns the variant as a QJsonDocument if the variant has type() \l + Returns the variant as a QJsonDocument if the variant has userType() \l QJsonDocument; otherwise returns a default constructed QJsonDocument. \sa canConvert(), convert() @@ -2313,8 +2321,9 @@ QJsonDocument QVariant::toJsonDocument() const /*! \fn QChar QVariant::toChar() const - Returns the variant as a QChar if the variant has type() \l Char, - \l Int, or \l UInt; otherwise returns an invalid QChar. + Returns the variant as a QChar if the variant has userType() + \l QMetaType::QChar, \l QMetaType::Int, or \l QMetaType::UInt; otherwise + returns an invalid QChar. \sa canConvert(), convert() */ @@ -2324,8 +2333,8 @@ QChar QVariant::toChar() const } /*! - Returns the variant as a QBitArray if the variant has type() - \l BitArray; otherwise returns an empty bit array. + Returns the variant as a QBitArray if the variant has userType() + \l QMetaType::QBitArray; otherwise returns an empty bit array. \sa canConvert(), convert() */ @@ -2351,16 +2360,19 @@ inline T qNumVariantToHelper(const QVariant::Private &d, } /*! - Returns the variant as an int if the variant has type() \l Int, - \l Bool, \l ByteArray, \l Char, \l Double, \l LongLong, \l - String, \l UInt, or \l ULongLong; otherwise returns 0. + Returns the variant as an int if the variant has userType() + \l QMetaType::Int, \l QMetaType::Bool, \l QMetaType::QByteArray, + \l QMetaType::QChar, \l QMetaType::Double, \l QMetaType::LongLong, + \l QMetaType::QString, \l QMetaType::UInt, or \l QMetaType::ULongLong; + otherwise returns 0. If \a ok is non-null: \c{*}\a{ok} is set to true if the value could be converted to an int; otherwise \c{*}\a{ok} is set to false. - \b{Warning:} If the value is convertible to a \l LongLong but is too - large to be represented in an int, the resulting arithmetic overflow will - not be reflected in \a ok. A simple workaround is to use QString::toInt(). + \b{Warning:} If the value is convertible to a \l QMetaType::LongLong but is + too large to be represented in an int, the resulting arithmetic overflow + will not be reflected in \a ok. A simple workaround is to use + QString::toInt(). \sa canConvert(), convert() */ @@ -2370,16 +2382,19 @@ int QVariant::toInt(bool *ok) const } /*! - Returns the variant as an unsigned int if the variant has type() - \l UInt, \l Bool, \l ByteArray, \l Char, \l Double, \l Int, \l - LongLong, \l String, or \l ULongLong; otherwise returns 0. + Returns the variant as an unsigned int if the variant has userType() + \l QMetaType::UInt, \l QMetaType::Bool, \l QMetaType::QByteArray, + \l QMetaType::QChar, \l QMetaType::Double, \l QMetaType::Int, + \l QMetaType::LongLong, \l QMetaType::QString, or \l QMetaType::ULongLong; + otherwise returns 0. If \a ok is non-null: \c{*}\a{ok} is set to true if the value could be converted to an unsigned int; otherwise \c{*}\a{ok} is set to false. - \b{Warning:} If the value is convertible to a \l ULongLong but is too - large to be represented in an unsigned int, the resulting arithmetic overflow will - not be reflected in \a ok. A simple workaround is to use QString::toUInt(). + \b{Warning:} If the value is convertible to a \l QMetaType::ULongLong but is + too large to be represented in an unsigned int, the resulting arithmetic + overflow will not be reflected in \a ok. A simple workaround is to use + QString::toUInt(). \sa canConvert(), convert() */ @@ -2389,9 +2404,11 @@ uint QVariant::toUInt(bool *ok) const } /*! - Returns the variant as a long long int if the variant has type() - \l LongLong, \l Bool, \l ByteArray, \l Char, \l Double, \l Int, - \l String, \l UInt, or \l ULongLong; otherwise returns 0. + Returns the variant as a long long int if the variant has userType() + \l QMetaType::LongLong, \l QMetaType::Bool, \l QMetaType::QByteArray, + \l QMetaType::QChar, \l QMetaType::Double, \l QMetaType::Int, + \l QMetaType::QString, \l QMetaType::UInt, or \l QMetaType::ULongLong; + otherwise returns 0. If \a ok is non-null: \c{*}\c{ok} is set to true if the value could be converted to an int; otherwise \c{*}\c{ok} is set to false. @@ -2405,9 +2422,10 @@ qlonglong QVariant::toLongLong(bool *ok) const /*! Returns the variant as as an unsigned long long int if the - variant has type() \l ULongLong, \l Bool, \l ByteArray, \l Char, - \l Double, \l Int, \l LongLong, \l String, or \l UInt; otherwise - returns 0. + variant has type() \l QMetaType::ULongLong, \l QMetaType::Bool, + \l QMetaType::QByteArray, \l QMetaType::QChar, \l QMetaType::Double, + \l QMetaType::Int, \l QMetaType::LongLong, \l QMetaType::QString, or + \l QMetaType::UInt; otherwise returns 0. If \a ok is non-null: \c{*}\a{ok} is set to true if the value could be converted to an int; otherwise \c{*}\a{ok} is set to false. @@ -2420,13 +2438,14 @@ qulonglong QVariant::toULongLong(bool *ok) const } /*! - Returns the variant as a bool if the variant has type() Bool. + Returns the variant as a bool if the variant has userType() Bool. - Returns true if the variant has type() \l Bool, \l Char, \l Double, - \l Int, \l LongLong, \l UInt, or \l ULongLong and the value is - non-zero, or if the variant has type \l String or \l ByteArray and - its lower-case content is not one of the following: empty, "0" - or "false"; otherwise returns false. + Returns true if the variant has userType() \l QMetaType::Bool, + \l QMetaType::QChar, \l QMetaType::Double, \l QMetaType::Int, + \l QMetaType::LongLong, \l QMetaType::UInt, or \l QMetaType::ULongLong and + the value is non-zero, or if the variant has type \l QMetaType::QString or + \l QMetaType::QByteArray and its lower-case content is not one of the + following: empty, "0" or "false"; otherwise returns false. \sa canConvert(), convert() */ @@ -2442,9 +2461,11 @@ bool QVariant::toBool() const } /*! - Returns the variant as a double if the variant has type() \l - Double, \l QMetaType::Float, \l Bool, \l ByteArray, \l Int, \l LongLong, \l String, \l - UInt, or \l ULongLong; otherwise returns 0.0. + Returns the variant as a double if the variant has userType() + \l QMetaType::Double, \l QMetaType::Float, \l QMetaType::Bool, + \l QMetaType::QByteArray, \l QMetaType::Int, \l QMetaType::LongLong, + \l QMetaType::QString, \l QMetaType::UInt, or \l QMetaType::ULongLong; + otherwise returns 0.0. If \a ok is non-null: \c{*}\a{ok} is set to true if the value could be converted to a double; otherwise \c{*}\a{ok} is set to false. @@ -2457,9 +2478,11 @@ double QVariant::toDouble(bool *ok) const } /*! - Returns the variant as a float if the variant has type() \l - Double, \l QMetaType::Float, \l Bool, \l ByteArray, \l Int, \l LongLong, \l String, \l - UInt, or \l ULongLong; otherwise returns 0.0. + Returns the variant as a float if the variant has userType() + \l QMetaType::Double, \l QMetaType::Float, \l QMetaType::Bool, + \l QMetaType::QByteArray, \l QMetaType::Int, \l QMetaType::LongLong, + \l QMetaType::QString, \l QMetaType::UInt, or \l QMetaType::ULongLong; + otherwise returns 0.0. \since 4.6 @@ -2474,9 +2497,11 @@ float QVariant::toFloat(bool *ok) const } /*! - Returns the variant as a qreal if the variant has type() \l - Double, \l QMetaType::Float, \l Bool, \l ByteArray, \l Int, \l LongLong, \l String, \l - UInt, or \l ULongLong; otherwise returns 0.0. + Returns the variant as a qreal if the variant has userType() + \l QMetaType::Double, \l QMetaType::Float, \l QMetaType::Bool, + \l QMetaType::QByteArray, \l QMetaType::Int, \l QMetaType::LongLong, + \l QMetaType::QString, \l QMetaType::UInt, or \l QMetaType::ULongLong; + otherwise returns 0.0. \since 4.6 @@ -2491,8 +2516,9 @@ qreal QVariant::toReal(bool *ok) const } /*! - Returns the variant as a QVariantList if the variant has type() - \l List or \l StringList; otherwise returns an empty list. + Returns the variant as a QVariantList if the variant has userType() + \l QMetaType::QVariantList or \l QMetaType::QStringList; otherwise returns + an empty list. \sa canConvert(), convert() */ @@ -2631,27 +2657,51 @@ static bool canConvertMetaObject(int fromId, int toId, QObject *fromObject) \table \header \li Type \li Automatically Cast To - \row \li \l Bool \li \l Char, \l Double, \l Int, \l LongLong, \l String, \l UInt, \l ULongLong - \row \li \l ByteArray \li \l Double, \l Int, \l LongLong, \l String, \l UInt, \l ULongLong - \row \li \l Char \li \l Bool, \l Int, \l UInt, \l LongLong, \l ULongLong - \row \li \l Color \li \l String - \row \li \l Date \li \l DateTime, \l String - \row \li \l DateTime \li \l Date, \l String, \l Time - \row \li \l Double \li \l Bool, \l Int, \l LongLong, \l String, \l UInt, \l ULongLong - \row \li \l Font \li \l String - \row \li \l Int \li \l Bool, \l Char, \l Double, \l LongLong, \l String, \l UInt, \l ULongLong - \row \li \l KeySequence \li \l Int, \l String - \row \li \l List \li \l StringList (if the list's items can be converted to strings) - \row \li \l LongLong \li \l Bool, \l ByteArray, \l Char, \l Double, \l Int, \l String, \l UInt, \l ULongLong - \row \li \l Point \li PointF - \row \li \l Rect \li RectF - \row \li \l String \li \l Bool, \l ByteArray, \l Char, \l Color, \l Date, \l DateTime, \l Double, - \l Font, \l Int, \l KeySequence, \l LongLong, \l StringList, \l Time, \l UInt, - \l ULongLong - \row \li \l StringList \li \l List, \l String (if the list contains exactly one item) - \row \li \l Time \li \l String - \row \li \l UInt \li \l Bool, \l Char, \l Double, \l Int, \l LongLong, \l String, \l ULongLong - \row \li \l ULongLong \li \l Bool, \l Char, \l Double, \l Int, \l LongLong, \l String, \l UInt + \row \li \l QMetaType::Bool \li \l QMetaType::QChar, \l QMetaType::Double, + \l QMetaType::Int, \l QMetaType::LongLong, \l QMetaType::QString, + \l QMetaType::UInt, \l QMetaType::ULongLong + \row \li \l QMetaType::QByteArray \li \l QMetaType::Double, + \l QMetaType::Int, \l QMetaType::LongLong, \l QMetaType::QString, + \l QMetaType::UInt, \l QMetaType::ULongLong + \row \li \l QMetaType::QChar \li \l QMetaType::Bool, \l QMetaType::Int, + \l QMetaType::UInt, \l QMetaType::LongLong, \l QMetaType::ULongLong + \row \li \l QMetaType::QColor \li \l QMetaType::QString + \row \li \l QMetaType::QDate \li \l QMetaType::QDateTime, + \l QMetaType::QString + \row \li \l QMetaType::QDateTime \li \l QMetaType::QDate, + \l QMetaType::QString, \l QMetaType::QTime + \row \li \l QMetaType::Double \li \l QMetaType::Bool, \l QMetaType::Int, + \l QMetaType::LongLong, \l QMetaType::QString, \l QMetaType::UInt, + \l QMetaType::ULongLong + \row \li \l QMetaType::QFont \li \l QMetaType::QString + \row \li \l QMetaType::Int \li \l QMetaType::Bool, \l QMetaType::QChar, + \l QMetaType::Double, \l QMetaType::LongLong, \l QMetaType::QString, + \l QMetaType::UInt, \l QMetaType::ULongLong + \row \li \l QMetaType::QKeySequence \li \l QMetaType::Int, + \l QMetaType::QString + \row \li \l QMetaType::QVariantList \li \l QMetaType::QStringList (if the + list's items can be converted to QStrings) + \row \li \l QMetaType::LongLong \li \l QMetaType::Bool, + \l QMetaType::QByteArray, \l QMetaType::QChar, \l QMetaType::Double, + \l QMetaType::Int, \l QMetaType::QString, \l QMetaType::UInt, + \l QMetaType::ULongLong + \row \li \l QMetaType::QPoint \li QMetaType::QPointF + \row \li \l QMetaType::QRect \li QMetaType::QRectF + \row \li \l QMetaType::QString \li \l QMetaType::Bool, + \l QMetaType::QByteArray, \l QMetaType::QChar, \l QMetaType::QColor, + \l QMetaType::QDate, \l QMetaType::QDateTime, \l QMetaType::Double, + \l QMetaType::QFont, \l QMetaType::Int, \l QMetaType::QKeySequence, + \l QMetaType::LongLong, \l QMetaType::QStringList, \l QMetaType::QTime, + \l QMetaType::UInt, \l QMetaType::ULongLong + \row \li \l QMetaType::QStringList \li \l QMetaType::QVariantList, + \l QMetaType::QString (if the list contains exactly one item) + \row \li \l QMetaType::QTime \li \l QMetaType::QString + \row \li \l QMetaType::UInt \li \l QMetaType::Bool, \l QMetaType::QChar, + \l QMetaType::Double, \l QMetaType::Int, \l QMetaType::LongLong, + \l QMetaType::QString, \l QMetaType::ULongLong + \row \li \l QMetaType::ULongLong \li \l QMetaType::Bool, + \l QMetaType::QChar, \l QMetaType::Double, \l QMetaType::Int, + \l QMetaType::LongLong, \l QMetaType::QString, \l QMetaType::UInt \endtable A QVariant containing a pointer to a type derived from QObject will also return true for this -- cgit v1.2.3 From 426f2ccafc8fc8336193dbdd67a949e790d7fa7e Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 19 Mar 2013 09:52:31 +0100 Subject: Windows native file dialogs: Split suffix list correctly. Task-number: QTBUG-30185 Change-Id: I9a3d16eafb5417d6720a702af662fb219487549d Reviewed-by: Joerg Bornemann --- src/plugins/platforms/windows/qwindowsdialoghelpers.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp index 74193c47a3..daa4369d88 100644 --- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp +++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp @@ -1071,7 +1071,9 @@ static inline QString appendSuffix(const QString &fileName, const QString &filte if (suffixPos < 0) return fileName; suffixPos += 3; - int endPos = filter.indexOf(QLatin1Char(';'), suffixPos + 1); + int endPos = filter.indexOf(QLatin1Char(' '), suffixPos + 1); + if (endPos < 0) + endPos = filter.indexOf(QLatin1Char(';'), suffixPos + 1); if (endPos < 0) endPos = filter.indexOf(QLatin1Char(')'), suffixPos + 1); if (endPos < 0) -- cgit v1.2.3 From 613cef516c5e3b87a88ceb2c364787409a25dfb7 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Tue, 5 Mar 2013 16:52:08 +0100 Subject: qtbase: Fix duplicate symbol errors in static build on Mac MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is some code duplication between QMacStyle anf the Cocoa QPA plugin regarding painting and bridging with Cocoa. Task-number: QTBUG-29725 Change-Id: I347407a9bca47b6fccd77fb924688bd35135d96b Reviewed-by: Friedemann Kleint Reviewed-by: Oswald Buddenhagen Reviewed-by: Morten Johan Sørvig (cherry picked from commit 5f948eb62ddb9f429f46ade08f32072212cda493) Reviewed-by: Gabriel de Dietrich Reviewed-by: Andy Shaw --- src/plugins/platforms/cocoa/qcocoahelpers.mm | 7 ++-- src/plugins/platforms/cocoa/qpaintengine_mac.mm | 2 +- src/widgets/styles/qmacstyle_mac.mm | 54 ++++++++++++++----------- 3 files changed, 34 insertions(+), 29 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.mm b/src/plugins/platforms/cocoa/qcocoahelpers.mm index 91a6f5a4c7..20702c6837 100644 --- a/src/plugins/platforms/cocoa/qcocoahelpers.mm +++ b/src/plugins/platforms/cocoa/qcocoahelpers.mm @@ -466,10 +466,9 @@ QString qt_mac_removeMnemonics(const QString &original) return returnText; } - -CGColorSpaceRef m_genericColorSpace = 0; -QHash m_displayColorSpaceHash; -bool m_postRoutineRegistered = false; +static CGColorSpaceRef m_genericColorSpace = 0; +static QHash m_displayColorSpaceHash; +static bool m_postRoutineRegistered = false; CGColorSpaceRef qt_mac_genericColorSpace() { diff --git a/src/plugins/platforms/cocoa/qpaintengine_mac.mm b/src/plugins/platforms/cocoa/qpaintengine_mac.mm index 0b6392fb65..101be611ad 100644 --- a/src/plugins/platforms/cocoa/qpaintengine_mac.mm +++ b/src/plugins/platforms/cocoa/qpaintengine_mac.mm @@ -76,7 +76,7 @@ QT_BEGIN_NAMESPACE QCoreGraphicsPaintEngine utility functions *****************************************************************************/ -void qt_mac_clip_cg(CGContextRef hd, const QRegion &rgn, CGAffineTransform *orig_xform) +static void qt_mac_clip_cg(CGContextRef hd, const QRegion &rgn, CGAffineTransform *orig_xform) { CGAffineTransform old_xform = CGAffineTransformIdentity; if (orig_xform) { //setup xforms diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index 5d83804d51..dab8e3fe74 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -458,6 +458,9 @@ static QString qt_mac_removeMnemonics(const QString &original) return returnText; } +static CGContextRef qt_mac_cg_context(const QPaintDevice *pdev); + +namespace { class QMacCGContext { CGContextRef context; @@ -465,7 +468,6 @@ public: QMacCGContext(QPainter *p); inline QMacCGContext() { context = 0; } inline QMacCGContext(const QPaintDevice *pdev) { - extern CGContextRef qt_mac_cg_context(const QPaintDevice *); context = qt_mac_cg_context(pdev); } inline QMacCGContext(CGContextRef cg, bool takeOwnership=false) { @@ -495,6 +497,7 @@ public: return *this; } }; +} // anonymous namespace static QColor qcolorFromCGColor(CGColorRef cgcolor) { @@ -578,11 +581,11 @@ QRegion qt_mac_fromHIShapeRef(HIShapeRef shape) } CGColorSpaceRef m_genericColorSpace = 0; -QHash m_displayColorSpaceHash; +static QHash m_displayColorSpaceHash; bool m_postRoutineRegistered = false; -CGColorSpaceRef qt_mac_displayColorSpace(const QWidget *widget); -CGColorSpaceRef qt_mac_genericColorSpace() +static CGColorSpaceRef qt_mac_displayColorSpace(const QWidget *widget); +static CGColorSpaceRef qt_mac_genericColorSpace() { #if 0 if (!m_genericColorSpace) { @@ -606,11 +609,26 @@ CGColorSpaceRef qt_mac_genericColorSpace() #endif } +static void qt_mac_cleanUpMacColorSpaces() +{ + if (m_genericColorSpace) { + CFRelease(m_genericColorSpace); + m_genericColorSpace = 0; + } + QHash::const_iterator it = m_displayColorSpaceHash.constBegin(); + while (it != m_displayColorSpaceHash.constEnd()) { + if (it.value()) + CFRelease(it.value()); + ++it; + } + m_displayColorSpaceHash.clear(); +} + /* Ideally, we should pass the widget in here, and use CGGetDisplaysWithRect() etc. to support multiple displays correctly. */ -CGColorSpaceRef qt_mac_displayColorSpace(const QWidget *widget) +static CGColorSpaceRef qt_mac_displayColorSpace(const QWidget *widget) { CGColorSpaceRef colorSpace; @@ -639,27 +657,11 @@ CGColorSpaceRef qt_mac_displayColorSpace(const QWidget *widget) m_displayColorSpaceHash.insert(displayID, colorSpace); if (!m_postRoutineRegistered) { m_postRoutineRegistered = true; - void qt_mac_cleanUpMacColorSpaces(); qAddPostRoutine(qt_mac_cleanUpMacColorSpaces); } return colorSpace; } -void qt_mac_cleanUpMacColorSpaces() -{ - if (m_genericColorSpace) { - CFRelease(m_genericColorSpace); - m_genericColorSpace = 0; - } - QHash::const_iterator it = m_displayColorSpaceHash.constBegin(); - while (it != m_displayColorSpaceHash.constEnd()) { - if (it.value()) - CFRelease(it.value()); - ++it; - } - m_displayColorSpaceHash.clear(); -} - bool qt_macWindowIsTextured(const QWidget *window) { NSWindow *nswindow = static_cast( @@ -6489,7 +6491,7 @@ int QMacStyle::layoutSpacing(QSizePolicy::ControlType control1, return_SIZE(10, 8, 6); // guess } -void qt_mac_clip_cg(CGContextRef hd, const QRegion &rgn, CGAffineTransform *orig_xform) +static void qt_mac_clip_cg(CGContextRef hd, const QRegion &rgn, CGAffineTransform *orig_xform) { CGAffineTransform old_xform = CGAffineTransformIdentity; if (orig_xform) { //setup xforms @@ -6530,6 +6532,9 @@ void qt_mac_scale_region(QRegion *region, qreal scaleFactor) region->setRects(&scaledRects[0], scaledRects.count()); } +static CGColorSpaceRef qt_mac_colorSpaceForDeviceType(const QPaintDevice *paintDevice); + +namespace { QMacCGContext::QMacCGContext(QPainter *p) { QPaintEngine *pe = p->paintEngine(); @@ -6542,7 +6547,6 @@ QMacCGContext::QMacCGContext(QPainter *p) devType == QInternal::Pixmap || devType == QInternal::Image)) { - extern CGColorSpaceRef qt_mac_colorSpaceForDeviceType(const QPaintDevice *paintDevice); CGColorSpaceRef colorspace = qt_mac_colorSpaceForDeviceType(pe->paintDevice()); uint flags = kCGImageAlphaPremultipliedFirst; flags |= kCGBitmapByteOrder32Host; @@ -6584,7 +6588,9 @@ QMacCGContext::QMacCGContext(QPainter *p) } } -CGColorSpaceRef qt_mac_colorSpaceForDeviceType(const QPaintDevice *paintDevice) +} // anonymous namespace + +static CGColorSpaceRef qt_mac_colorSpaceForDeviceType(const QPaintDevice *paintDevice) { bool isWidget = (paintDevice->devType() == QInternal::Widget); return qt_mac_displayColorSpace(isWidget ? static_cast(paintDevice) : 0); -- cgit v1.2.3 From e79e1c1a166b8841724b6cd33b27b37a5ef6f4a0 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 20 Mar 2013 16:51:32 +0100 Subject: pass module version to syncqt this is cleaner than having it parse qmake project files. the only remaining built-in version extraction is the fallback to qglobal.h needed for bootstrapping. as a "side effect", this fixes the build of modules with mismatched versions centralized in .qmake.conf, as this was simply not handled so far. the -mkspecsdir syncqt option goes away, as there is no use case for it any more. Task-number: QTBUG-29838 Change-Id: I6912a38f0e93a26bc267a9e3d738506fd3ad431b Reviewed-by: Thiago Macieira Reviewed-by: Jocelyn Turcotte Reviewed-by: Joerg Bornemann --- src/angle/angle.pro | 2 +- src/tools/bootstrap/bootstrap.pro | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/angle/angle.pro b/src/angle/angle.pro index 00e0501d60..b4dbf8cf21 100644 --- a/src/angle/angle.pro +++ b/src/angle/angle.pro @@ -13,7 +13,7 @@ SUBDIRS += src else: \ mod_component_base = $$dirname(_QMAKE_CACHE_) QMAKE_SYNCQT += -minimal -module KHR -module EGL -module GLES2 \ - -mkspecsdir $$[QT_HOST_DATA/get]/mkspecs -outdir $$mod_component_base $$dirname(_QMAKE_CONF_) + -version none -outdir $$mod_component_base $$dirname(_QMAKE_CONF_) !silent:message($$QMAKE_SYNCQT) system($$QMAKE_SYNCQT)|error("Failed to run: $$QMAKE_SYNCQT") } diff --git a/src/tools/bootstrap/bootstrap.pro b/src/tools/bootstrap/bootstrap.pro index 0d4b62fd16..1ec54deeb5 100644 --- a/src/tools/bootstrap/bootstrap.pro +++ b/src/tools/bootstrap/bootstrap.pro @@ -139,7 +139,7 @@ INSTALLS += lib else: \ mod_component_base = $$dirname(_QMAKE_CACHE_) QMAKE_SYNCQT += -minimal -module QtCore -module QtDBus -module QtXml \ - -mkspecsdir $$[QT_HOST_DATA/get]/mkspecs -outdir $$mod_component_base $$dirname(_QMAKE_CONF_) + -version $$VERSION -outdir $$mod_component_base $$dirname(_QMAKE_CONF_) contains(QT_CONFIG, zlib):QMAKE_SYNCQT += -module QtZlib !silent:message($$QMAKE_SYNCQT) system($$QMAKE_SYNCQT)|error("Failed to run: $$QMAKE_SYNCQT") -- cgit v1.2.3