Skip to content

Commit 7a87228

Browse files
authored
replacing QQuickWindow::sendEvent with QCoreApplication::sendEvent due to its deprecatation (#213)
1 parent 5eb8540 commit 7a87228

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

deflect/qt/QmlStreamerImpl.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const auto renderMode = deflect::qt::RenderMode::MULTITHREADED;
6161
#else
6262
const auto renderMode = deflect::qt::RenderMode::SINGLETHREADED;
6363
#endif
64-
}
64+
} // namespace
6565

6666
namespace deflect
6767
{
@@ -95,9 +95,7 @@ QmlStreamer::Impl::Impl(const QString& qmlFile, const std::string& streamHost,
9595
#endif
9696
}
9797

98-
QmlStreamer::Impl::~Impl()
99-
{
100-
}
98+
QmlStreamer::Impl::~Impl() {}
10199

102100
void QmlStreamer::Impl::_afterRender(const QImage image)
103101
{
@@ -203,7 +201,7 @@ void QmlStreamer::Impl::_send(QKeyEvent& keyEvent_)
203201
{
204202
if (item->hasFocus())
205203
{
206-
_quickView->sendEvent(item, &keyEvent_);
204+
QCoreApplication::instance()->sendEvent(item, &keyEvent_);
207205
if (keyEvent_.isAccepted())
208206
break;
209207
}
@@ -397,5 +395,5 @@ void QmlStreamer::Impl::_sendMouseEvent(const QEvent::Type eventType,
397395
Qt::NoModifier);
398396
QCoreApplication::postEvent(_quickView.get(), e);
399397
}
400-
}
401-
}
398+
} // namespace qt
399+
} // namespace deflect

0 commit comments

Comments
 (0)