[QML][Link C++ code with QML view] Link for the best practice
-
Dear users,
as in the title I am developing a test application with a simple QML view and some C++ code. I found in the forum and tutorial several ways to connect a C++ class file with the QML view; but I am interested to the best practice to do it.Could you please indicate me a link in which I can find an example with the most correct way to do it?
Thank you very much!
-
@Shadow-01 said in [QML][Link C++ code with QML view] Link for the best practice:
Could you please indicate me a link in which I can find an example with the most correct way to do it?
You could start with QML documentation:
-
A practical example for models using custom classes: https://wiki.qt.io/How_to_Use_a_Custom_Class_in_C%2B%2B_Model_and_QML_View
-
You can also find some recent discussion of
Q_PROPERTY
andQ_INVOKABLE
, together with links to Qt sample projects (both official samples and unofficial) on: this other recent forum thread.