summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2010-06-05 19:40:05 (GMT)
committerLars Knoll <lars.knoll@nokia.com>2010-06-09 22:07:40 (GMT)
commit906a68a59c242744568afb12aba1ccc474bf6217 (patch)
tree6cf2ab6d092e21ab3eedea5f07cb957076111638 /src/gui/painting
parent1533e7251d1dc4318b87ec799f0367f5fca0b092 (diff)
downloadQt-906a68a59c242744568afb12aba1ccc474bf6217.zip
Qt-906a68a59c242744568afb12aba1ccc474bf6217.tar.gz
Qt-906a68a59c242744568afb12aba1ccc474bf6217.tar.bz2
LayoutDirectionAuto is the default layout direction for QPainter
Don't retrieve the layout direction from QWidget or QApplication anymore. Respect if somebody explicitly sets the direction with setLayoutDirection(). Task-number: Part of QT-3292 Reviewed-by: Simon Hausmann
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qpainter.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index 97f754d..e8c4599 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -1564,7 +1564,6 @@ void QPainter::initFrom(const QWidget *widget)
d->engine->setDirty(QPaintEngine::DirtyBrush);
d->engine->setDirty(QPaintEngine::DirtyFont);
}
- d->state->layoutDirection = widget->layoutDirection();
}
@@ -1874,7 +1873,7 @@ bool QPainter::begin(QPaintDevice *pd)
QWidget *widget = static_cast<QWidget *>(d->original_device);
initFrom(widget);
} else {
- d->state->layoutDirection = QApplication::layoutDirection();
+ d->state->layoutDirection = Qt::LayoutDirectionAuto;
// make sure we have a font compatible with the paintdevice
d->state->deviceFont = d->state->font = QFont(d->state->deviceFont, device());
}
@@ -8056,7 +8055,10 @@ start_lengthVariant:
Sets the layout direction used by the painter when drawing text,
to the specified \a direction.
- \sa layoutDirection(), drawText(), {QPainter#Settings}{Settings}
+ The default is Qt::LayoutDirectionAuto, which will implicitly determine the
+ direction from the text drawn.
+
+ \sa QTextOption::setTextDirection(), layoutDirection(), drawText(), {QPainter#Settings}{Settings}
*/
void QPainter::setLayoutDirection(Qt::LayoutDirection direction)
{
@@ -8068,12 +8070,12 @@ void QPainter::setLayoutDirection(Qt::LayoutDirection direction)
/*!
Returns the layout direction used by the painter when drawing text.
- \sa setLayoutDirection(), drawText(), {QPainter#Settings}{Settings}
+ \sa QTextOption::textDirection(), setLayoutDirection(), drawText(), {QPainter#Settings}{Settings}
*/
Qt::LayoutDirection QPainter::layoutDirection() const
{
Q_D(const QPainter);
- return d->state ? d->state->layoutDirection : Qt::LeftToRight;
+ return d->state ? d->state->layoutDirection : Qt::LayoutDirectionAuto;
}
QPainterState::QPainterState(const QPainterState *s)