diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2009-07-08 08:27:58 (GMT) |
---|---|---|
committer | Alan Alpert <alan.alpert@nokia.com> | 2009-07-08 08:27:58 (GMT) |
commit | 5be447a0f1a7cdd69fc94543e9b83038cc2b77b3 (patch) | |
tree | 389d915f07195d578c6a6c333132fd7ab6e362b6 /src/declarative/fx/qfxtextedit.h | |
parent | 6259c9fbc4719994bd491271eba5c47143df67c6 (diff) | |
download | Qt-5be447a0f1a7cdd69fc94543e9b83038cc2b77b3.zip Qt-5be447a0f1a7cdd69fc94543e9b83038cc2b77b3.tar.gz Qt-5be447a0f1a7cdd69fc94543e9b83038cc2b77b3.tar.bz2 |
Implement selectedText, selectionStart and selectionEnd properties.
Still to go: Setting the selectionStart/End properties doesn't work
and there are no autotests.
Diffstat (limited to 'src/declarative/fx/qfxtextedit.h')
-rw-r--r-- | src/declarative/fx/qfxtextedit.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/declarative/fx/qfxtextedit.h b/src/declarative/fx/qfxtextedit.h index b29993e..80636e2 100644 --- a/src/declarative/fx/qfxtextedit.h +++ b/src/declarative/fx/qfxtextedit.h @@ -78,8 +78,11 @@ class Q_DECLARATIVE_EXPORT QFxTextEdit : public QFxPaintedItem Q_PROPERTY(TextFormat textFormat READ textFormat WRITE setTextFormat) Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly) Q_PROPERTY(bool cursorVisible READ isCursorVisible WRITE setCursorVisible) - Q_PROPERTY(int cursorPosition READ cursorPosition WRITE setCursorPosition) - Q_PROPERTY(QmlComponent* cursorDelegate READ cursorDelegate WRITE setCursorDelegate); + Q_PROPERTY(int cursorPosition READ cursorPosition WRITE setCursorPosition NOTIFY cursorPositionChanged) + Q_PROPERTY(QmlComponent* cursorDelegate READ cursorDelegate WRITE setCursorDelegate) + Q_PROPERTY(int selectionStart READ selectionStart WRITE setSelectionStart NOTIFY selectionStartChanged) + Q_PROPERTY(int selectionEnd READ selectionEnd WRITE setSelectionEnd NOTIFY selectionEndChanged) + Q_PROPERTY(QString selectedText READ selectedText NOTIFY selectionChanged) Q_PROPERTY(bool focusOnPress READ focusOnPress WRITE setFocusOnPress) Q_PROPERTY(bool preserveSelection READ preserveSelection WRITE setPreserveSelection) Q_PROPERTY(qreal textMargin READ textMargin WRITE setTextMargin) @@ -141,6 +144,14 @@ public: QmlComponent* cursorDelegate() const; void setCursorDelegate(QmlComponent*); + int selectionStart() const; + void setSelectionStart(int); + + int selectionEnd() const; + void setSelectionEnd(int); + + QString selectedText() const; + bool focusOnPress() const; void setFocusOnPress(bool on); @@ -176,6 +187,9 @@ public: Q_SIGNALS: void textChanged(const QString &); void cursorPositionChanged(); + void selectionStartChanged(); + void selectionEndChanged(); + void selectionChanged(); public Q_SLOTS: void selectAll(); @@ -184,6 +198,7 @@ private Q_SLOTS: void fontChanged(); void updateImgCache(const QRectF &rect); void q_textChanged(); + void updateSelectionMarkers(); void moveCursorDelegate(); void loadCursorDelegate(); |