src/hbwidgets/editors/hbdatetimeedit.cpp
branchGCC_SURGE
changeset 15 f378acbc9cfb
parent 7 923ff622b8b9
child 28 b7da29130b0e
--- a/src/hbwidgets/editors/hbdatetimeedit.cpp	Thu Jul 15 14:03:49 2010 +0100
+++ b/src/hbwidgets/editors/hbdatetimeedit.cpp	Thu Jul 22 16:36:53 2010 +0100
@@ -24,11 +24,13 @@
 ****************************************************************************/
 
 #include <QDateTime>
+#include <QMetaMethod>
 
 #include "hblineedit.h"
 #include "hbdatetimevalidator_p.h"
 #include "hbdatetimeedit.h"
 #include "hbdatetimeedit_p.h"
+#include "hbevent.h"
 
 /*!
     @alpha
@@ -233,13 +235,14 @@
 /*!
     \reimp
 */
-void HbDateTimeEdit::focusOutEvent(QFocusEvent *event)
+bool HbDateTimeEdit::event(QEvent* event)
 {
-    HbAbstractEdit::focusOutEvent(event);
-
     Q_D(HbDateTimeEdit);
-    if(d->validator->fixDate(&d->cursor, true)) {
-        // fixing so restore focus to editor
-        setFocus(event->reason());
+
+    if (event->type() == HbEvent::InputMethodFocusOut) {
+        d->validator->fixDate(&d->cursor, true);
     }
+
+    return HbLineEdit::event(event);
 }
+