diff options
Diffstat (limited to 'qt-models')
-rw-r--r-- | qt-models/maplocationmodel.cpp | 9 | ||||
-rw-r--r-- | qt-models/maplocationmodel.h | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/qt-models/maplocationmodel.cpp b/qt-models/maplocationmodel.cpp index d08e7020c..ec554d004 100644 --- a/qt-models/maplocationmodel.cpp +++ b/qt-models/maplocationmodel.cpp @@ -68,6 +68,15 @@ void MapLocationModel::add(MapLocation *location) endInsertRows();
}
+void MapLocationModel::addList(QList<MapLocation *> list)
+{
+ if (!list.size())
+ return;
+ beginInsertRows(QModelIndex(), m_mapLocations.size(), m_mapLocations.size() + list.size() - 1);
+ m_mapLocations.append(list);
+ endInsertRows();
+}
+
void MapLocationModel::clear()
{
if (!m_mapLocations.size())
diff --git a/qt-models/maplocationmodel.h b/qt-models/maplocationmodel.h index 4aeee0364..c73fa246e 100644 --- a/qt-models/maplocationmodel.h +++ b/qt-models/maplocationmodel.h @@ -43,6 +43,7 @@ public: int rowCount(const QModelIndex &parent) const override; int count(); void add(MapLocation *); + void addList(QList<MapLocation *>); void clear(); protected: |