From e5e1ff0d6f4e6a8457da61b5b215730de6f960bd Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 6 Jul 2011 11:44:57 +0200 Subject: Fix bidi reordering when part of text is rendered by fallback font If the fallback font is used for part of a RTL text, we need to position the different text items accordingly, subtracting the advance instead of adding it. Task-number: QTBUG-17117 Done-with: Lars --- src/gui/painting/qpainter.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index a4ab00a..604c1ab 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -6512,6 +6512,10 @@ void QPainter::drawTextItem(const QPointF &p, const QTextItem &_ti) qreal x = p.x(); qreal y = p.y(); + bool rtl = ti.flags & QTextItem::RightToLeft; + if (rtl) + x += ti.width.toReal(); + int start = 0; int end, i; for (end = 0; end < ti.glyphs.numGlyphs; ++end) { @@ -6528,14 +6532,19 @@ void QPainter::drawTextItem(const QPointF &p, const QTextItem &_ti) ti2.width += ti.glyphs.effectiveAdvance(i); } + if (rtl) + x -= ti2.width.toReal(); + d->engine->drawTextItem(QPointF(x, y), ti2); + if (!rtl) + x += ti2.width.toReal(); + // reset the high byte for all glyphs and advance to the next sub-string const int hi = which << 24; for (i = start; i < end; ++i) { glyphs.glyphs[i] = hi | glyphs.glyphs[i]; } - x += ti2.width.toReal(); // change engine start = end; @@ -6550,6 +6559,9 @@ void QPainter::drawTextItem(const QPointF &p, const QTextItem &_ti) ti2.width += ti.glyphs.effectiveAdvance(i); } + if (rtl) + x -= ti2.width.toReal(); + if (d->extended) d->extended->drawTextItem(QPointF(x, y), ti2); else -- cgit v0.12 From b3e0d76d558d35e40f1c4f1b5b1b14ba79f8eef6 Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Wed, 6 Jul 2011 14:32:10 +0300 Subject: On symbian QMessageBox does not look like native dialog If API QMessageBox::setInformativeText() is used to set informative text to the messagebox, the text is added to the "icon column", which makes the messagebox look really weird. Use layoutDirection() and add informative text to the same column where other text elements are added. Task-number: QTBUG-9924 Reviewed-by: Tomi Vihria --- src/gui/dialogs/qmessagebox.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gui/dialogs/qmessagebox.cpp b/src/gui/dialogs/qmessagebox.cpp index 6a1c04a..f18fe60 100644 --- a/src/gui/dialogs/qmessagebox.cpp +++ b/src/gui/dialogs/qmessagebox.cpp @@ -2507,7 +2507,12 @@ void QMessageBox::setInformativeText(const QString &text) label->hide(); QTextBrowser *textBrowser = new QTextBrowser(this); textBrowser->setOpenExternalLinks(true); - grid->addWidget(textBrowser, 1, 1, 1, 1); +#if defined(Q_OS_SYMBIAN) + const int preferredTextColumn = (QApplication::layoutDirection() == Qt::LeftToRight) ? 0 : 1; +#else + const int preferredTextColumn = 1; +#endif + grid->addWidget(textBrowser, 1, preferredTextColumn, 1, 1); d->textBrowser = textBrowser; #else grid->addWidget(label, 1, 1, 1, 1); -- cgit v0.12 From 52c2bf0e0dc5bcad1b75f9b8d817b39ca7754476 Mon Sep 17 00:00:00 2001 From: Casper van Donderen Date: Thu, 7 Jul 2011 11:01:28 +0200 Subject: Update the Window title when closing the last tab. Fixes: QTBUG-20243 Reviewed-By: Kevin Wright --- demos/browser/tabwidget.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/demos/browser/tabwidget.cpp b/demos/browser/tabwidget.cpp index 9ce9fb8..d8b9db1 100644 --- a/demos/browser/tabwidget.cpp +++ b/demos/browser/tabwidget.cpp @@ -438,6 +438,7 @@ WebView *TabWidget::newTab(bool makeCurrent) addTab(emptyWidget, tr("(Untitled)")); connect(this, SIGNAL(currentChanged(int)), this, SLOT(currentChanged(int))); + currentChanged(currentIndex()); return 0; } -- cgit v0.12