mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 12:17:45 +02:00
updated code based on code review
This commit is contained in:
parent
fa7892e5c6
commit
e8589d53dd
1 changed files with 5 additions and 5 deletions
|
@ -1019,15 +1019,15 @@ void OffscreenQmlSurface::synthesizeKeyPress(QString key, QObject* targetOverrid
|
||||||
}
|
}
|
||||||
|
|
||||||
static void forEachKeyboard(QQuickItem* parent, std::function<void(QQuickItem*)> function) {
|
static void forEachKeyboard(QQuickItem* parent, std::function<void(QQuickItem*)> function) {
|
||||||
|
if (!function) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
auto keyboards = parent->findChildren<QObject*>("keyboard");
|
auto keyboards = parent->findChildren<QObject*>("keyboard");
|
||||||
|
|
||||||
for (auto keyboardObject : keyboards) {
|
for (auto keyboardObject : keyboards) {
|
||||||
auto keyboard = qobject_cast<QQuickItem*>(keyboardObject);
|
auto keyboard = qobject_cast<QQuickItem*>(keyboardObject);
|
||||||
if (keyboard == nullptr) {
|
if (keyboard) {
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (function) {
|
|
||||||
function(keyboard);
|
function(keyboard);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue