diff --git a/src/designviewer.cpp b/src/designviewer.cpp index 11a9446ff7de4feaf1fa6601a5dcfab603de6a8a..63f48d424d056e8c9f5bc53d315c6473bf96da09 100644 --- a/src/designviewer.cpp +++ b/src/designviewer.cpp @@ -323,10 +323,10 @@ void DesignViewer::showAppWindow() qDebug() << "Setting the QML app window size"; if (size.isEmpty()) { qDebug() << "Setting the QML app window size to 100%"; - qtContainerStyle.set("width", std::string("100%")); - // qtContainerStyle.set("height", - // std::string( - // "100%")); // ### FIXME: 100% height gives 0px height for some reason + qtContainerStyle.set("width", std::string("100vw")); + qtContainerStyle.set("height", + std::string( + "100vh")); // ### FIXME: 100% height gives 0px height for some reason } else { qDebug() << "Setting the QML app window size to " + QString("%1x%2").arg(size.width()).arg(size.height()); @@ -339,15 +339,15 @@ void DesignViewer::showAppWindow() // Make Qt pick up the new container size by calling the resizeCanvasElement() // qtloader API. This needs to be done on delay after initial setup to make // sure qtloader is initialized. - QTimer::singleShot(0, [&]() { - emscripten::val instance = emscripten::val::global("instance"); - if (instance.isNull()) { - qCritical()<<"instance is null"; - return; - } - instance.call<void>("qtResizeContainerElement", qtContainer); - qDebug() << "QML app window position set"; - }); + // QTimer::singleShot(0, [&]() { + // emscripten::val instance = emscripten::val::global("instance"); + // if (instance.isNull()) { + // qCritical()<<"instance is null"; + // return; + // } + // instance.call<void>("qtResizeContainerElement", qtContainer); + // qDebug() << "QML app window position set"; + // }); qDebug() << "Showing the QML app window"; m_quickWindow->show(); }