What I would like to archive:
Use QtQuick.Studio.Components in Debug and Release build version in my Application.
Operation system: Windows10
What I did:
I'm using in the Qt QML Application (Community Version) the QtQuick.Studio.Components based on the description I had to build the module manually, because the Project is using qmake instead of cmake.
The build steps are described here:
1 # Qt Design Studio QML modules
2
3 These modules provide the types
4
5 # Usage
6
7 The modules get installed into Qt and provide the respective imports for QML.
8
9 # Building
10
11 ```
12 mkdir build
13 cd build
14 cmake -GNinja -DCMAKE_INSTALL_PREFIX=path_to_qt_install_directory path_to_qtquickdesigner-components_cmake
15 cmake --build .
16 cmake --install .
17 ```
18
19 This will install the Qt Design Studio modules in your Qt installation directory.
My command adjusted to my paths are cmake -GNinja --DCMAKE_INSTALL_PREFIX=C:\Qt\6.4.1\msvc2019_64\ C:\temp\designer2\qtquickdesigner-components
If I build my Application in QtCreator as Debug then I don't get an error message. If I build my Application in QtCreator as Release then I get the error message:
'C:/Qt/6.4.1/msvc2019_64/qml/QtQuick/Studio/Components/quickstudiocomponentsplugind.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)
Questions:
- How I build the plugin as Release and Debug?
- How I have to define the install prefix, because I cannot find a Qt Debug or Qt Release Version in my installation?
CodePudding user response:
You need to build it two times. Unfortunately, there was a bug that pretended reconfiguration.
a fix is here https://codereview.qt-project.org/c/qt-labs/qtquickdesigner-components/ /453366
Note: If you already installed a version, you need to remove the newly generated files at: <path_to_qt_install_directory>/lib/cmake/Qt6Qml/QmlPlugins (sort by date to see which files went into it via your last qtquickdesigner-components build)
cmake -GNinja -DCMAKE_INSTALL_PREFIX=path_to_qt_install_directory -DCMAKE_BUILD_TYPE=Release path_to_qtquickdesigner-components_cmake && cmake --build . && cmake --install .
cmake -GNinja -DCMAKE_INSTALL_PREFIX=path_to_qt_install_directory -DCMAKE_BUILD_TYPE=Debug path_to_qtquickdesigner-components_cmake && cmake --build . && cmake --install .