diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2016-11-11 10:22:33 +0100 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2016-11-14 11:48:46 +0000 |
commit | 47847bebcacef2bbf3b5627ca18966d7d34d6762 (patch) | |
tree | f8dc2e57e94262074705602cd69227e76021e5ea /src/quick/items/qquicktextnodeengine_p.h | |
parent | cf63d8fc8f2006df2211c33ad077c2dcd95349e9 (diff) |
Fix flow text objects in beginning of RTL block
If the block is right-to-left and starts with a text object, it
should be aligned to the right edge of the QTextLine instead
of the left one.
[ChangeLog][QtQuick][Text] Fixed placement of flowing text objects
in the start of a right-to-left block.
Task-number: QTBUG-43133
Change-Id: Id790e88f3464280f124c38b4260386b84cac8826
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/quick/items/qquicktextnodeengine_p.h')
-rw-r--r-- | src/quick/items/qquicktextnodeengine_p.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/quick/items/qquicktextnodeengine_p.h b/src/quick/items/qquicktextnodeengine_p.h index 91ed6f4430..18c624513a 100644 --- a/src/quick/items/qquicktextnodeengine_p.h +++ b/src/quick/items/qquicktextnodeengine_p.h @@ -144,7 +144,11 @@ public: int selectionState; }; - QQuickTextNodeEngine() : m_hasSelection(false), m_hasContents(false) {} + QQuickTextNodeEngine() + : m_currentTextDirection(Qt::LeftToRight) + , m_hasSelection(false) + , m_hasContents(false) + {} bool hasContents() const { return m_hasContents; } void addTextBlock(QTextDocument *, const QTextBlock &, const QPointF &position, const QColor &textColor, const QColor& anchorColor, int selectionStart, int selectionEnd); @@ -158,6 +162,11 @@ public: m_currentLine = currentLine; } + void setCurrentTextDirection(Qt::LayoutDirection textDirection) + { + m_currentTextDirection = textDirection; + } + void addBorder(const QRectF &rect, qreal border, QTextFrameFormat::BorderStyle borderStyle, const QBrush &borderBrush); void addFrameDecorations(QTextDocument *document, QTextFrame *frame); @@ -247,6 +256,7 @@ private: QPointF m_position; QTextLine m_currentLine; + Qt::LayoutDirection m_currentTextDirection; QList<QPair<QRectF, QColor> > m_backgrounds; QList<QRectF> m_selectionRects; |