112 #if QT_VERSION >= 0x040600 |
112 #if QT_VERSION >= 0x040600 |
113 if (event->type() == QEvent::CloseSoftwareInputPanel) { |
113 if (event->type() == QEvent::CloseSoftwareInputPanel) { |
114 setInputFrameworkFocus(0); |
114 setInputFrameworkFocus(0); |
115 return true; |
115 return true; |
116 } else if (event->type() == QEvent::RequestSoftwareInputPanel) { |
116 } else if (event->type() == QEvent::RequestSoftwareInputPanel) { |
117 if(QWidget * focusedWidget = qApp->focusWidget()) { |
117 if(QWidget * focusedWidget = qApp->focusWidget()) { |
118 // see if the focused widget is graphics view, if so get the focused graphics item in the view |
118 // see if the focused widget is graphics view, if so get the focused graphics item in the view |
119 // and acivate inputmethod for the focused graphics item |
119 // and acivate inputmethod for the focused graphics item |
120 if(QGraphicsView * graphicsView = qobject_cast<QGraphicsView*>(focusedWidget)) { |
120 if (QGraphicsView * graphicsView = qobject_cast<QGraphicsView*>(focusedWidget)) { |
121 if(QGraphicsScene * scene = graphicsView->scene()) { |
121 if (QGraphicsScene * scene = graphicsView->scene()) { |
122 if(QGraphicsItem * focusingWidget = scene->focusItem()) { |
122 if (QGraphicsItem * fItem = scene->focusItem()) { |
123 if (focusingWidget->isWidget()) { |
123 QGraphicsProxyWidget *proxy = qgraphicsitem_cast<QGraphicsProxyWidget *>(fItem); |
124 setInputFrameworkFocus(static_cast<QGraphicsWidget*>(focusingWidget)); |
124 if (proxy) { |
|
125 setInputFrameworkFocus(proxy->widget()->focusWidget()); |
|
126 } else { |
|
127 setInputFrameworkFocus(static_cast<QGraphicsWidget*>(fItem)); |
125 } |
128 } |
126 } |
129 } |
127 } |
130 } |
128 } else { |
131 } else { |
129 // focused wiget is not graphics view, let see if it is native qt editor |
132 // focused wiget is not graphics view, let see if it is native qt editor |