ask for on screen keyboard hiding on focus lost

This commit is contained in:
Marco Martin 2011-02-17 15:21:07 +01:00
parent 3924d218a4
commit 17c0805063
4 changed files with 46 additions and 0 deletions

View File

@ -20,6 +20,7 @@
#include "combobox.h"
#include <QPainter>
#include <QGraphicsView>
#include <kcombobox.h>
#include <kiconeffect.h>
@ -276,6 +277,18 @@ void ComboBox::focusOutEvent(QFocusEvent *event)
if (applet) {
applet->setStatus(Plasma::UnknownStatus);
}
if (nativeWidget()->isEditable()) {
QEvent closeEvent(QEvent::CloseSoftwareInputPanel);
if (qApp) {
if (QGraphicsView *view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
if (view->scene() && view->scene() == scene()) {
QApplication::sendEvent(view, &closeEvent);
}
}
}
}
QGraphicsProxyWidget::focusOutEvent(event);
}

View File

@ -22,6 +22,7 @@
#include <QGraphicsSceneResizeEvent>
#include <QIcon>
#include <QPainter>
#include <QGraphicsView>
#include <klineedit.h>
#include <kmimetype.h>
@ -203,6 +204,16 @@ void LineEdit::focusOutEvent(QFocusEvent *event)
if (applet) {
applet->setStatus(Plasma::UnknownStatus);
}
QEvent closeEvent(QEvent::CloseSoftwareInputPanel);
if (qApp) {
if (QGraphicsView *view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
if (view->scene() && view->scene() == scene()) {
QApplication::sendEvent(view, &closeEvent);
}
}
}
QGraphicsProxyWidget::focusOutEvent(event);
}

View File

@ -22,6 +22,7 @@
#include <QPainter>
#include <QStyleOptionSpinBox>
#include <QGraphicsView>
#include <kmimetype.h>
#include <knuminput.h>
@ -209,6 +210,16 @@ void SpinBox::focusOutEvent(QFocusEvent *event)
if (applet) {
applet->setStatus(Plasma::UnknownStatus);
}
QEvent closeEvent(QEvent::CloseSoftwareInputPanel);
if (qApp) {
if (QGraphicsView *view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
if (view->scene() && view->scene() == scene()) {
QApplication::sendEvent(view, &closeEvent);
}
}
}
QGraphicsProxyWidget::focusOutEvent(event);
}

View File

@ -23,6 +23,7 @@
#include <QMenu>
#include <QPainter>
#include <QScrollBar>
#include <QGraphicsView>
#include <kmimetype.h>
#include <ktextedit.h>
@ -188,6 +189,16 @@ void TextEdit::focusOutEvent(QFocusEvent *event)
if (applet) {
applet->setStatus(Plasma::UnknownStatus);
}
QEvent closeEvent(QEvent::CloseSoftwareInputPanel);
if (qApp) {
if (QGraphicsView *view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
if (view->scene() && view->scene() == scene()) {
QApplication::sendEvent(view, &closeEvent);
}
}
}
QGraphicsProxyWidget::focusOutEvent(event);
}