Fix thread warning
This commit is contained in:
3 files changed
+15
No files matched your search
@@ -159,6 +159,16 @@ void WebImageResponse::run()
|
||||
QQuickImageResponse *WebImageProvider::requestImageResponse(const QString &id,
|
||||
const QSize &requestedSize)
|
||||
{
|
||||
// Warmup request: pre-creates QQuickPixmapReader on the main thread at
|
||||
// startup so the render thread never creates it first (which would trigger
|
||||
// a "Cannot create children for a parent in a different thread" warning).
|
||||
// Return an empty response immediately — no network request needed.
|
||||
if (id == QLatin1String("__warmup__")) {
|
||||
auto *response = new WebImageResponse(id, 0, requestedSize);
|
||||
QMetaObject::invokeMethod(response, "finished", Qt::QueuedConnection);
|
||||
return response;
|
||||
}
|
||||
|
||||
int displayWidth;
|
||||
{
|
||||
QMutexLocker lock(&m_mutex);
|
||||
|
||||
Reference in new issue
Block a user