Fixed warning QObject::connect: No such signal Desktop_QMLTYPE_217::sendToScript(QVariant)

(cherry picked from commit ef4bea2cd4811364e65baec2c48ce2205a0e2cb3)
This commit is contained in:
Vladyslav Stelmakhovskyi 2017-03-31 16:01:43 +02:00
parent 156166ce4a
commit 7318ec468b
2 changed files with 7 additions and 2 deletions

View file

@ -59,7 +59,8 @@ bool OffscreenGLCanvas::create(QOpenGLContext* sharedContext) {
bool OffscreenGLCanvas::makeCurrent() {
bool result = _context->makeCurrent(_offscreenSurface);
Q_ASSERT(result);
//Q_ASSERT(result);
std::call_once(_reportOnce, [this]{
qCDebug(glLogging) << "GL Version: " << QString((const char*) glGetString(GL_VERSION));
qCDebug(glLogging) << "GL Shader Language Version: " << QString((const char*) glGetString(GL_SHADING_LANGUAGE_VERSION));

View file

@ -607,7 +607,11 @@ QObject* OffscreenQmlSurface::finishQmlLoad(std::function<void(QQmlContext*, QOb
return nullptr;
}
connect(newItem, SIGNAL(sendToScript(QVariant)), this, SIGNAL(fromQml(QVariant)));
//check if the item contains sendToScript signal
int sendToScriptIndex = newItem->metaObject()->indexOfSignal("sendToScript");
if (sendToScriptIndex != -1) {
connect(newItem, SIGNAL(sendToScript(QVariant)), this, SIGNAL(fromQml(QVariant)));
}
// The root item is ready. Associate it with the window.
_rootItem = newItem;