diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-06-01 10:06:42 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-06-01 10:06:42 (GMT) |
commit | a842b7e0a937a934e8af7b1edad324db8425ba8f (patch) | |
tree | b65fe71996ca9bc320854d6dc405993810a55f0a /src | |
parent | 532861d77b661f332e5a16c031926da38a813ec5 (diff) | |
parent | 70ba57c4716749c99e302a4eda4695942d0b45fe (diff) | |
download | Qt-a842b7e0a937a934e8af7b1edad324db8425ba8f.zip Qt-a842b7e0a937a934e8af7b1edad324db8425ba8f.tar.gz Qt-a842b7e0a937a934e8af7b1edad324db8425ba8f.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1:
doc: Added DITA XML generator
Fix build failure on Symbian 3.1.
Add the Qt::TextBypassShaping flag.
QTextEngine: skip an unnecessary call to GetDeviceCaps on Windows.
Add my 4.7.0 changes
qdoc: Added DITA XML generator
doc: Fixed confusing ownership issue.
update Russian translations for Qt tools
update Russian translation for Qt libraries
QXmlSchema documentation correction
doc: Changed last breadcrumb to not be a link.
doc: Fixed reference to setSize(), which is in QRectF.
QNetworkCookie: do not accept cookies with non-alNum domain
QtDeclarative: Remove trailing commas in enums
Doc: MonotonicClock is obviously monotonic
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/global/qnamespace.h | 3 | ||||
-rw-r--r-- | src/corelib/tools/qelapsedtimer.cpp | 2 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarative.h | 2 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativeinstruction_p.h | 2 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativevaluetype_p.h | 2 | ||||
-rw-r--r-- | src/gui/painting/qpainter.cpp | 17 | ||||
-rw-r--r-- | src/gui/text/qfontmetrics.cpp | 25 | ||||
-rw-r--r-- | src/gui/text/qfontmetrics.h | 1 | ||||
-rw-r--r-- | src/gui/text/qtextengine.cpp | 8 | ||||
-rw-r--r-- | src/gui/text/qtextengine_p.h | 1 | ||||
-rw-r--r-- | src/gui/widgets/qstackedwidget.cpp | 8 | ||||
-rw-r--r-- | src/network/access/qnetworkcookie.cpp | 2 | ||||
-rw-r--r-- | src/plugins/bearer/symbian/symbianengine.cpp | 4 | ||||
-rw-r--r-- | src/svg/qgraphicssvgitem.cpp | 6 |
14 files changed, 69 insertions, 14 deletions
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 08674d2..52a24de 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -236,7 +236,8 @@ public: TextJustificationForced = 0x10000, TextForceLeftToRight = 0x20000, TextForceRightToLeft = 0x40000, - TextLongestVariant = 0x80000 + TextLongestVariant = 0x80000, + TextBypassShaping = 0x100000 #if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN) ,SingleLine = TextSingleLine, diff --git a/src/corelib/tools/qelapsedtimer.cpp b/src/corelib/tools/qelapsedtimer.cpp index 28dfc23..cb5e701 100644 --- a/src/corelib/tools/qelapsedtimer.cpp +++ b/src/corelib/tools/qelapsedtimer.cpp @@ -137,7 +137,7 @@ QT_BEGIN_NAMESPACE used. \value SystemTime The human-readable system time. This clock is not monotonic. - \value MonotonicClock The system's monotonic clock, usually found in Unix systems. This clock is not monotonic and does not overflow. + \value MonotonicClock The system's monotonic clock, usually found in Unix systems. This clock is monotonic and does not overflow. \value TickCounter The system's tick counter, used on Windows and Symbian systems. This clock may overflow. \value MachAbsoluteTime The Mach kernel's absolute time (Mac OS X). This clock is monotonic and does not overflow. diff --git a/src/declarative/qml/qdeclarative.h b/src/declarative/qml/qdeclarative.h index d75f0a8..53ff51c 100644 --- a/src/declarative/qml/qdeclarative.h +++ b/src/declarative/qml/qdeclarative.h @@ -67,7 +67,7 @@ QT_BEGIN_HEADER QML_DECLARE_TYPE_HASMETATYPE(INTERFACE) enum { /* TYPEINFO flags */ - QML_HAS_ATTACHED_PROPERTIES = 0x01, + QML_HAS_ATTACHED_PROPERTIES = 0x01 }; #define QML_DECLARE_TYPEINFO(TYPE, FLAGS) \ diff --git a/src/declarative/qml/qdeclarativeinstruction_p.h b/src/declarative/qml/qdeclarativeinstruction_p.h index dc5f2f8..4627eb3 100644 --- a/src/declarative/qml/qdeclarativeinstruction_p.h +++ b/src/declarative/qml/qdeclarativeinstruction_p.h @@ -158,7 +158,7 @@ public: // // Deferred creation // - Defer, /* defer */ + Defer /* defer */ }; QDeclarativeInstruction() : line(0) {} diff --git a/src/declarative/qml/qdeclarativevaluetype_p.h b/src/declarative/qml/qdeclarativevaluetype_p.h index 476c73d..3eaecc1 100644 --- a/src/declarative/qml/qdeclarativevaluetype_p.h +++ b/src/declarative/qml/qdeclarativevaluetype_p.h @@ -446,7 +446,7 @@ public: InBounce = QEasingCurve::InBounce, OutBounce = QEasingCurve::OutBounce, InOutBounce = QEasingCurve::InOutBounce, OutInBounce = QEasingCurve::OutInBounce, InCurve = QEasingCurve::InCurve, OutCurve = QEasingCurve::OutCurve, - SineCurve = QEasingCurve::SineCurve, CosineCurve = QEasingCurve::CosineCurve, + SineCurve = QEasingCurve::SineCurve, CosineCurve = QEasingCurve::CosineCurve }; QDeclarativeEasingValueType(QObject *parent = 0); diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 657229a..54e0aa3 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -5937,6 +5937,23 @@ void QPainter::drawText(const QPointF &p, const QString &str, int tf, int justif if (!d->engine || str.isEmpty() || pen().style() == Qt::NoPen) return; + if (tf & Qt::TextBypassShaping) { + // Skip harfbuzz complex shaping, shape using glyph advances only + int len = str.length(); + int numGlyphs = len; + QVarLengthGlyphLayoutArray glyphs(len); + QFontEngine *fontEngine = d->state->font.d->engineForScript(QUnicodeTables::Common); + if (!fontEngine->stringToCMap(str.data(), len, &glyphs, &numGlyphs, 0)) { + glyphs.resize(numGlyphs); + if (!fontEngine->stringToCMap(str.data(), len, &glyphs, &numGlyphs, 0)) + Q_ASSERT_X(false, Q_FUNC_INFO, "stringToCMap shouldn't fail twice"); + } + + QTextItemInt gf(glyphs, &d->state->font, fontEngine); + drawTextItem(p, gf); + return; + } + QStackTextEngine engine(str, d->state->font); engine.option.setTextDirection(d->state->layoutDirection); if (tf & (Qt::TextForceLeftToRight|Qt::TextForceRightToLeft)) { diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp index 5163c94..d02e841 100644 --- a/src/gui/text/qfontmetrics.cpp +++ b/src/gui/text/qfontmetrics.cpp @@ -526,6 +526,14 @@ int QFontMetrics::rightBearing(QChar ch) const */ int QFontMetrics::width(const QString &text, int len) const { + return width(text, len, 0); +} + +/*! + \internal +*/ +int QFontMetrics::width(const QString &text, int len, int flags) const +{ int pos = text.indexOf(QLatin1Char('\x9c')); if (pos != -1) { len = (len < 0) ? pos : qMin(pos, len); @@ -535,6 +543,23 @@ int QFontMetrics::width(const QString &text, int len) const if (len == 0) return 0; + if (flags & Qt::TextBypassShaping) { + // Skip harfbuzz complex shaping, only use advances + int numGlyphs = len; + QVarLengthGlyphLayoutArray glyphs(numGlyphs); + QFontEngine *engine = d->engineForScript(QUnicodeTables::Common); + if (!engine->stringToCMap(text.data(), len, &glyphs, &numGlyphs, 0)) { + glyphs.resize(numGlyphs); + if (!engine->stringToCMap(text.data(), len, &glyphs, &numGlyphs, 0)) + Q_ASSERT_X(false, Q_FUNC_INFO, "stringToCMap shouldn't fail twice"); + } + + QFixed width; + for (int i = 0; i < numGlyphs; ++i) + width += glyphs.advances_x[i]; + return qRound(width); + } + QStackTextEngine layout(text, d.data()); layout.ignoreBidi = true; return qRound(layout.width(0, len)); diff --git a/src/gui/text/qfontmetrics.h b/src/gui/text/qfontmetrics.h index dca4b93..2518b54 100644 --- a/src/gui/text/qfontmetrics.h +++ b/src/gui/text/qfontmetrics.h @@ -89,6 +89,7 @@ public: int leftBearing(QChar) const; int rightBearing(QChar) const; int width(const QString &, int len = -1) const; + int width(const QString &, int len, int flags) const; int width(QChar) const; int charWidth(const QString &str, int pos) const; diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index d34553f..3486264 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -885,7 +885,7 @@ void QTextEngine::shapeText(int item) const QFixed letterSpacing = font.d->letterSpacing; QFixed wordSpacing = font.d->wordSpacing; - if (letterSpacingIsAbsolute) + if (letterSpacingIsAbsolute && letterSpacing.value()) letterSpacing *= font.d->dpi / qt_defaultDpiY(); if (letterSpacing != 0) { @@ -2648,6 +2648,12 @@ QTextItemInt::QTextItemInt(const QScriptItem &si, QFont *font, const QTextCharFo flags |= QTextItem::StrikeOut; } +QTextItemInt::QTextItemInt(const QGlyphLayout &g, QFont *font, QFontEngine *fe) + : flags(0), justified(false), underlineStyle(QTextCharFormat::NoUnderline), + num_chars(0), chars(0), logClusters(0), f(font), fontEngine(fe), glyphs(g) +{ +} + QTextItemInt QTextItemInt::midItem(QFontEngine *fontEngine, int firstGlyphIndex, int numGlyphs) const { QTextItemInt ti = *this; diff --git a/src/gui/text/qtextengine_p.h b/src/gui/text/qtextengine_p.h index d92148f..00b1392 100644 --- a/src/gui/text/qtextengine_p.h +++ b/src/gui/text/qtextengine_p.h @@ -311,6 +311,7 @@ public: logClusters(0), f(0), fontEngine(0) {} QTextItemInt(const QScriptItem &si, QFont *font, const QTextCharFormat &format = QTextCharFormat()); + QTextItemInt(const QGlyphLayout &g, QFont *font, QFontEngine *fe); /// copy the structure items, adjusting the glyphs arrays to the right subarrays. /// the width of the returned QTextItemInt is not adjusted, for speed reasons diff --git a/src/gui/widgets/qstackedwidget.cpp b/src/gui/widgets/qstackedwidget.cpp index 2509a21..de8d3e6 100644 --- a/src/gui/widgets/qstackedwidget.cpp +++ b/src/gui/widgets/qstackedwidget.cpp @@ -186,11 +186,11 @@ int QStackedWidget::insertWidget(int index, QWidget *widget) } /*! - Removes the given \a widget from the QStackedWidget. + Removes \a widget from the QStackedWidget. i.e., \a widget is \e + not deleted but simply removed from the stacked layout, causing it + to be hidden. - \bold{Note:} The ownership of \a widget remains the same. - The widget is \e not deleted, but simply removed from the widget's - stacked layout, causing it to be hidden. + \bold{Note:} Ownership of \a widget reverts to the application. \sa addWidget(), insertWidget(), currentWidget() */ diff --git a/src/network/access/qnetworkcookie.cpp b/src/network/access/qnetworkcookie.cpp index 865d338..d1bdd57 100644 --- a/src/network/access/qnetworkcookie.cpp +++ b/src/network/access/qnetworkcookie.cpp @@ -991,6 +991,8 @@ QList<QNetworkCookie> QNetworkCookiePrivate::parseSetCookieHeaderLine(const QByt } QString normalizedDomain = QUrl::fromAce(QUrl::toAce(QString::fromUtf8(rawDomain))); + if (normalizedDomain.isEmpty() && !rawDomain.isEmpty()) + return result; cookie.setDomain(maybeLeadingDot + normalizedDomain); } else if (field.first == "max-age") { bool ok = false; diff --git a/src/plugins/bearer/symbian/symbianengine.cpp b/src/plugins/bearer/symbian/symbianengine.cpp index 8c26cf0..ab1ba28 100644 --- a/src/plugins/bearer/symbian/symbianengine.cpp +++ b/src/plugins/bearer/symbian/symbianengine.cpp @@ -389,9 +389,9 @@ void SymbianEngine::updateConfigurationsL() QNetworkConfigurationPrivatePointer ptr(cpPriv); accessPointConfigurations.insert(ident, ptr); - locker.unlock(); + mutex.unlock(); emit configurationAdded(ptr); - locker.relock(); + mutex.lock(); } else { delete cpPriv; } diff --git a/src/svg/qgraphicssvgitem.cpp b/src/svg/qgraphicssvgitem.cpp index 69ff7a3..e035e1d 100644 --- a/src/svg/qgraphicssvgitem.cpp +++ b/src/svg/qgraphicssvgitem.cpp @@ -124,8 +124,10 @@ public: \snippet doc/src/snippets/code/src_svg_qgraphicssvgitem.cpp 0 - Size of the item can be set via the setSize() method or via - direct manipulation of the items transformation matrix. + Size of the item can be set via the \l{QRectF::setSize()} + {setSize()} method of the \l{QGraphicsSvgItem::boundingRect()} + {bounding rectangle} or via direct manipulation of the items + transformation matrix. By default the SVG rendering is cached using QGraphicsItem::DeviceCoordinateCache mode to speedup the display of items. Caching can be disabled by passing |