diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2014-11-12 15:45:43 +0100 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2014-11-12 16:06:48 +0100 |
commit | 24a94ab833dac46790a58e8375dc226890994716 (patch) | |
tree | 9b3f33be9db3ca53b53df7e64633c78b90347a13 /src/widgets/graphicsview | |
parent | f79d96b486c1dd50876001b9c3f65d103e07a18c (diff) |
QGraphicsTextItem: document that adjustSize can center/right align text
Unlike QTextEdit, there's no implicit width for a QGraphicsTextItem,
meaning any rich text that is supposed to be centered or right aligned
will not be unless the user explicitly sets the width.
There's also another possibility: calling adjustSize() manually.
Document that.
Task-number: QTBUG-312
Change-Id: I83023269f4c63643e8224887efe2143dd1bb1908
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Diffstat (limited to 'src/widgets/graphicsview')
-rw-r--r-- | src/widgets/graphicsview/qgraphicsitem.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/widgets/graphicsview/qgraphicsitem.cpp b/src/widgets/graphicsview/qgraphicsitem.cpp index 8df2263325..03f22a270f 100644 --- a/src/widgets/graphicsview/qgraphicsitem.cpp +++ b/src/widgets/graphicsview/qgraphicsitem.cpp @@ -9791,6 +9791,7 @@ QVariant QGraphicsPixmapItem::extension(const QVariant &variant) const using textWidth(). \note In order to align HTML text in the center, the item's text width must be set. + Otherwise, you can call adjustSize() after setting the item's text. \image graphicsview-textitem.png |