Closed jmastr closed 6 years ago
Let's use this PR for discussion. For the OpeningHoursModel i need some kind of QJSValue
, so page.model.item(index)
looked promising, but this is of type VenueSortFilterProxyModel
. I need VenueModel
, so I came up with this:
diff --git a/qml/pages/VenueMapOverviewPage.qml b/qml/pages/VenueMapOverviewPage.qml
index a017f44..572db2e 100644
--- a/qml/pages/VenueMapOverviewPage.qml
+++ b/qml/pages/VenueMapOverviewPage.qml
@@ -110,7 +110,7 @@ BVApp.Page {
onClicked: {
pageStack.push(Qt.resolvedUrl("VenueDescription.qml"),
{
- restaurant : model,
+ restaurant : page.model.model.itemFromID(model.id),
positionSource : page.positionSource
});
}
We already have VenueModel::indexFromID
and VenueModel::jsonItem2QStandardItem
. I would need something like this: QJSValue VenueModel::itemFromID(const QString& id) const
. I could not figure out, how to convert a QStandardItem
back to QJSValue
. Could you help me with that? Do you think, this is the correct approach?
See #226
Without this patch a venue is always closed from Monday til Sunday when selecting it via the map overview.
The reason is not completely clear to me, because debugging the problem showed, that the information is there. The difference is that 'model' is e.g. 'QObject(0x1261e4140)' and 'page.model.item(index)' is '[object Object]', like 'jsonModelCollection.item(index)' in VenueList.qml, where it is known to be working correctly.
Closes #222