Hi,
I'm addressing a problem trying to have user select an item with selectiondialog. My app works with network so, that a network request starts when user presses a button and when it returns, it will get parsed. If the parsing finds out that there is multiple choises, it signals that a selectiondialog should be shown.
The problem I have is that the Dialog is empty. Here's my QML:
//in MainPage.qml
With the function getPossibleListTo() returns a QList<AddressContainer *>Code:SelectionDialog { function showPlaceDialog(){ console.log("Multiple dialogs called") placeDialog.model = myClass.getPossibleListTo() placeDialog.open() } Connections { target: reittiopas onMultipleChoicesForLocationSignal: placeDialog.showPlaceDialog() } id: placeDialog }
Where AddressContainer derives from QObject and is basicly a struck-class.Code:Q_INVOKABLE QList<AddressContainer *> getPossibleListFrom();
I don't fully understand why the dialog is empty. With Q_PROPERTY I should be able to access variables within AddressContainer and with a delegate of my own to visualize it? Or is there simply a better way to make a SelectionsDialog. I guess it says that is supports types that are compatible with ListView which basicly means that for my own class it has to derive from QAbstractListModel but I couldn't get that to work and that seems a bit overkill for this simple task.
Almost all examples handle a case where a dialog content is static and it can be registered with setContentProperty to use as a model, but I guess that cannot be the case now.
Thanks already for ideas!



