diff options
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativetext_p.h')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativetext_p.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetext_p.h b/src/declarative/graphicsitems/qdeclarativetext_p.h index cbea8f3..7a09b2f 100644 --- a/src/declarative/graphicsitems/qdeclarativetext_p.h +++ b/src/declarative/graphicsitems/qdeclarativetext_p.h @@ -42,6 +42,7 @@ #ifndef QDECLARATIVETEXT_H #define QDECLARATIVETEXT_H +#include <QtGui/qtextoption.h> #include "qdeclarativeitem.h" QT_BEGIN_HEADER @@ -58,6 +59,7 @@ class Q_DECLARATIVE_EXPORT QDeclarativeText : public QDeclarativeItem Q_ENUMS(TextStyle) Q_ENUMS(TextFormat) Q_ENUMS(TextElideMode) + Q_ENUMS(WrapMode) Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged) Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged) @@ -66,7 +68,8 @@ class Q_DECLARATIVE_EXPORT QDeclarativeText : public QDeclarativeItem Q_PROPERTY(QColor styleColor READ styleColor WRITE setStyleColor NOTIFY styleColorChanged) Q_PROPERTY(HAlignment horizontalAlignment READ hAlign WRITE setHAlign NOTIFY horizontalAlignmentChanged) Q_PROPERTY(VAlignment verticalAlignment READ vAlign WRITE setVAlign NOTIFY verticalAlignmentChanged) - Q_PROPERTY(bool wrap READ wrap WRITE setWrap NOTIFY wrapChanged) //### there are several wrap modes in Qt + Q_PROPERTY(WrapMode wrapMode READ wrapMode WRITE setWrapMode NOTIFY wrapModeChanged) + Q_PROPERTY(bool wrap READ wrap WRITE setWrap NOTIFY wrapModeChanged) Q_PROPERTY(TextFormat textFormat READ textFormat WRITE setTextFormat NOTIFY textFormatChanged) Q_PROPERTY(TextElideMode elide READ elideMode WRITE setElideMode NOTIFY elideModeChanged) //### elideMode? @@ -93,6 +96,12 @@ public: ElideMiddle = Qt::ElideMiddle, ElideNone = Qt::ElideNone }; + enum WrapMode { NoWrap = QTextOption::NoWrap, + WordWrap = QTextOption::WordWrap +// WrapAnywhere = QTextOption::WrapAnywhere, +// WrapAtWordBoundaryOrAnywhere = QTextOption::WrapAtWordBoundaryOrAnywhere + }; + QString text() const; void setText(const QString &); @@ -116,6 +125,8 @@ public: bool wrap() const; void setWrap(bool w); + WrapMode wrapMode() const; + void setWrapMode(WrapMode w); TextFormat textFormat() const; void setTextFormat(TextFormat format); @@ -136,7 +147,7 @@ Q_SIGNALS: void styleColorChanged(const QColor &color); void horizontalAlignmentChanged(HAlignment alignment); void verticalAlignmentChanged(VAlignment alignment); - void wrapChanged(bool wrap); + void wrapModeChanged(); void textFormatChanged(TextFormat textFormat); void elideModeChanged(TextElideMode mode); |