From 81158554280420224b99ac172ed20ffed4fd9f11 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Sun, 17 May 2015 16:33:23 -0300 Subject: Start the model for location information. And implement the reset method. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/locationinformation.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'qt-ui/locationinformation.cpp') diff --git a/qt-ui/locationinformation.cpp b/qt-ui/locationinformation.cpp index 5c11f96f2..38c1492f7 100644 --- a/qt-ui/locationinformation.cpp +++ b/qt-ui/locationinformation.cpp @@ -7,6 +7,37 @@ #include #include +LocationInformationModel::LocationInformationModel(QObject *obj) +{ +} + +int LocationInformationModel::rowCount(const QModelIndex &parent) const +{ + +} + +QVariant LocationInformationModel::data(const QModelIndex &index, int role) const +{ + +} + +void LocationInformationModel::update() +{ + int i; + struct dive_site *ds; + for_each_dive_site (i, ds); + + if (rowCount()) { + beginRemoveRows(QModelIndex(), 0, rowCount()); + endRemoveRows(); + } + if (i) { + beginInsertRows(QModelIndex(), 0, i); + internalRowCount = i; + endRemoveRows(); + } +} + LocationInformationWidget::LocationInformationWidget(QWidget *parent) : QGroupBox(parent), modified(false) { ui.setupUi(this); -- cgit v1.2.3-70-g09d2