From 0b06274858cab9cedace8e684d16664e49d5f814 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Sat, 5 Jun 2010 21:10:08 +0200 Subject: Introduce LayoutDirection Qt::LayoutDirectionAuto Extend the enum to contains a value that can be used to hint that we would like to determine the text direction from the content. Reviewed-by: Simon Hausmann --- src/corelib/global/qnamespace.h | 3 ++- src/corelib/global/qnamespace.qdoc | 12 ++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index a9c56f6..a12e121 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -1561,7 +1561,8 @@ public: enum LayoutDirection { LeftToRight, - RightToLeft + RightToLeft, + LayoutDirectionAuto }; enum AnchorPoint { diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 7eae3a5..abbc03e 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -2572,15 +2572,23 @@ /*! \enum Qt::LayoutDirection - Specifies the direction of Qt's layouts: + Specifies the direction of Qt's layouts and text handling. \value LeftToRight Left-to-right layout. \value RightToLeft Right-to-left layout. + \value LayoutDirectionAuto Automatic layout. Right-to-left layouts are necessary for certain languages, notably Arabic and Hebrew. - \sa QApplication::setLayoutDirection(), QWidget::setLayoutDirection() + LayoutDirectionAuto serves two purposes. When used in conjunction with widgets and layouts, it + will imply to use the layout direction set on the parent widget or QApplication. This + has the same effect as QWidget::unsetLayoutDirection(). + + When LayoutDirectoinAuto is used in conjunction with text layouting, it will imply that the text + directionality is determined from the content of the string to be layouted. + + \sa QApplication::setLayoutDirection(), QWidget::setLayoutDirection(), QTextOption::setTextDirection(), QString::isRightToLeft() */ /*! -- cgit v0.12