Use getter and setter for property in LiveLocationsModel
This commit is contained in:
committed by
Tobias Fella
parent
1fb215dae7
commit
53dc9c1944
@@ -178,4 +178,19 @@ void LiveLocationsModel::updateLocationData(LiveLocationData &&data)
|
|||||||
Q_EMIT dataChanged(idx, idx);
|
Q_EMIT dataChanged(idx, idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NeoChatRoom *LiveLocationsModel::room() const
|
||||||
|
{
|
||||||
|
return m_room;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LiveLocationsModel::setRoom(NeoChatRoom *room)
|
||||||
|
{
|
||||||
|
if (m_room == room) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_room = room;
|
||||||
|
Q_EMIT roomChanged();
|
||||||
|
}
|
||||||
|
|
||||||
#include "moc_livelocationsmodel.cpp"
|
#include "moc_livelocationsmodel.cpp"
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class LiveLocationsModel : public QAbstractListModel
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
QML_ELEMENT
|
QML_ELEMENT
|
||||||
|
|
||||||
Q_PROPERTY(NeoChatRoom *room MEMBER m_room NOTIFY roomChanged)
|
Q_PROPERTY(NeoChatRoom *room READ room WRITE setRoom NOTIFY roomChanged)
|
||||||
/** The event id of the beacon start event, ie. the one all suspequent
|
/** The event id of the beacon start event, ie. the one all suspequent
|
||||||
* events use to relate to the same beacon.
|
* events use to relate to the same beacon.
|
||||||
* If this is set only this specific beacon will be coverd by this model,
|
* If this is set only this specific beacon will be coverd by this model,
|
||||||
@@ -57,6 +57,9 @@ public:
|
|||||||
|
|
||||||
QRectF boundingBox() const;
|
QRectF boundingBox() const;
|
||||||
|
|
||||||
|
NeoChatRoom *room() const;
|
||||||
|
void setRoom(NeoChatRoom *room);
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void roomChanged();
|
void roomChanged();
|
||||||
void eventIdChanged();
|
void eventIdChanged();
|
||||||
|
|||||||
Reference in New Issue
Block a user