<p dir="ltr">You can connect via qml </p>
<p dir="ltr">There a Connections {} qml entity that works for that. </p>
<div class="gmail_quote">Em 4 de fev de 2016 13:48, "Willem Ferguson" <<a href="mailto:willemferguson@zoology.up.ac.za">willemferguson@zoology.up.ac.za</a>> escreveu:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 01/02/2016 20:46, Tomaz Canabrava wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I can have a class DiveComputers that is a model based on QAbstractListModel, since any dive can have zero or more dive computers, I can have the method DiveComputers *diveComputers() on the class Dive as a Q_PROPERTY, and I can access it in QML via:<br>
<br>
ListView {<br>
    id: diveList<br>
    model : diveListModel<br>
    delegate {<br>
        ListView {<br>
            id: diveComputerList<br>
            model: dive.diveComputers<br>
        }<br>
    }<br>
}<br>
<br>
</blockquote>
Tomaz,<br>
Your email above is extremely informative. I deal with two-way communication between the QML and C++. The above allows the QML to see a model on the C++ side. This takes care of getting data drom the C++ to the QML. I also use a signal emitted by the QML to update the model within C++, something as follows:<br>
<br>
Class DownloadManager<br>
<br>
    Q_PROPERTY(QStringListModel *vendorModel READ getVendorModel WRITE setVendorModel NOTIFY vendorChanged)<br>
   .......<br>
<br>
signals:<br>
    void vendorChanged();    // notification from C++ to QML<br>
<br>
public slots:<br>
    void newVendorSlot(const QString &vendortext);// meant for incoming signal from QML. I need to connect this to the QML.<br>
<br>
<br>
The middle two lines above allow communication of the vendorModel to the QML. The bottom line above allows the C++ to receive the signal from the QML. Normally, using QtQuickView I would have connected the QML signal to the C++ slot as follows:<br>
<br>
    QObject *dcSelectPanel = view.rootObject();<br>
QObject::connect(dcSelectPanel,SIGNAL(vendorChangedSignal(QString)),<br>
&DownloadManager,SLOT(newVendorSlot(QString)));<br>
<br>
But within the present context it looks like view.rootObject() is not easily accessible and I need an alternative way of connecting the QML signal to the C++ slot. Any suggestions? I have spent considerable time scanning for a discussion on this issue and cannot find any text. In QmlManager, many slots are created but I see no connect construct. I hope I am making sense?<br>
Kind regards,<br>
willem<br>
<br>
</blockquote></div>