Unsolved Why does windeployqt copy *all* qml files for all themes
-
So, I did the very basic hello world Qt quick application. New project -> Qt Quick (empty) -> qmake (also tested with cmake). Then I compiled it, fine.
Then I decided to try windeploy qt:
windeployqt --qmldir {path/source/main.qml is} helloworld.exe
Exact command:
C:\Repos\build-helloworld-Desktop_Qt_6_0_2_MSVC2019_64bit-Release\release>"C:\Programas_user\Qt\6.0.2\msvc2019_64\bin\windeployqt.exe" --qmldir "C:\Repos\helloworld" .\helloworld.exe
And it copied lots of stuff, including all the qml files for all the themes (full log at the end).
Is this normal? Why does it happen?
Anyway, here is the code, in case if you want to be reminded:
main.qml
import QtQuick 2.15 import QtQuick.Window 2.15 Window { width: 640 height: 480 visible: true title: qsTr("Hello World") }
main.cpp
#include <QGuiApplication> #include <QQmlApplicationEngine> int main(int argc, char *argv[]) { #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); #endif QGuiApplication app(argc, argv); QQmlApplicationEngine engine; const QUrl url(QStringLiteral("qrc:/main.qml")); QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, &app, [url](QObject *obj, const QUrl &objUrl) { if (!obj && url == objUrl) QCoreApplication::exit(-1); }, Qt::QueuedConnection); engine.load(url); return app.exec(); }
QT += quick CONFIG += c++11 # You can make your code fail to compile if it uses deprecated APIs. # In order to do so, uncomment the following line. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 SOURCES += \ main.cpp RESOURCES += qml.qrc # Additional import path used to resolve QML modules in Qt Creator's code model QML_IMPORT_PATH = # Additional import path used to resolve QML modules just for Qt Quick Designer QML_DESIGNER_IMPORT_PATH = # Default rules for deployment. qnx: target.path = /tmp/$${TARGET}/bin else: unix:!android: target.path = /opt/$${TARGET}/bin !isEmpty(target.path): INSTALLS += target
And this is what
windeployqt
generated (tree /f
on Windows):│ D3Dcompiler_47.dll │ helloworld.exe │ opengl32sw.dll │ Qt6Core.dll │ Qt6Gui.dll │ Qt6Network.dll │ Qt6OpenGL.dll │ Qt6Qml.dll │ Qt6QmlModels.dll │ Qt6QmlWorkerScript.dll │ Qt6Quick.dll │ Qt6QuickControls2.dll │ Qt6QuickControls2Impl.dll │ Qt6QuickParticles.dll │ Qt6QuickShapes.dll │ Qt6QuickTemplates2.dll │ Qt6Sql.dll │ Qt6Svg.dll │ ├───iconengines │ qsvgicon.dll │ ├───imageformats │ qgif.dll │ qico.dll │ qjpeg.dll │ qsvg.dll │ ├───platforms │ qwindows.dll │ ├───qmltooling │ qmldbg_debugger.dll │ qmldbg_inspector.dll │ qmldbg_local.dll │ qmldbg_messages.dll │ qmldbg_native.dll │ qmldbg_nativedebugger.dll │ qmldbg_preview.dll │ qmldbg_profiler.dll │ qmldbg_quickprofiler.dll │ qmldbg_server.dll │ qmldbg_tcp.dll │ ├───QtQml │ │ plugins.qmltypes │ │ qmldir │ │ qmlplugin.dll │ │ │ ├───Models │ │ modelsplugin.dll │ │ plugins.qmltypes │ │ qmldir │ │ │ └───WorkerScript │ plugins.qmltypes │ qmldir │ workerscriptplugin.dll │ ├───QtQuick │ │ plugins.qmltypes │ │ qmldir │ │ qtquick2plugin.dll │ │ │ ├───Controls │ │ │ plugins.qmltypes │ │ │ qmldir │ │ │ qtquickcontrols2plugin.dll │ │ │ │ │ ├───Basic │ │ │ │ AbstractButton.qml │ │ │ │ Action.qml │ │ │ │ ActionGroup.qml │ │ │ │ ApplicationWindow.qml │ │ │ │ BusyIndicator.qml │ │ │ │ Button.qml │ │ │ │ ButtonGroup.qml │ │ │ │ CheckBox.qml │ │ │ │ CheckDelegate.qml │ │ │ │ ComboBox.qml │ │ │ │ Container.qml │ │ │ │ Control.qml │ │ │ │ DelayButton.qml │ │ │ │ Dial.qml │ │ │ │ Dialog.qml │ │ │ │ DialogButtonBox.qml │ │ │ │ Drawer.qml │ │ │ │ Frame.qml │ │ │ │ GroupBox.qml │ │ │ │ HorizontalHeaderView.qml │ │ │ │ ItemDelegate.qml │ │ │ │ Label.qml │ │ │ │ Menu.qml │ │ │ │ MenuBar.qml │ │ │ │ MenuBarItem.qml │ │ │ │ MenuItem.qml │ │ │ │ MenuSeparator.qml │ │ │ │ Page.qml │ │ │ │ PageIndicator.qml │ │ │ │ Pane.qml │ │ │ │ Popup.qml │ │ │ │ ProgressBar.qml │ │ │ │ qmldir │ │ │ │ qtquickcontrols2basicstyleplugin.dll │ │ │ │ RadioButton.qml │ │ │ │ RadioDelegate.qml │ │ │ │ RangeSlider.qml │ │ │ │ RoundButton.qml │ │ │ │ ScrollBar.qml │ │ │ │ ScrollIndicator.qml │ │ │ │ ScrollView.qml │ │ │ │ Slider.qml │ │ │ │ SpinBox.qml │ │ │ │ SplitView.qml │ │ │ │ StackView.qml │ │ │ │ SwipeDelegate.qml │ │ │ │ SwipeView.qml │ │ │ │ Switch.qml │ │ │ │ SwitchDelegate.qml │ │ │ │ TabBar.qml │ │ │ │ TabButton.qml │ │ │ │ TextArea.qml │ │ │ │ TextField.qml │ │ │ │ ToolBar.qml │ │ │ │ ToolButton.qml │ │ │ │ ToolSeparator.qml │ │ │ │ ToolTip.qml │ │ │ │ Tumbler.qml │ │ │ │ VerticalHeaderView.qml │ │ │ │ │ │ │ └───impl │ │ │ plugins.qmltypes │ │ │ qmldir │ │ │ qtquickcontrols2basicstyleimplplugin.dll │ │ │ │ │ ├───Fusion │ │ │ │ ApplicationWindow.qml │ │ │ │ BusyIndicator.qml │ │ │ │ Button.qml │ │ │ │ CheckBox.qml │ │ │ │ CheckDelegate.qml │ │ │ │ ComboBox.qml │ │ │ │ DelayButton.qml │ │ │ │ Dial.qml │ │ │ │ Dialog.qml │ │ │ │ DialogButtonBox.qml │ │ │ │ Drawer.qml │ │ │ │ Frame.qml │ │ │ │ GroupBox.qml │ │ │ │ HorizontalHeaderView.qml │ │ │ │ ItemDelegate.qml │ │ │ │ Label.qml │ │ │ │ Menu.qml │ │ │ │ MenuBar.qml │ │ │ │ MenuBarItem.qml │ │ │ │ MenuItem.qml │ │ │ │ MenuSeparator.qml │ │ │ │ Page.qml │ │ │ │ PageIndicator.qml │ │ │ │ Pane.qml │ │ │ │ Popup.qml │ │ │ │ ProgressBar.qml │ │ │ │ qmldir │ │ │ │ qtquickcontrols2fusionstyleplugin.dll │ │ │ │ RadioButton.qml │ │ │ │ RadioDelegate.qml │ │ │ │ RangeSlider.qml │ │ │ │ RoundButton.qml │ │ │ │ ScrollBar.qml │ │ │ │ ScrollIndicator.qml │ │ │ │ ScrollView.qml │ │ │ │ Slider.qml │ │ │ │ SpinBox.qml │ │ │ │ SplitView.qml │ │ │ │ SwipeDelegate.qml │ │ │ │ Switch.qml │ │ │ │ SwitchDelegate.qml │ │ │ │ TabBar.qml │ │ │ │ TabButton.qml │ │ │ │ TextArea.qml │ │ │ │ TextField.qml │ │ │ │ ToolBar.qml │ │ │ │ ToolButton.qml │ │ │ │ ToolSeparator.qml │ │ │ │ ToolTip.qml │ │ │ │ Tumbler.qml │ │ │ │ VerticalHeaderView.qml │ │ │ │ │ │ │ └───impl │ │ │ ButtonPanel.qml │ │ │ CheckIndicator.qml │ │ │ plugins.qmltypes │ │ │ qmldir │ │ │ qtquickcontrols2fusionstyleimplplugin.dll │ │ │ RadioIndicator.qml │ │ │ SliderGroove.qml │ │ │ SliderHandle.qml │ │ │ SwitchIndicator.qml │ │ │ │ │ ├───Imagine │ │ │ │ ApplicationWindow.qml │ │ │ │ BusyIndicator.qml │ │ │ │ Button.qml │ │ │ │ CheckBox.qml │ │ │ │ CheckDelegate.qml │ │ │ │ ComboBox.qml │ │ │ │ DelayButton.qml │ │ │ │ Dial.qml │ │ │ │ Dialog.qml │ │ │ │ DialogButtonBox.qml │ │ │ │ Drawer.qml │ │ │ │ Frame.qml │ │ │ │ GroupBox.qml │ │ │ │ HorizontalHeaderView.qml │ │ │ │ ItemDelegate.qml │ │ │ │ Label.qml │ │ │ │ Menu.qml │ │ │ │ MenuItem.qml │ │ │ │ MenuSeparator.qml │ │ │ │ Page.qml │ │ │ │ PageIndicator.qml │ │ │ │ Pane.qml │ │ │ │ Popup.qml │ │ │ │ ProgressBar.qml │ │ │ │ qmldir │ │ │ │ qtquickcontrols2imaginestyleplugin.dll │ │ │ │ RadioButton.qml │ │ │ │ RadioDelegate.qml │ │ │ │ RangeSlider.qml │ │ │ │ RoundButton.qml │ │ │ │ ScrollBar.qml │ │ │ │ ScrollIndicator.qml │ │ │ │ ScrollView.qml │ │ │ │ Slider.qml │ │ │ │ SpinBox.qml │ │ │ │ SplitView.qml │ │ │ │ StackView.qml │ │ │ │ SwipeDelegate.qml │ │ │ │ SwipeView.qml │ │ │ │ Switch.qml │ │ │ │ SwitchDelegate.qml │ │ │ │ TabBar.qml │ │ │ │ TabButton.qml │ │ │ │ TextArea.qml │ │ │ │ TextField.qml │ │ │ │ ToolBar.qml │ │ │ │ ToolButton.qml │ │ │ │ ToolSeparator.qml │ │ │ │ ToolTip.qml │ │ │ │ Tumbler.qml │ │ │ │ VerticalHeaderView.qml │ │ │ │ │ │ │ └───impl │ │ │ OpacityMask.qml │ │ │ plugins.qmltypes │ │ │ qmldir │ │ │ qtquickcontrols2imaginestyleimplplugin.dll │ │ │ │ │ ├───impl │ │ │ plugins.qmltypes │ │ │ qmldir │ │ │ qtquickcontrols2implplugin.dll │ │ │ │ │ ├───Material │ │ │ │ ApplicationWindow.qml │ │ │ │ BusyIndicator.qml │ │ │ │ Button.qml │ │ │ │ CheckBox.qml │ │ │ │ CheckDelegate.qml │ │ │ │ ComboBox.qml │ │ │ │ DelayButton.qml │ │ │ │ Dial.qml │ │ │ │ Dialog.qml │ │ │ │ DialogButtonBox.qml │ │ │ │ Drawer.qml │ │ │ │ Frame.qml │ │ │ │ GroupBox.qml │ │ │ │ HorizontalHeaderView.qml │ │ │ │ ItemDelegate.qml │ │ │ │ Label.qml │ │ │ │ Menu.qml │ │ │ │ MenuBar.qml │ │ │ │ MenuBarItem.qml │ │ │ │ MenuItem.qml │ │ │ │ MenuSeparator.qml │ │ │ │ Page.qml │ │ │ │ PageIndicator.qml │ │ │ │ Pane.qml │ │ │ │ Popup.qml │ │ │ │ ProgressBar.qml │ │ │ │ qmldir │ │ │ │ qtquickcontrols2materialstyleplugin.dll │ │ │ │ RadioButton.qml │ │ │ │ RadioDelegate.qml │ │ │ │ RangeSlider.qml │ │ │ │ RoundButton.qml │ │ │ │ ScrollBar.qml │ │ │ │ ScrollIndicator.qml │ │ │ │ ScrollView.qml │ │ │ │ Slider.qml │ │ │ │ SpinBox.qml │ │ │ │ SplitView.qml │ │ │ │ StackView.qml │ │ │ │ SwipeDelegate.qml │ │ │ │ SwipeView.qml │ │ │ │ Switch.qml │ │ │ │ SwitchDelegate.qml │ │ │ │ TabBar.qml │ │ │ │ TabButton.qml │ │ │ │ TextArea.qml │ │ │ │ TextField.qml │ │ │ │ ToolBar.qml │ │ │ │ ToolButton.qml │ │ │ │ ToolSeparator.qml │ │ │ │ ToolTip.qml │ │ │ │ Tumbler.qml │ │ │ │ VerticalHeaderView.qml │ │ │ │ │ │ │ └───impl │ │ │ BoxShadow.qml │ │ │ CheckIndicator.qml │ │ │ CursorDelegate.qml │ │ │ ElevationEffect.qml │ │ │ plugins.qmltypes │ │ │ qmldir │ │ │ qtquickcontrols2materialstyleimplplugin.dll │ │ │ RadioIndicator.qml │ │ │ RectangularGlow.qml │ │ │ SliderHandle.qml │ │ │ SwitchIndicator.qml │ │ │ │ │ ├───Universal │ │ │ │ ApplicationWindow.qml │ │ │ │ BusyIndicator.qml │ │ │ │ Button.qml │ │ │ │ CheckBox.qml │ │ │ │ CheckDelegate.qml │ │ │ │ ComboBox.qml │ │ │ │ DelayButton.qml │ │ │ │ Dial.qml │ │ │ │ Dialog.qml │ │ │ │ DialogButtonBox.qml │ │ │ │ Drawer.qml │ │ │ │ Frame.qml │ │ │ │ GroupBox.qml │ │ │ │ HorizontalHeaderView.qml │ │ │ │ ItemDelegate.qml │ │ │ │ Label.qml │ │ │ │ Menu.qml │ │ │ │ MenuBar.qml │ │ │ │ MenuBarItem.qml │ │ │ │ MenuItem.qml │ │ │ │ MenuSeparator.qml │ │ │ │ Page.qml │ │ │ │ PageIndicator.qml │ │ │ │ Pane.qml │ │ │ │ Popup.qml │ │ │ │ ProgressBar.qml │ │ │ │ qmldir │ │ │ │ qtquickcontrols2universalstyleplugin.dll │ │ │ │ RadioButton.qml │ │ │ │ RadioDelegate.qml │ │ │ │ RangeSlider.qml │ │ │ │ RoundButton.qml │ │ │ │ ScrollBar.qml │ │ │ │ ScrollIndicator.qml │ │ │ │ ScrollView.qml │ │ │ │ Slider.qml │ │ │ │ SpinBox.qml │ │ │ │ SplitView.qml │ │ │ │ StackView.qml │ │ │ │ SwipeDelegate.qml │ │ │ │ Switch.qml │ │ │ │ SwitchDelegate.qml │ │ │ │ TabBar.qml │ │ │ │ TabButton.qml │ │ │ │ TextArea.qml │ │ │ │ TextField.qml │ │ │ │ ToolBar.qml │ │ │ │ ToolButton.qml │ │ │ │ ToolSeparator.qml │ │ │ │ ToolTip.qml │ │ │ │ Tumbler.qml │ │ │ │ VerticalHeaderView.qml │ │ │ │ │ │ │ └───impl │ │ │ CheckIndicator.qml │ │ │ plugins.qmltypes │ │ │ qmldir │ │ │ qtquickcontrols2universalstyleimplplugin.dll │ │ │ RadioIndicator.qml │ │ │ SwitchIndicator.qml │ │ │ │ │ └───Windows │ │ Button.qml │ │ CheckBox.qml │ │ ComboBox.qml │ │ Frame.qml │ │ GroupBox.qml │ │ plugins.qmltypes │ │ ProgressBar.qml │ │ qmldir │ │ qtquickcontrols2windowsstyleplugin.dll │ │ RadioButton.qml │ │ ScrollBar.qml │ │ ScrollView.qml │ │ Slider.qml │ │ SpinBox.qml │ │ TextArea.qml │ │ TextField.qml │ │ │ ├───Layouts │ │ plugins.qmltypes │ │ qmldir │ │ qquicklayoutsplugin.dll │ │ │ ├───LocalStorage │ │ plugins.qmltypes │ │ qmldir │ │ qmllocalstorageplugin.dll │ │ │ ├───NativeStyle │ │ │ plugins.qmltypes │ │ │ qmldir │ │ │ qtquickcontrols2nativestyleplugin.dll │ │ │ │ │ └───controls │ │ DefaultButton.qml │ │ DefaultCheckBox.qml │ │ DefaultComboBox.qml │ │ DefaultDial.qml │ │ DefaultFrame.qml │ │ DefaultGroupBox.qml │ │ DefaultProgressBar.qml │ │ DefaultRadioButton.qml │ │ DefaultScrollBar.qml │ │ DefaultSlider.qml │ │ DefaultSpinBox.qml │ │ DefaultTextArea.qml │ │ DefaultTextField.qml │ │ │ ├───Particles │ │ particlesplugin.dll │ │ plugins.qmltypes │ │ qmldir │ │ │ ├───Shapes │ │ plugins.qmltypes │ │ qmldir │ │ qmlshapesplugin.dll │ │ │ ├───Templates │ │ plugins.qmltypes │ │ qmldir │ │ qtquicktemplates2plugin.dll │ │ │ ├───tooling │ │ Component.qml │ │ Enum.qml │ │ Member.qml │ │ Method.qml │ │ Module.qml │ │ Parameter.qml │ │ plugins.qmltypes │ │ Property.qml │ │ qmldir │ │ quicktooling.dll │ │ Signal.qml │ │ │ └───Window │ plugins.qmltypes │ qmldir │ quickwindow.dll │ ├───sqldrivers │ qsqlite.dll │ qsqlodbc.dll │ qsqlpsql.dll │ └───translations qt_ar.qm qt_bg.qm qt_ca.qm qt_cs.qm qt_da.qm qt_de.qm qt_en.qm qt_es.qm qt_fa.qm qt_fi.qm qt_fr.qm qt_gd.qm qt_he.qm qt_hr.qm qt_hu.qm qt_it.qm qt_ja.qm qt_ko.qm qt_lv.qm qt_nl.qm qt_nn.qm qt_pl.qm qt_pt_BR.qm qt_ru.qm qt_sk.qm qt_tr.qm qt_uk.qm qt_zh_CN.qm qt_zh_TW.qm
-
@LordKalma said in Why does windeployqt copy *all* qml files for all themes:
And it copied lots of stuff, including all the qml files for all the themes (full log at the end).
Is this normal? Why does it happen?
windeployqt
errs on the side of caution. It wants to make sure that your app can be run on another PC. As a result, it copies more than necessary.I guess it's possible for the Qt engineers to improve it and make it smarter -- to scan your code to figure out what your app actually needs -- but that's a bit hard to do and nobody has done it yet.
You can try the technique described at the end of https://wiki.qt.io/Deploy_an_Application_on_Windows ("Final deployment (Cleaned up)") to get rid of unneeded files.