aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/items/qsgtextinput.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/items/qsgtextinput.cpp')
-rw-r--r--src/declarative/items/qsgtextinput.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/declarative/items/qsgtextinput.cpp b/src/declarative/items/qsgtextinput.cpp
index 222a9002e7..d30faadb34 100644
--- a/src/declarative/items/qsgtextinput.cpp
+++ b/src/declarative/items/qsgtextinput.cpp
@@ -48,8 +48,8 @@
#include <private/qsgdistancefieldglyphcache_p.h>
#include <QtDeclarative/qdeclarativeinfo.h>
-#include <QtGui/qgraphicssceneevent.h>
-#include <QtGui/qinputcontext.h>
+#include <QtWidgets/qgraphicssceneevent.h>
+#include <QtWidgets/qinputcontext.h>
#include <QTextBoundaryFinder>
#include <qstyle.h>
#include <qsgtextnode_p.h>
@@ -888,7 +888,7 @@ void QSGTextInput::setEchoMode(QSGTextInput::EchoMode echo)
Q_D(QSGTextInput);
if (echoMode() == echo)
return;
- d->control->setEchoMode((uint)echo);
+ d->control->setEchoMode((QLineControl::EchoMode)echo);
d->updateInputMethodHints();
q_textChanged();
emit echoModeChanged(echoMode());
@@ -1149,8 +1149,10 @@ void QSGTextInput::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
}
if (!d->showInputPanelOnFocus) { // input panel on click
if (d->focusOnPress && !isReadOnly() && boundingRect().contains(event->pos())) {
- if (canvas() && canvas() == qApp->focusWidget()) {
- qt_widget_private(canvas())->handleSoftwareInputPanel(event->button(), d->clickCausedFocus);
+ if (canvas() && canvas() == QGuiApplication::activeWindow()) {
+ // ### refactor: implement virtual keyboard properly..
+ qDebug("QSGTextInput: virtual keyboard no implemented...");
+// qt_widget_private(canvas())->handleSoftwareInputPanel(event->button(), d->clickCausedFocus);
}
}
}
@@ -1230,7 +1232,6 @@ bool QSGTextInput::event(QEvent* ev)
void QSGTextInput::geometryChanged(const QRectF &newGeometry,
const QRectF &oldGeometry)
{
- Q_D(QSGTextInput);
if (newGeometry.width() != oldGeometry.width()) {
updateSize();
updateCursorRectangle();
@@ -1741,9 +1742,8 @@ void QSGTextInput::moveCursorSelection(int pos, SelectionMode mode)
*/
void QSGTextInput::openSoftwareInputPanel()
{
- QEvent event(QEvent::RequestSoftwareInputPanel);
if (qApp) {
- if (canvas() && canvas() == qApp->focusWidget()) {
+ if (canvas()) {
QEvent event(QEvent::RequestSoftwareInputPanel);
QApplication::sendEvent(canvas(), &event);
}
@@ -1792,7 +1792,7 @@ void QSGTextInput::openSoftwareInputPanel()
void QSGTextInput::closeSoftwareInputPanel()
{
if (qApp) {
- if (canvas() && canvas() == qApp->focusWidget()) {
+ if (canvas()) {
QEvent event(QEvent::CloseSoftwareInputPanel);
QApplication::sendEvent(canvas(), &event);
}
@@ -1816,7 +1816,7 @@ void QSGTextInput::itemChange(ItemChange change, const ItemChangeData &value)
if (change == ItemActiveFocusHasChanged) {
bool hasFocus = value.boolValue;
d->focused = hasFocus;
- setCursorVisible(hasFocus && d->canvas && d->canvas->hasFocus());
+ setCursorVisible(hasFocus); // ### refactor: && d->canvas && d->canvas->hasFocus()
if(echoMode() == QSGTextInput::PasswordEchoOnEdit && !hasFocus)
d->control->updatePasswordEchoEditing(false);//QLineControl sets it on key events, but doesn't deal with focus events
if (!hasFocus)