Solved OPC UA QML Types not found
-
Hi i, have compiled QtOpcUa and Open62541 for my opensource Qt 5.12
Now c++ side is can use QtOpcUa but in QML
import QtOpcUa 5.12 as QtOpcUa
output : QML module not found (QtOpcUa)
How to use QtOpcUA QML Types in qtQuick application ?
-
@LeLev said in OPC UA QML Types not found:
How to use QtOpcUA QML Types in qtQuick application ?
Did you add
QT += opcua
in.pro
file? -
@Ratzz Hello, yes, of course, as i said ' c++ side is can use QtOpcUa '
-
@LeLev
I referred https://doc-snapshots.qt.io/qtopcua/qtopcua-qmlmodule.html for QML.
Here is an example which may help you.
-
@Ratzz thx, i read this page.
i do
QT += opcua in .pro
and i do
import QtOpcUa 5.12 as QtOpcUa in qmlthen in C++ i can use QtOpcUa but in QML i have error saying :
QML module not found (QtOpcUa)
there is no Opcua dir under my C:\Qt\5.12.0\mingw73_64\qml
-
@LeLev
U need to download and install the module as suggested here https://forum.qt.io/topic/67023/how-to-connect-to-opcua-server-using-qt-library/5 -
@Ratzz Thank you for the link, but i Already downloaded and installed QtOpcUa module like i'm repeating since the first post ...
I did qmake, make, make install
Now in c++ im able to create my opcua client.
My probleme is in QML i cant write import QtOpcUa 5.12 as QtOpcUa
Sorry if i'm missing something in that link you provided.
edit : When i do 'git Log' on the version of qtopcua i compiled i see this
SHA-1: 326bf6a1058d878b7891ee6d7078ed381c462df1 * Bump version number from 5.11.2 to 5.11.3 Change-Id: I08c918d54118ed8dccf2223cadda11d5562e440c
Are QML Types avalable in this version ?
-
@LeLev said in OPC UA QML Types not found:
Hi i, have compiled QtOpcUa and Open62541 for my opensource Qt 5.12
Check your build folder: Do the QML files and QML plugins exist?
-
@JKSH Hi,
the 'plugins' folder contains open62541 .a and .dll
the 'lib' folder contains Qt5OpcUa .dll .a .prl
in the 'include' .pri and hradersThere is no qml folder
-
@LeLev said in OPC UA QML Types not found:
There is no qml folder
That might be the issue. If I'm not mistaken, there should be a qml folder containing:
- Some QML DLLs
- plugins.qmltypes
- qmldir
The last two files tell Qt Creator what modules you have.
For example, have a look inside <QTDIR>/qml/QtWebSockets/
-
@JKSH yes as i mentioned earlier i cant find opcua folder in C:\Qt\5.12.0\mingw73_64\qml
So what do you think is wrong with my QtOpcUa install ?
I know QML types came out with Qt 5.12
QtOpcUa i compiled version log is
SHA-1: 326bf6a1058d878b7891ee6d7078ed381c462df1 Bump version number from 5.11.2 to 5.11.3
Am i compiling wrong version ?
Doc of QML opcua Types saysSince: QtOpcUa 5.12
-
@LeLev said in OPC UA QML Types not found:
So what do you think is wrong with my QtOpcUa install ?
I'm not sure, sorry. I haven't tried to compile a module in a long time.
I'll let someone more experienced take over.
-
@JKSH hi,
It looks like nobody used QML opcua types yet...
i did a double post
https://forum.qt.io/topic/97363/how-to-use-qtopcua-qml-types-windows-qt5-12-opensource/1
is there a chance QtOpcUa is directly avalable in the 5.12.0 LTS ? -
@LeLev said in OPC UA QML Types not found:
I know QML types came out with Qt 5.12
QtOpcUa i compiled version log is
SHA-1: 326bf6a1058d878b7891ee6d7078ed381c462df1 Bump version number from 5.11.2 to 5.11.3
Am i compiling wrong version ?
D'oh! I didn't notice this part earlier.
You were compiling from the Qt 5.11 branch, which did not have the QML types.
@LeLev said in OPC UA QML Types not found:
is there a chance QtOpcUa is directly avalable in the 5.12.0 LTS ?
Qt 5.12 has just been released, so have a look at its source code.
-
@JKSH hi,
but on github i select 5.12 in branch dropdown menu
https://github.com/qt/qtopcua/tree/5.12i clone it, then if i do 'git log' i see the same thing
SHA-1: 326bf6a1058d878b7891ee6d7078ed381c462df1 Bump version number from 5.11.2 to 5.11.3
i don't understand why.
-
@LeLev said in OPC UA QML Types not found:
i clone it, then if i do 'git log' i see the same thing
SHA-1: 326bf6a1058d878b7891ee6d7078ed381c462df1 Bump version number from 5.11.2 to 5.11.3
That's the Qt 5.11 branch.
Call
git checkout v5.12.0
-
@JKSH Thx!
-
@JKSH one more question please.
Can i just update (git checkout v5.12.0) my QtOpcUa and re-do
qmake
make
make-installdirectly or i have to delete my current (5.11) QtOpcUa installation ?
edit :
and git checkout v5.12.0 gives me errorerror: pathspec 'v5.12.0' did not match any file(s) known to git.
-
@LeLev
Did you do
git fetch
before?Depending on your remote name, you'll probably need
git checkout origin/v5.12.0
.PS: Don't forget to remove all build results from to old Qt version before building new.
Edit: It seems that github repository is outdated. Please clone from (or add as remote) the official repository http://code.qt.io/cgit/qt/qtopcua.git
-
Hi,
Github is to be considered a backup mirror. It might (as you discovered) be a bit outdated with regards to current state of https://code.qt.io.