diff options
author | Martin Jones <martin.jones@nokia.com> | 2009-10-08 08:30:50 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2009-10-08 08:30:50 (GMT) |
commit | db531c30eb73ff7aeac9cf07b06d6a108b2c13ec (patch) | |
tree | f52f09cbc0d72ebddea7586c2589cb260a0484e2 /src | |
parent | 6f5c3d1c6f9d3a826821d12139070e9772eae749 (diff) | |
parent | 2b66a299baef677df027c1530764c6d4b201d166 (diff) | |
download | Qt-db531c30eb73ff7aeac9cf07b06d6a108b2c13ec.zip Qt-db531c30eb73ff7aeac9cf07b06d6a108b2c13ec.tar.gz Qt-db531c30eb73ff7aeac9cf07b06d6a108b2c13ec.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/QmlChanges.txt | 1 | ||||
-rw-r--r-- | src/declarative/fx/qfxtextedit.cpp | 14 | ||||
-rw-r--r-- | src/declarative/fx/qfxtextedit.h | 6 | ||||
-rw-r--r-- | src/declarative/fx/qfxtextedit_p.h | 4 | ||||
-rw-r--r-- | src/declarative/util/qmlview.cpp | 10 | ||||
-rw-r--r-- | src/declarative/util/qmlview.h | 1 |
6 files changed, 24 insertions, 12 deletions
diff --git a/src/declarative/QmlChanges.txt b/src/declarative/QmlChanges.txt index 7661e03..ee5acd4 100644 --- a/src/declarative/QmlChanges.txt +++ b/src/declarative/QmlChanges.txt @@ -41,6 +41,7 @@ Text elements: hAlign -> horizontalAlignment Text elements: vAlign -> verticalAlignment Text elements: highlightColor -> selectionColor Text elements: highlightedTextColor -> selectedTextColor +Text elements: preserveSelection -> persistentSelection State: operations -> changes Transition: operations -> animations Transition: fromState -> from diff --git a/src/declarative/fx/qfxtextedit.cpp b/src/declarative/fx/qfxtextedit.cpp index f4c2e4c..07444bb 100644 --- a/src/declarative/fx/qfxtextedit.cpp +++ b/src/declarative/fx/qfxtextedit.cpp @@ -407,7 +407,7 @@ void QFxTextEdit::setCursorVisible(bool on) return; d->cursorVisible = on; QFocusEvent focusEvent(on ? QEvent::FocusIn : QEvent::FocusOut); - if (!on && !d->preserveSelection) + if (!on && !d->persistentSelection) d->control->setCursorIsFocusIndicator(true); d->control->processEvent(&focusEvent, QPointF(0, 0)); } @@ -590,23 +590,23 @@ void QFxTextEdit::setFocusOnPress(bool on) } /*! - \qmlproperty bool TextEdit::preserveSelection + \qmlproperty bool TextEdit::persistentSelection Whether the TextEdit should keep the selection visible when it loses focus to another item in the scene. By default this is set to true; */ -bool QFxTextEdit::preserveSelection() const +bool QFxTextEdit::persistentSelection() const { Q_D(const QFxTextEdit); - return d->preserveSelection; + return d->persistentSelection; } -void QFxTextEdit::setPreserveSelection(bool on) +void QFxTextEdit::setPersistentSelection(bool on) { Q_D(QFxTextEdit); - if (d->preserveSelection == on) + if (d->persistentSelection == on) return; - d->preserveSelection = on; + d->persistentSelection = on; } qreal QFxTextEdit::textMargin() const diff --git a/src/declarative/fx/qfxtextedit.h b/src/declarative/fx/qfxtextedit.h index 1a5d968..f4f101a 100644 --- a/src/declarative/fx/qfxtextedit.h +++ b/src/declarative/fx/qfxtextedit.h @@ -83,7 +83,7 @@ class Q_DECLARATIVE_EXPORT QFxTextEdit : public QFxPaintedItem 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(bool persistentSelection READ persistentSelection WRITE setPersistentSelection) Q_PROPERTY(qreal textMargin READ textMargin WRITE setTextMargin) public: @@ -154,8 +154,8 @@ public: bool focusOnPress() const; void setFocusOnPress(bool on); - bool preserveSelection() const; - void setPreserveSelection(bool on); + bool persistentSelection() const; + void setPersistentSelection(bool on); qreal textMargin() const; void setTextMargin(qreal margin); diff --git a/src/declarative/fx/qfxtextedit_p.h b/src/declarative/fx/qfxtextedit_p.h index 9c73db9..82481ff 100644 --- a/src/declarative/fx/qfxtextedit_p.h +++ b/src/declarative/fx/qfxtextedit_p.h @@ -70,7 +70,7 @@ public: QFxTextEditPrivate() : color("black"), imgDirty(true), hAlign(QFxTextEdit::AlignLeft), vAlign(QFxTextEdit::AlignTop), dirty(false), wrap(false), richText(false), cursorVisible(false), focusOnPress(false), - preserveSelection(true), textMargin(0.0), lastSelectionStart(0), lastSelectionEnd(0), + persistentSelection(true), textMargin(0.0), lastSelectionStart(0), lastSelectionEnd(0), cursorComponent(0), cursor(0), format(QFxTextEdit::AutoText), document(0) { } @@ -98,7 +98,7 @@ public: bool richText; bool cursorVisible; bool focusOnPress; - bool preserveSelection; + bool persistentSelection; qreal textMargin; int lastSelectionStart; int lastSelectionEnd; diff --git a/src/declarative/util/qmlview.cpp b/src/declarative/util/qmlview.cpp index f932e4a..14f8279 100644 --- a/src/declarative/util/qmlview.cpp +++ b/src/declarative/util/qmlview.cpp @@ -235,6 +235,16 @@ void QmlView::setUrl(const QUrl& url) } /*! + Returns the source URL, if set. + + \sa setUrl() + */ +QUrl QmlView::url() const +{ + return d->source; +} + +/*! Sets the source to the URL from the \a filename, and sets the QML string to \a qml. */ diff --git a/src/declarative/util/qmlview.h b/src/declarative/util/qmlview.h index b54101f..faf2564 100644 --- a/src/declarative/util/qmlview.h +++ b/src/declarative/util/qmlview.h @@ -70,6 +70,7 @@ public: virtual ~QmlView(); void setUrl(const QUrl&); + QUrl url() const; void setQml(const QString &qml, const QString &filename=QString()); QString qml() const; QmlEngine* engine(); |