diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2010-04-22 08:29:37 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2010-04-22 08:29:37 (GMT) |
commit | 27f566fb608d9465110dc67d16fe8f88ee9d4a0a (patch) | |
tree | c8925b7aa4effc946ba8330648c95a288f923d4d /src/gui | |
parent | 79a093b7f4c78994504a0a9e306169df1eb4c7a3 (diff) | |
parent | 144f3bade4d5f48ebc268dae0df26ddf7dfe1228 (diff) | |
download | Qt-27f566fb608d9465110dc67d16fe8f88ee9d4a0a.zip Qt-27f566fb608d9465110dc67d16fe8f88ee9d4a0a.tar.gz Qt-27f566fb608d9465110dc67d16fe8f88ee9d4a0a.tar.bz2 |
Merge remote branch 'origin/4.6' into qt-4.7-from-4.6
Conflicts:
src/openvg/qpaintengine_vg.cpp
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/styles/qstylesheetstyle.cpp | 9 | ||||
-rw-r--r-- | src/gui/styles/qstylesheetstyle_p.h | 1 | ||||
-rw-r--r-- | src/gui/text/qfontengine_s60.cpp | 8 |
3 files changed, 14 insertions, 4 deletions
diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp index 81b923b..515b6c7 100644 --- a/src/gui/styles/qstylesheetstyle.cpp +++ b/src/gui/styles/qstylesheetstyle.cpp @@ -1539,7 +1539,9 @@ QVector<QCss::StyleRule> QStyleSheetStyle::styleRules(const QWidget *w) const QHash<const void *, StyleSheet>::const_iterator defaultCacheIt = styleSheetCache->constFind(baseStyle()); if (defaultCacheIt == styleSheetCache->constEnd()) { defaultSs = getDefaultStyleSheet(); - styleSheetCache->insert(baseStyle(), defaultSs); + QStyle *bs = baseStyle(); + styleSheetCache->insert(bs, defaultSs); + QObject::connect(bs, SIGNAL(destroyed(QObject*)), this, SLOT(styleDestroyed(QObject*)), Qt::UniqueConnection); } else { defaultSs = defaultCacheIt.value(); } @@ -2666,6 +2668,11 @@ void QStyleSheetStyle::widgetDestroyed(QObject *o) autoFillDisabledWidgets->remove((const QWidget *)o); } +void QStyleSheetStyle::styleDestroyed(QObject *o) +{ + styleSheetCache->remove(o); +} + /*! * Make sure that the cache will be clean by connecting destroyed if needed. * return false if the widget is not stylable; diff --git a/src/gui/styles/qstylesheetstyle_p.h b/src/gui/styles/qstylesheetstyle_p.h index 50abef9..fd81437 100644 --- a/src/gui/styles/qstylesheetstyle_p.h +++ b/src/gui/styles/qstylesheetstyle_p.h @@ -147,6 +147,7 @@ protected: private Q_SLOTS: void widgetDestroyed(QObject *); + void styleDestroyed(QObject *); private: int refcount; diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp index c9ff661..e557f56 100644 --- a/src/gui/text/qfontengine_s60.cpp +++ b/src/gui/text/qfontengine_s60.cpp @@ -221,9 +221,11 @@ bool QFontEngineS60::stringToCMap(const QChar *characters, int len, QGlyphLayout HB_Glyph *g = glyphs->glyphs; const unsigned char* cmap = m_extensions->cmap(); + const bool isRtl = (flags & QTextEngine::RightToLeft); for (int i = 0; i < len; ++i) { const unsigned int uc = getChar(characters, i, len); - *g++ = QFontEngine::getTrueTypeGlyphIndex(cmap, uc); + *g++ = QFontEngine::getTrueTypeGlyphIndex(cmap, + isRtl ? QChar::mirroredChar(uc) : uc); } glyphs->numGlyphs = g - glyphs->glyphs; @@ -241,8 +243,8 @@ void QFontEngineS60::recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFla Q_UNUSED(flags); for (int i = 0; i < glyphs->numGlyphs; i++) { const glyph_metrics_t bbox = boundingBox_const(glyphs->glyphs[i]); - glyphs->advances_x[i] = glyphs->offsets[i].x = bbox.xoff; - glyphs->advances_y[i] = glyphs->offsets[i].y = bbox.yoff; + glyphs->advances_x[i] = bbox.xoff; + glyphs->advances_y[i] = bbox.yoff; } } |