Commit 6bf411a0 authored by Volker Krause's avatar Volker Krause
Browse files

Make the sourceModel property a QObject*

This works perfectly fine with the more specific type on Linux, but breaks
on Android for unknown reasons, making the application fail to start there.
parent 6e8e08d8
Pipeline #39069 canceled with stage
......@@ -49,18 +49,18 @@ void LocationQueryOverlayProxyModel::setMapData(const MapData &data)
emit mapDataChanged();
}
QAbstractItemModel* LocationQueryOverlayProxyModel::sourceModel() const
QObject* LocationQueryOverlayProxyModel::sourceModel() const
{
return m_sourceModel;
}
void LocationQueryOverlayProxyModel::setSourceModel(QAbstractItemModel *sourceModel)
void LocationQueryOverlayProxyModel::setSourceModel(QObject *sourceModel)
{
if (m_sourceModel == sourceModel) {
return;
}
beginResetModel();
m_sourceModel = sourceModel;
m_sourceModel = qobject_cast<QAbstractItemModel*>(sourceModel);
initialize();
endResetModel();
......
......@@ -24,7 +24,7 @@ class LocationQueryOverlayProxyModel : public QAbstractListModel
{
Q_OBJECT
Q_PROPERTY(KOSMIndoorMap::MapData mapData READ mapData WRITE setMapData NOTIFY mapDataChanged)
Q_PROPERTY(QAbstractItemModel* sourceModel READ sourceModel WRITE setSourceModel NOTIFY sourceModelChanged)
Q_PROPERTY(QObject* sourceModel READ sourceModel WRITE setSourceModel NOTIFY sourceModelChanged)
public:
explicit LocationQueryOverlayProxyModel(QObject *parent = nullptr);
......@@ -33,8 +33,8 @@ public:
MapData mapData() const;
void setMapData(const MapData &data);
QAbstractItemModel *sourceModel() const;
void setSourceModel(QAbstractItemModel *sourceModel);
QObject *sourceModel() const;
void setSourceModel(QObject *sourceModel);
enum Role {
ElementRole = Qt::UserRole,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment