equal
deleted
inserted
replaced
39 #include "hbnamespace_p.h" |
39 #include "hbnamespace_p.h" |
40 #include "hbmainwindow.h" |
40 #include "hbmainwindow.h" |
41 #include "hbevent.h" |
41 #include "hbevent.h" |
42 #include "hbwidget.h" |
42 #include "hbwidget.h" |
43 #include "hbinputmainwindow_p.h" |
43 #include "hbinputmainwindow_p.h" |
44 |
44 #include "hbpopup.h" |
45 /*! |
45 #include "hbpopup_p.h" |
46 @beta |
46 |
|
47 /*! |
|
48 @stable |
47 @hbcore |
49 @hbcore |
48 \class HbInputFocusObject |
50 \class HbInputFocusObject |
49 \brief A helper class for accessing editor widget in abstract way. |
51 \brief A helper class for accessing editor widget in abstract way. |
50 |
52 |
51 This class is input method side API for accessing editor widgets. It hides |
53 This class is input method side API for accessing editor widgets. It hides |
477 |
479 |
478 return 0.0; |
480 return 0.0; |
479 } |
481 } |
480 |
482 |
481 /*! |
483 /*! |
|
484 Returns a priority value for the editor if the editor is inside a popup and |
|
485 in other cases zero is returned. |
|
486 */ |
|
487 quint8 HbInputFocusObject::editorPriority() const |
|
488 { |
|
489 Q_D(const HbInputFocusObject); |
|
490 |
|
491 QGraphicsObject *editorWidget = d->mGraphicsObject; |
|
492 if (!editorWidget) { |
|
493 QWidget *widget = d->mWidget; |
|
494 if (widget) { |
|
495 editorWidget = widget->graphicsProxyWidget(); |
|
496 } |
|
497 } |
|
498 |
|
499 if (editorWidget) { |
|
500 // Check if the editor is inside a popup and if so return the popup priority |
|
501 for (QGraphicsObject *object = editorWidget; object; object = object->parentObject()) { |
|
502 HbPopup *popup = qobject_cast<HbPopup *>(object); |
|
503 if (popup) { |
|
504 return HbPopupPrivate::d_ptr(popup)->priority(); |
|
505 } |
|
506 } |
|
507 } |
|
508 |
|
509 return 0; |
|
510 } |
|
511 |
|
512 /*! |
482 Returns input method hints. See QWidget and QGraphicsItem documentation for more information. |
513 Returns input method hints. See QWidget and QGraphicsItem documentation for more information. |
483 */ |
514 */ |
484 Qt::InputMethodHints HbInputFocusObject::inputMethodHints() const |
515 Qt::InputMethodHints HbInputFocusObject::inputMethodHints() const |
485 { |
516 { |
486 Q_D(const HbInputFocusObject); |
517 Q_D(const HbInputFocusObject); |