diff options
author | Andrew den Exter <andrew.den-exter@nokia.com> | 2012-02-09 16:14:40 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-09 09:10:31 +0100 |
commit | 8550ed69156f0472450fd11aabcaa5d4dcc676db (patch) | |
tree | 91b1d6848e1ce5199db4040decb4a3cd79352788 /src/quick/items/qquicktext_p.h | |
parent | a4b4932efb631a3c467c9bb4b3e4f99ca70a066d (diff) |
Add linkColor property to Text.
Allows the color of links in text to be changed from the default blue.
This currently only works with StyledText and the distance field
rendererer. It could be made to work with RichText overwriting the
specified foreground color in all instances or by not setting a default
color in the html parser. The former would prevent the color being
set with CSS or some future means for altering text formats. The latter
would break rendering with QPainter.
Task-number: QTBUG-23048
Change-Id: I98df215cabe8a089f648fd4a6206622b4318fb8f
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src/quick/items/qquicktext_p.h')
-rw-r--r-- | src/quick/items/qquicktext_p.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/quick/items/qquicktext_p.h b/src/quick/items/qquicktext_p.h index ff1f45e605..8f173f97cb 100644 --- a/src/quick/items/qquicktext_p.h +++ b/src/quick/items/qquicktext_p.h @@ -68,6 +68,7 @@ class Q_QUICK_PRIVATE_EXPORT QQuickText : public QQuickImplicitSizeItem Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged) Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged) Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) + Q_PROPERTY(QColor linkColor READ linkColor WRITE setLinkColor NOTIFY linkColorChanged) Q_PROPERTY(TextStyle style READ style WRITE setStyle NOTIFY styleChanged) Q_PROPERTY(QColor styleColor READ styleColor WRITE setStyleColor NOTIFY styleColorChanged) Q_PROPERTY(HAlignment horizontalAlignment READ hAlign WRITE setHAlign RESET resetHAlign NOTIFY horizontalAlignmentChanged) @@ -136,6 +137,9 @@ public: QColor color() const; void setColor(const QColor &c); + QColor linkColor() const; + void setLinkColor(const QColor &color); + TextStyle style() const; void setStyle(TextStyle style); @@ -201,6 +205,7 @@ Q_SIGNALS: void linkActivated(const QString &link); void fontChanged(const QFont &font); void colorChanged(const QColor &color); + void linkColorChanged(); void styleChanged(TextStyle style); void styleColorChanged(const QColor &color); void horizontalAlignmentChanged(HAlignment alignment); |