summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qmlgraphicstextinput.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/graphicsitems/qmlgraphicstextinput.cpp')
-rw-r--r--src/declarative/graphicsitems/qmlgraphicstextinput.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/declarative/graphicsitems/qmlgraphicstextinput.cpp b/src/declarative/graphicsitems/qmlgraphicstextinput.cpp
index a7b25c5..6b4407f 100644
--- a/src/declarative/graphicsitems/qmlgraphicstextinput.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicstextinput.cpp
@@ -51,12 +51,6 @@
QT_BEGIN_NAMESPACE
-QML_DEFINE_TYPE(Qt,4,6,TextInput,QmlGraphicsTextInput);
-QML_DEFINE_NOCREATE_TYPE(QValidator);
-QML_DEFINE_TYPE(Qt,4,6,QIntValidator,QIntValidator);
-QML_DEFINE_TYPE(Qt,4,6,QDoubleValidator,QDoubleValidator);
-QML_DEFINE_TYPE(Qt,4,6,QRegExpValidator,QRegExpValidator);
-
/*!
\qmlclass TextInput QmlGraphicsTextInput
The TextInput item allows you to add an editable line of text to a scene.
@@ -652,10 +646,12 @@ void QmlGraphicsTextInput::focusChanged(bool hasFocus)
void QmlGraphicsTextInput::keyPressEvent(QKeyEvent* ev)
{
Q_D(QmlGraphicsTextInput);
- if((d->control->cursor() == 0 && ev->key() == Qt::Key_Left)
+ if(((d->control->cursor() == 0 && ev->key() == Qt::Key_Left)
|| (d->control->cursor() == d->control->text().length()
- && ev->key() == Qt::Key_Right)){
+ && ev->key() == Qt::Key_Right))
+ && (d->lastSelectionStart == d->lastSelectionEnd)){
//ignore when moving off the end
+ //unless there is a selection, because then moving will do something (deselect)
ev->ignore();
}else{
d->control->processKeyEvent(ev);