I include an image explaining much of the context of the problem I encounter.

I have a QML combobox that needs to respond to a C++ QStringListModel. I do this as follows:

At the start where the QML machine is initialised (at the top of the attached image) 1) Define and instantiate the underlying C++ class (DownloadManager) as a global object (downloadhelper),
    visible to the C++ code far away.
2) Define a context pointer to downloadhelper. The handle for this pointer is "downloadhelper".

Within the downloadmanager class (the C++ code):
1) Define a property set (Q_PROPERTY) that allows QML to see several structures inside the C++ code. 2) Define the model vendorModel to be used by the QML combobox. The vendorModel is accessible both as a QStringListModel (vendorModel) and as a function that returns a pointer to a QStrinListModel
    (VendorModel()).

In the QML:
1) The downloadhelper object is seen with the QML code, visible by the italic font of "downloadhelper" as well some of the visible parts within downloadhelper, offered in the dropdown list (right-hand side of attached image)

The result: If, within the model specification in the QML:
1) If I choose "vendorModel" from the dropdown list and execute, there is a segfault at the model definition in the QML
     Commenting out the model definition eliminates the segfault.
2) If I choose "VendorModel()", the QML processor does not recognise the identifier 3) If I choose VendorModel (as defined in the Q_PROPERTY), then I get the output in the black box at the bottom of the image. If I take the Q_PROPERTY definition as a yard stick, the READ handle VendorModel should be the appropriate one. But VendorModel is not even listed in the dropdown list in the QML code in the image.

Any comments or suggestion will be very valuable.
Kind regards,
willem


_______________________________________________
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to