-
Notifications
You must be signed in to change notification settings - Fork 24
Closed
Description
Compared to Qt's virtual keyboard, the 'CuteKeyboard' is still visible/active when a focused object is set to invisible ('visible = false').
After looking at the source code and trying things out, I came up with the following solution:
Add a connection to the item and it works as intended.
I don't know whether the connection will remain when the new focused input object is overwritten.
I also add hideInputPanel(); to request if(!AcceptsInput). This means, if a button or other focus-items with non-input-methods will be focus.
In VirtualKeyboardInputContext.cpp in setFocusObject(QObject *object)
// existing code
// ...
bool AcceptsInput = d->FocusItem->inputMethodQuery(Qt::ImEnabled).toBool();
if (!AcceptsInput) {
hideInputPanel(); // Add hide when no acceptable input-items
return;
}
// existing code end
// new Connection
QObject::connect(d->FocusItem, &QQuickItem::visibleChanged, this, [&](){
if(!d->FocusItem->isVisible())
hideInputPanel();
else
showInputPanel();
});
// existing code
emit inputItemChanged();
// ...
// existing code end
Metadata
Metadata
Assignees
Labels
No labels