summaryrefslogtreecommitdiffstats
path: root/src/declarative/fx/qfxtextedit.cpp
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-08-12 01:31:25 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-08-12 01:31:25 (GMT)
commit6fc7ce61ba1b623421ca3ca8ee2315746be0a37b (patch)
tree6ea9c57eaca6996a2e842604b50df1b224941c96 /src/declarative/fx/qfxtextedit.cpp
parent14466ace2ffe1b6707b1120ab76d0baa49635007 (diff)
downloadQt-6fc7ce61ba1b623421ca3ca8ee2315746be0a37b.zip
Qt-6fc7ce61ba1b623421ca3ca8ee2315746be0a37b.tar.gz
Qt-6fc7ce61ba1b623421ca3ca8ee2315746be0a37b.tar.bz2
Change key handling to use a Keys attached property.
Replaces KeyAction, allowing focus to be set on the actual item that wants focus, rather than a separate handler item.
Diffstat (limited to 'src/declarative/fx/qfxtextedit.cpp')
-rw-r--r--src/declarative/fx/qfxtextedit.cpp19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/declarative/fx/qfxtextedit.cpp b/src/declarative/fx/qfxtextedit.cpp
index e4001b2..85e0a5a 100644
--- a/src/declarative/fx/qfxtextedit.cpp
+++ b/src/declarative/fx/qfxtextedit.cpp
@@ -836,13 +836,6 @@ Handles the given key \a event.
void QFxTextEdit::keyPressEvent(QKeyEvent *event)
{
Q_D(QFxTextEdit);
- //### experiment with allowing 'overrides' to key events
- QFxKeyEvent ke(*event);
- emit keyPress(&ke);
- event->setAccepted(ke.isAccepted());
- if (event->isAccepted())
- return;
-
//### this causes non-standard cursor behavior in some cases.
// is it still needed?
/*QTextCursor c = textCursor();
@@ -865,6 +858,9 @@ void QFxTextEdit::keyPressEvent(QKeyEvent *event)
event->ignore();
else*/
d->control->processEvent(event, QPointF(0, 0));
+
+ if (!event->isAccepted())
+ QFxPaintedItem::keyPressEvent(event);
}
/*!
@@ -874,14 +870,9 @@ Handles the given key \a event.
void QFxTextEdit::keyReleaseEvent(QKeyEvent *event)
{
Q_D(QFxTextEdit);
- //### experiment with allowing 'overrides' to key events
- QFxKeyEvent ke(*event);
- emit keyRelease(&ke);
- event->setAccepted(ke.isAccepted());
- if (event->isAccepted())
- return;
-
d->control->processEvent(event, QPointF(0, 0));
+ if (!event->isAccepted())
+ QFxPaintedItem::keyReleaseEvent(event);
}
/*!