Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/VirtualKeyboardInputContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ void VirtualKeyboardInputContext::setFocusObject(QObject *object) {
Qt::ImhTime |
Qt::ImhFormattedNumbersOnly;

QObject::disconnect(visibleConnection);

if (!object) {
return;
}
Expand Down Expand Up @@ -141,12 +143,12 @@ void VirtualKeyboardInputContext::setFocusObject(QObject *object) {
}
}

visibleConnection = std::make_shared<QMetaObject::Connection>(QObject::connect(d->FocusItem, &QQuickItem::visibleChanged, this, [&](){
visibleConnection = QObject::connect(d->FocusItem, &QQuickItem::visibleChanged, this, [&](){
if(!d->FocusItem->isVisible())
hideInputPanel();
else
showInputPanel();
}));
});

emit inputItemChanged();

Expand Down
3 changes: 1 addition & 2 deletions src/VirtualKeyboardInputContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

#include <QRectF>
#include <QPointer>
#include <memory.h>

class QQmlEngine;
class QJSEngine;
Expand Down Expand Up @@ -146,7 +145,7 @@ class VirtualKeyboardInputContext : public QPlatformInputContext {
private:
VirtualKeyboardInputContextPrivate *d;
QPointer<QObject> inputPanel;
std::shared_ptr<QMetaObject::Connection> visibleConnection;
QMetaObject::Connection visibleConnection;
};

#endif // VIRTUALKEYBOARDINPUTCONTEXT_H