"QtQuick" plugin "qtquick2plugin" not found in MacOS C++ app using Qt5.15.2
-
@franzhelmut I did this exactly the same way on 2 separate computers, one being a new Mac mini with M1 chip running Big Sur, and a MacPro running Mojave, same results.
-
Did you try to run macdeployqt with more verbosity to see if it's complaining about something related to that module ?
-
How are you doing your imports ?
Can you provide a minimal compilable example that shows this behaviour ? -
@franzhelmut my main.qml has these imports:
import QtQuick 2.7
import QtQuick.Window 2.2
import QtQml.Models 2.1
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import QtQuick.Layouts 1.3
import QtGraphicalEffects 1.0
import QtQuick.XmlListModel 2.0
import Qt.labs.settings 1.0in my working 2.7 version I have a quick folder inside of a Plugins folder with delis for each of these, in my 2.15 Plugins I have no quick folder.
I now collected the equivalent dylibs from 5.15.2 and put them in a quick folder inside of Plugins. Now I don't get any complaints about missing components, but I get this:
QQmlApplicationEngine failed to load component
qrc:/qml/main.qml:1080:5: Type FrontPage unavailableFrontPage is a major QML component in my main.qml
On Windows 10 I do get all the components from the deployment, but I also don't get any user interface when I run the application.
So I am guessing something changed in a fundamental way with QML from version 5.7 to 5.15 -
what I also wanted to mention is that in Debug mode everything works as it should, that would indicate to me that the code is correct
-
IIRC, at least on Windows you can pass additional modules to deploy. Did you try that ?
-
Do you have the same issue with a small default application ?
If not, then, add new modules until you find the one that makes things fall appart, that will help pinpoint issue.
-
What did you do on Windows to make it work ?
-
@SGaist nothing at all, I remember my window positions in the settings and restore them. Unfortunately I had removed the monitor that my window had been on and didn't properly handle that in the code. So removing my Regedit entries brought everything back.
-
Sorry, I thought you were saying the installer issue was fixed.
Hence my request to reproduce your issue with a minimal example, that will allow to check what is going on on macOS.
-
I've gotten the same problem with my static build of Qt 5.15.2.
The solution in my case (using CMake) was to call qt5_import_qml_plugins:
get_target_property(QT_TARGET_TYPE Qt5::Core TYPE) if(${QT_TARGET_TYPE} STREQUAL "STATIC_LIBRARY") find_package(Qt5QmlImportScanner REQUIRED) qt5_import_qml_plugins(${CMAKE_PROJECT_NAME}) endif()
Not sure what is the equivalent in Qt 6, haven't tested it myself and can't find
qt6_import_qml_plugins
in documentation.Anyway,
qt5_import_qml_plugins
is available only from Qt 5.14(?), so for older versions the alternative would be this external module.