Qt 6.11 is out! See what's new in the release
blog
QQuickWidget not showing in release build
-
I am having trouble some with my 'release' version. Everything is working fine except for my QQuickWidget, which does not show in the release version. For the debug version it works as expected.
This is my build command for the debug version:
qmake.exe "application.pro" -spec win32-g++ CONFIG+=debug" "CONFIG+=qml_debug" && mingw32-make.exe qmake_allAnd for the release version I have a build command + windeploy command to copy .dll files:
qmake.exe "application.pro" -spec win32-g++ "CONFIG+=qtquickcompiler" && mingw32-make.exe qmake_all windeployqt.exe --release --no-translations --no-patchqt --no-quick-import --no-system-d3d-compiler --no-compiler-runtime --no-webkit2 --no-angle --no-opengl-sw "release path"During initilisation of my main window class I create an instance of a class inheriting QQuickWidget as follows.
mDesignStageView = new WDesignStageView(mUiImt->stageWidget); mUiImt->stageLayout->addWidget(mDesignStageView); mDesignStageView->hide();Constructor of WDesignStageWidget:
WDesignStageView::WDesignStageView(QWidget *parent) : QQuickWidget(parent){ this->setResizeMode(QQuickWidget::SizeRootObjectToView); this->setSource(QUrl("qrc:/ui_designstage.qml")); this->rootContext()->setContextProperty("widget", this); this->rootContext()->setContextProperty("colourPrestudy", this); ... more colour properties }The other functions of WDesignStageView don't do much except changing colours when some conditions are met.
The widget show show together with two QTreeView when clicking on an item in another QTreeView. They do show correctly however.