Problems signalling from QML to C++
Willem Ferguson
willemferguson at zoology.up.ac.za
Tue Jan 5 07:39:28 PST 2016
Dear Dirk, Sebastian,
If it were possible to have feedback from you based on not more than 15
minutes of your time, I would greatly appreciate it. I am trying to get
the QML to signal to the C++ and, due to newby inexperience, I am
totally stuck. I address a number of issues here, but the first one is
the substantive one, the others are small. I take the liberty of
attaching the code in three files.
1) Signalling from the Continue button in the QML to the appropriate C++
slot. I use an approach as close as possible to that of QmlManager in
Subsurface-mobile. I create a message object with a slot, and connect
this to the QML signal. Using QtCreator I get a compile-time error:
/home/willem/qml/vendor/main.cpp:48: error: undefined reference to
`GUIMessageClass::~GUIMessageClass()'
There is a possibility this is a systemic problem related to the way of
presenting code to QTCreator, but I am too naïve to be able to determine
this. Any comment at all will be invaluable.
2) In the object in the header file, what does ~MessageClass mean? It
eliminates a compilation error for this code.
3) With respect to the two models used in the QML, I get warnings from
the QML debugger in QtCreator:
qrc:main.qml:24: ReferenceError: vendorModel is not defined
qrc:main.qml:35: ReferenceError: productModel is not defined
qrc:main.qml:35: ReferenceError: productModel is not defined
These warnings do not cause faulty execution, though. But I would love
to know how they arise.
4) When running the code within QtCreator, the combo boxes do not work
well. They need to be clicked several times before the options are
shown. However, if I provide models inside of QML (i.e. not using a C++
external source) and I run the code using qmlscene, then the combo boxes
work as expected. So, FOR THE MOMENT I assume it is a problem in the way
QtCreator does the QML interpretation and that the QML is likely to run
as expected on a mobile device.
Kind regards,
willem
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20160105/6b07355f/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.cpp
Type: text/x-c++src
Size: 3049 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20160105/6b07355f/attachment.cpp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.h
Type: text/x-chdr
Size: 615 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20160105/6b07355f/attachment.h>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.qml
Type: text/x-qml
Size: 1440 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20160105/6b07355f/attachment.bin>
More information about the subsurface
mailing list