equal
deleted
inserted
replaced
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" |
233 /*! |
234 /*! |
234 \reimp |
235 \reimp |
235 */ |
236 */ |
236 void HbDateTimeEdit::focusOutEvent(QFocusEvent *event) |
237 void HbDateTimeEdit::focusOutEvent(QFocusEvent *event) |
237 { |
238 { |
238 HbAbstractEdit::focusOutEvent(event); |
239 Q_D(HbDateTimeEdit); |
239 |
240 |
240 Q_D(HbDateTimeEdit); |
|
241 if(d->validator->fixDate(&d->cursor, true)) { |
241 if(d->validator->fixDate(&d->cursor, true)) { |
242 // fixing so restore focus to editor |
242 // fixing so restore focus to editor |
243 setFocus(event->reason()); |
243 // do it asynchronously by private slot: |
|
244 int metodIndex = metaObject()->indexOfMethod("_q_regainFocus()"); |
|
245 if (metodIndex<0) { |
|
246 qWarning("HbDateTimeEdit::focusOutEvent private method " |
|
247 "_q_regainFocus() NOT FOUND"); |
|
248 } else { |
|
249 if (!metaObject()->method(metodIndex).invoke(this, Qt::QueuedConnection)) { |
|
250 qWarning("HbDateTimeEdit::focusOutEvent failed to call " |
|
251 "private method _q_regainFocus()"); |
|
252 } |
|
253 } |
|
254 // prevent emmiting signal editingFinished so omnit HbLineEdit |
|
255 HbAbstractEdit::focusOutEvent(event); |
|
256 } else { |
|
257 HbLineEdit::focusOutEvent(event); |
244 } |
258 } |
245 } |
259 } |