src/hbwidgets/editors/hbdatetimeedit.cpp
branchGCC_SURGE
changeset 15 f378acbc9cfb
parent 7 923ff622b8b9
child 28 b7da29130b0e
equal deleted inserted replaced
9:730c025d4b77 15:f378acbc9cfb
    22 ** Nokia at developer.feedback@nokia.com.
    22 ** Nokia at developer.feedback@nokia.com.
    23 **
    23 **
    24 ****************************************************************************/
    24 ****************************************************************************/
    25 
    25 
    26 #include <QDateTime>
    26 #include <QDateTime>
       
    27 #include <QMetaMethod>
    27 
    28 
    28 #include "hblineedit.h"
    29 #include "hblineedit.h"
    29 #include "hbdatetimevalidator_p.h"
    30 #include "hbdatetimevalidator_p.h"
    30 #include "hbdatetimeedit.h"
    31 #include "hbdatetimeedit.h"
    31 #include "hbdatetimeedit_p.h"
    32 #include "hbdatetimeedit_p.h"
       
    33 #include "hbevent.h"
    32 
    34 
    33 /*!
    35 /*!
    34     @alpha
    36     @alpha
    35     @hbwidgets
    37     @hbwidgets
    36     \brief The HbDateTimeEdit class provides a widget for editing dates and times.
    38     \brief The HbDateTimeEdit class provides a widget for editing dates and times.
   231 }
   233 }
   232 
   234 
   233 /*!
   235 /*!
   234     \reimp
   236     \reimp
   235 */
   237 */
   236 void HbDateTimeEdit::focusOutEvent(QFocusEvent *event)
   238 bool HbDateTimeEdit::event(QEvent* event)
   237 {
   239 {
   238     HbAbstractEdit::focusOutEvent(event);
   240     Q_D(HbDateTimeEdit);
   239 
   241 
   240     Q_D(HbDateTimeEdit);
   242     if (event->type() == HbEvent::InputMethodFocusOut) {
   241     if(d->validator->fixDate(&d->cursor, true)) {
   243         d->validator->fixDate(&d->cursor, true);
   242         // fixing so restore focus to editor
       
   243         setFocus(event->reason());
       
   244     }
   244     }
   245 }
   245 
       
   246     return HbLineEdit::event(event);
       
   247 }
       
   248