QML on iOS QtQuick.Controls 2.x not installed - cmake

I created an application with Qt5.9.3 on iOS 12 and in a qml file, I use a SwipeView so I need:
import QtQuick 2.7 // also test 2.9
import QtQuick.Controls 2.0 // also test 2.1, 2.2
But I keep having the error:
module "QtQuick.Controls" version 2.0 is not installed
In my cmake file, I added the specific modules Quick and QuickControls2, the lib are installed with Qt5.9.3, so I have:
set( MY_QT_MODULES Core Gui Qml Quick QuickControls2 all/modules/I/need)
find_package( Qt5 PATHS my/path/to/Qt COMPONENTS $(MY_QT_MODULES) )
What is missing in that? Thanks.

I had to add
Q_IMPORT_PLUGIN(QtQuickControls2Plugin)
in the main.cpp.

Related

QT5: QTQuick.Controls version 2.12 is not found

My Qt application is failing to start with the following error:
module "QtQuick.Controls" version 2.12 is not installed
My platform is Ubuntu 20.04.2 LTS. This is a well-known error on StackOverflow. Unfortunately, no answers have worked for me this far. I have exhausted all suggested remedies without any improvement. These are enumerated below:
Checking compatibility of Qt with QuickControls: I am using Qt 5.12.8 in QtCreator, and QtCreator 4.11.0. I installed Qt using sudo apt install qt5 default and sudo apt-get install qtcreator. According to the documentation (see here, Qt 5.12 is directly compatible with QtQuick 2.12:
Checking if I specified QtQuick as a dependency: In my .pro file, I have added QT += quick qml quickcontrols2
Checking if I have the right libraries: I have qtquickcontrols2-5-dev, qt5declarative5-dev, and qml-module-qtquick-controls. Furthermore, apt-cache search qtquick shows me that all the qtquick modules are there
Re-installing qtcreator: Some questions suggest re-installing QtCreator. I have tried this, but it had no effect
QML Emulation layer: I have configured my project to "Use QML emulation layer that is built with the selected Qt". However, this also had no effect
Having performed every one of these steps, and exhausted all StackOverflow questions and Github threads related to the topic, I still cannot find what is causing this issue.
I have additionally included some related questions that I've tried. Question 4 is perhaps the closest to mine, but was solved via the Yocto build system that I am not using:
import QtQuick.Controls 2.1 QML MODULE NOT FOUND
Error module "QtQuick" version 2.12 is not installed
Ubuntu QT install qt quick controls 2.1
Qt - Module "QtQuick.Controls" is not installed
I would be extremely appreciative of any advice on further resolving this matter.
You are missing the qml module for controls 2 because you have installed qml-module-qtquick-controls instead of qml-module-qtquick-controls2.
The QML engine will look for a module inside the path from QML2_IMPORT_PATH, by following the namespaces, so in this case QML2_IMPORT_PATH/QtQuick/Controls and QML2_IMPORT_PATH/QtQuick/Controls.2 (see version semantics documentation ). If in these folders it finds a qmldir file, it will parse it and look for any component that has at least 2 as major and something lower or equal to 12 as minor (allthough this particular qmldir doesn't state any components... it probably also reads the libqtquickcontrols2plugin.so or plugin.qmltypes)

How to solve module ""QtQuick.Controls" version 2.0 is not installed" on mac

I've been getting the error "module "QtQuick.Controls" version 2.0 is not installed" on Qt Creator 5.6.13, so i upgraded to 5.11.2 and i'm still getting it.
Here's the part causing it:
import QtQuick.Controls 2.0
Thank you for your help.
use this command to install it on linux
sudo apt install qml-module-qtquick-controls2
Make sure you activated your Qt kit in Projects > Build & Run as follow:
Ok so, I was building with the Qt Creator 5.6.3 compiler.
Projects => Build & Run => change to the corresponding kit.

Module "QtQuick.Controls" is not installed on Raspberry Pi

I'm trying to compile some qml on a Raspberry pi 3 running Raspbian-Jessie using qt5 (5.3.2).
I managed to run some simple stuff but now I need to use QtQuick.Controls so I added
import QtQuick.Controls 1.0 to my qml file but when I try to run it, I get this error message: module "QtQuick.Controls" is not installed
Qt is installed in the following folder /usr/lib/arm-linux-gnueabihf/qt5/ (it's auto detected) so I went there and found that QtQuick Controls is actually in there (in [path to qt]/qml/QtQuick/Controls)
Do I need to do something to actually install it ?
I tried to add /usr/lib/arm-linux-gnueabihf/qt5/qml/QtQuick/Controls to QML_IMPORT_PATH but I still get the error message.
I also read that I need QtQuick 2.0 for QtQuick.Controls to work but when I change import QtQuick 1.0 to import QtQuick 2.0 I get a module "QtQuick" version 2.0 is not installed
Anyone managed to use QtQuick.Controls on Raspberry Pi ?
Any advice on how to debug this ?
Dependencies for QML in Raspbian are somewhat confusing. Try checking if you have these packages installed, using apt-get install, or apt-cache search first to see what every single package does:
qtdeclarative5-*
qml-module-qtquick*
qtquick1-*
qtquickcontrols5-*
qml-module-qtquick2
After that, Qt Creator should compile without problems.

[vtk filters into blender

I'm trying to import vtk into Blender to use specific filters. I'm facing some difficulties since Blender is not able to find, and subsequently to use any filter.
Here is the situation:
I've build VTK including the python wrapping. I have DLLs and *.py libraries.
I have created PYTHONPATH and added both Wrapping\python and VTK\Release directories. Python 2.7 has been used to generate *.py VTK libraries. The python 3.4 interpreter (and blender since my version is using a python V3.4 distribution) is able to import the vtk library but gives me an error "Import error: Dynamic module does not define init function(PyInit_vtkCommonCorePython)"
I'm very pessimistic because VTK has been built using python 2.7 and blender uses python 3.4. Python 3.4 canno find the suitable DLL corresponding to the .py since VTK dlls are named "vtkLIBxxx27D-6.1.dll" and specifically dedicated for python 2.7.
Is there a way to force a backward compatibility to blender and its python interpreter to import a python 2.7 library?
Do we have any chance to make vtk (python 2.7) working into blender (python 3.4)?
Thanks for your help.
Laurent.
Blender 2.6 uses Python 3+, while VTK is wrapped for 2.7. The two APIs are incompatible (hence the major version change in Python).
If your aim is to import vtk polydata into Blender, my suggestion is that you save the VTK files as STL or OBJ (you have VTK writers for both) and import them into Blender that way.
I know this answer is a couple of years too late, but Blender and VTK can now use the same Python version, so I've recently updated a script that converts Blender meshes <==> VtkPolyData. If you are interested, the script and a few demos are here:
https://github.com/cwant/VTKBlender
Regards,
Chris

what is 1.0 in the statement "import bb.cascades 1.0"

I want to know the significance of 1.0 in import bb.cascades 1.0 in main.qml file in BB10 app development project.
thanks in advance.
The 1.0 is the version number.
At the moment there is only version 1.0 of the bb.cascades library. The purpose of this would be for future compatibility, so that if a phone has a new bb10 OS with any major changes to the cascades library your app will still work as it tells the OS it's built for version 1.0.