aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2012-01-05 12:48:53 +1000
committerQt by Nokia <qt-info@nokia.com>2012-01-05 04:51:26 +0100
commit966e8856837686668d04f089cfb75c2a48ae933e (patch)
tree3ceef1dd4837222cd4f7a691d1dc28dd5f67c860 /src
parentc7723cba1fb833924c5ae63dae549d8d60c14299 (diff)
Document inputMethodHints and cursorRectangle properties.
Task-number: QTBUG-22612 Task-number: QTBUG-20764 Change-Id: Ibab86c5934f0ad6e3115a00371a5b2a6961720b5 Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/quick/items/qquicktextedit.cpp52
-rw-r--r--src/quick/items/qquicktextinput.cpp55
2 files changed, 103 insertions, 4 deletions
diff --git a/src/quick/items/qquicktextedit.cpp b/src/quick/items/qquicktextedit.cpp
index 9977f60519..1d0c500238 100644
--- a/src/quick/items/qquicktextedit.cpp
+++ b/src/quick/items/qquicktextedit.cpp
@@ -1029,7 +1029,7 @@ void QQuickTextEdit::setPersistentSelection(bool on)
emit persistentSelectionChanged(d->persistentSelection);
}
-/*
+/*!
\qmlproperty real QtQuick2::TextEdit::textMargin
The margin, in pixels, around the text in the TextEdit.
@@ -1050,6 +1050,50 @@ void QQuickTextEdit::setTextMargin(qreal margin)
emit textMarginChanged(d->textMargin);
}
+/*!
+ \qmlproperty enumeration QtQuick2::TextEdit::inputMethodHints
+
+ Provides hints to the input method about the expected content of the text edit and how it
+ should operate.
+
+ The value is a bit-wise combination of flags or Qt.ImhNone if no hints are set.
+
+ Flags that alter behaviour are:
+
+ \list
+ \o Qt.ImhHiddenText - Characters should be hidden, as is typically used when entering passwords.
+ \o Qt.ImhSensitiveData - Typed text should not be stored by the active input method
+ in any persistent storage like predictive user dictionary.
+ \o Qt.ImhNoAutoUppercase - The input method should not try to automatically switch to upper case
+ when a sentence ends.
+ \o Qt.ImhPreferNumbers - Numbers are preferred (but not required).
+ \o Qt.ImhPreferUppercase - Upper case letters are preferred (but not required).
+ \o Qt.ImhPreferLowercase - Lower case letters are preferred (but not required).
+ \o Qt.ImhNoPredictiveText - Do not use predictive text (i.e. dictionary lookup) while typing.
+
+ \o Qt.ImhDate - The text editor functions as a date field.
+ \o Qt.ImhTime - The text editor functions as a time field.
+ \endlist
+
+ Flags that restrict input (exclusive flags) are:
+
+ \list
+ \o Qt.ImhDigitsOnly - Only digits are allowed.
+ \o Qt.ImhFormattedNumbersOnly - Only number input is allowed. This includes decimal point and minus sign.
+ \o Qt.ImhUppercaseOnly - Only upper case letter input is allowed.
+ \o Qt.ImhLowercaseOnly - Only lower case letter input is allowed.
+ \o Qt.ImhDialableCharactersOnly - Only characters suitable for phone dialing are allowed.
+ \o Qt.ImhEmailCharactersOnly - Only characters suitable for email addresses are allowed.
+ \o Qt.ImhUrlCharactersOnly - Only characters suitable for URLs are allowed.
+ \endlist
+
+ Masks:
+
+ \list
+ \o Qt.ImhExclusiveInputMask - This mask yields nonzero if any of the exclusive flags are used.
+ \endlist
+*/
+
void QQuickTextEdit::geometryChanged(const QRectF &newGeometry,
const QRectF &oldGeometry)
{
@@ -1193,8 +1237,12 @@ Qt::TextInteractionFlags QQuickTextEdit::textInteractionFlags() const
/*!
\qmlproperty rectangle QtQuick2::TextEdit::cursorRectangle
- The rectangle where the text cursor is rendered
+ The rectangle where the standard text cursor is rendered
within the text edit. Read-only.
+
+ The position and height of a custom cursorDelegate are updated to follow the cursorRectangle
+ automatically when it changes. The width of the delegate is unaffected by changes in the
+ cursor rectangle.
*/
QRect QQuickTextEdit::cursorRectangle() const
{
diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp
index 8cc87c3828..40981f95d6 100644
--- a/src/quick/items/qquicktextinput.cpp
+++ b/src/quick/items/qquicktextinput.cpp
@@ -661,9 +661,15 @@ void QQuickTextInput::setCursorPosition(int cp)
}
/*!
- Returns a Rect which encompasses the cursor, but which may be larger than is
- required. Ignores custom cursor delegates.
+ \qmlproperty rectangle QtQuick2::TextInput::cursorRectangle
+
+ The rectangle where the standard text cursor is rendered within the text input. Read only.
+
+ The position and height of a custom cursorDelegate are updated to follow the cursorRectangle
+ automatically when it changes. The width of the delegate is unaffected by changes in the
+ cursor rectangle.
*/
+
QRect QQuickTextInput::cursorRectangle() const
{
Q_D(const QQuickTextInput);
@@ -1024,6 +1030,51 @@ void QQuickTextInput::setEchoMode(QQuickTextInput::EchoMode echo)
emit echoModeChanged(echoMode());
}
+/*!
+ \qmlproperty enumeration QtQuick2::TextInput::inputMethodHints
+
+ Provides hints to the input method about the expected content of the text input and how it
+ should operate.
+
+ The value is a bit-wise combination of flags, or Qt.ImhNone if no hints are set.
+
+ Flags that alter behaviour are:
+
+ \list
+ \o Qt.ImhHiddenText - Characters should be hidden, as is typically used when entering passwords.
+ This is automatically set when setting echoMode to \c TextInput.Password.
+ \o Qt.ImhSensitiveData - Typed text should not be stored by the active input method
+ in any persistent storage like predictive user dictionary.
+ \o Qt.ImhNoAutoUppercase - The input method should not try to automatically switch to upper case
+ when a sentence ends.
+ \o Qt.ImhPreferNumbers - Numbers are preferred (but not required).
+ \o Qt.ImhPreferUppercase - Upper case letters are preferred (but not required).
+ \o Qt.ImhPreferLowercase - Lower case letters are preferred (but not required).
+ \o Qt.ImhNoPredictiveText - Do not use predictive text (i.e. dictionary lookup) while typing.
+
+ \o Qt.ImhDate - The text editor functions as a date field.
+ \o Qt.ImhTime - The text editor functions as a time field.
+ \endlist
+
+ Flags that restrict input (exclusive flags) are:
+
+ \list
+ \o Qt.ImhDigitsOnly - Only digits are allowed.
+ \o Qt.ImhFormattedNumbersOnly - Only number input is allowed. This includes decimal point and minus sign.
+ \o Qt.ImhUppercaseOnly - Only upper case letter input is allowed.
+ \o Qt.ImhLowercaseOnly - Only lower case letter input is allowed.
+ \o Qt.ImhDialableCharactersOnly - Only characters suitable for phone dialing are allowed.
+ \o Qt.ImhEmailCharactersOnly - Only characters suitable for email addresses are allowed.
+ \o Qt.ImhUrlCharactersOnly - Only characters suitable for URLs are allowed.
+ \endlist
+
+ Masks:
+
+ \list
+ \o Qt.ImhExclusiveInputMask - This mask yields nonzero if any of the exclusive flags are used.
+ \endlist
+*/
+
Qt::InputMethodHints QQuickTextInput::imHints() const
{
Q_D(const QQuickTextInput);