[SailfishDevel] Passing parameters back?

Chris Walker cdw_nokiaqt at the-walker-household.co.uk
Mon May 11 11:21:03 UTC 2015


Hopefully somebody can help me with this problem.

In my app, I'm using this approach to set up and use various models :-
https://wiki.qt.io/How_to_Use_a_QSqlQueryModel_in_QML

I have a list of breweries in the first page and when one is selected,
I pass a parameter to the second page like this :-
            onClicked:
pageStack.push(Qt.resolvedUrl("BreweryDetailsPage.qml"), { model:
locid });

But I want my sql statement to only pick out the details for 'locid'
and therefore I need to pass that back to the main cpp file which is
set like this :-
    view->rootContext()->setContextProperty("breweryInfomodel",
breweryInfomodel);

Note that I have yet to add the code to pass in the locid argument!

Is such a thing possible (my main reason for doing it this way is that I
would like to keep all the relevant code in the same place) or is the
only way to filter the full list of 'locid's in the
BreweryDetailsPage.qml ?


More information about the Devel mailing list