Skip to content
Snippets Groups Projects
Commit 04306fcd authored by Vic Nguyen's avatar Vic Nguyen :ghost:
Browse files

more testing

parent b74e9565
No related branches found
No related tags found
No related merge requests found
Pipeline #75121 passed
...@@ -323,10 +323,10 @@ void DesignViewer::showAppWindow() ...@@ -323,10 +323,10 @@ void DesignViewer::showAppWindow()
qDebug() << "Setting the QML app window size"; qDebug() << "Setting the QML app window size";
if (size.isEmpty()) { if (size.isEmpty()) {
qDebug() << "Setting the QML app window size to 100%"; qDebug() << "Setting the QML app window size to 100%";
qtContainerStyle.set("width", std::string("100%")); qtContainerStyle.set("width", std::string("100vw"));
// qtContainerStyle.set("height", qtContainerStyle.set("height",
// std::string( std::string(
// "100%")); // ### FIXME: 100% height gives 0px height for some reason "100vh")); // ### FIXME: 100% height gives 0px height for some reason
} else { } else {
qDebug() << "Setting the QML app window size to " qDebug() << "Setting the QML app window size to "
+ QString("%1x%2").arg(size.width()).arg(size.height()); + QString("%1x%2").arg(size.width()).arg(size.height());
...@@ -339,15 +339,15 @@ void DesignViewer::showAppWindow() ...@@ -339,15 +339,15 @@ void DesignViewer::showAppWindow()
// Make Qt pick up the new container size by calling the resizeCanvasElement() // 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 // qtloader API. This needs to be done on delay after initial setup to make
// sure qtloader is initialized. // sure qtloader is initialized.
QTimer::singleShot(0, [&]() { // QTimer::singleShot(0, [&]() {
emscripten::val instance = emscripten::val::global("instance"); // emscripten::val instance = emscripten::val::global("instance");
if (instance.isNull()) { // if (instance.isNull()) {
qCritical()<<"instance is null"; // qCritical()<<"instance is null";
return; // return;
} // }
instance.call<void>("qtResizeContainerElement", qtContainer); // instance.call<void>("qtResizeContainerElement", qtContainer);
qDebug() << "QML app window position set"; // qDebug() << "QML app window position set";
}); // });
qDebug() << "Showing the QML app window"; qDebug() << "Showing the QML app window";
m_quickWindow->show(); m_quickWindow->show();
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment