mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Add model to populate the Preferences for GeoRef
Simple model that list the options for GeoRef. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
a19bbcc715
commit
7f83b35ec9
2 changed files with 23 additions and 1 deletions
|
@ -77,7 +77,8 @@ bool LocationInformationModel::setData(const QModelIndex &index, const QVariant
|
|||
return true;
|
||||
}
|
||||
|
||||
bool LocationInformationModel::removeRows(int row, int count, const QModelIndex & parent) {
|
||||
bool LocationInformationModel::removeRows(int row, int count, const QModelIndex & parent)
|
||||
{
|
||||
if(row >= rowCount())
|
||||
return false;
|
||||
|
||||
|
@ -89,3 +90,15 @@ bool LocationInformationModel::removeRows(int row, int count, const QModelIndex
|
|||
endRemoveRows();
|
||||
return true;
|
||||
}
|
||||
|
||||
GeoReferencingOptionsModel *GeoReferencingOptionsModel::instance() {
|
||||
static GeoReferencingOptionsModel *self = new GeoReferencingOptionsModel();
|
||||
return self;
|
||||
}
|
||||
|
||||
GeoReferencingOptionsModel::GeoReferencingOptionsModel(QObject *parent) : QStringListModel(parent)
|
||||
{
|
||||
QStringList list;
|
||||
list << "Country" << "State" << "District" << "Town" << "Suburb" << "Body of Water" << "Site Name";
|
||||
setStringList(list);
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#define DIVELOCATIONMODEL_H
|
||||
|
||||
#include <QAbstractListModel>
|
||||
#include <QStringListModel>
|
||||
#include <stdint.h>
|
||||
|
||||
class LocationInformationModel : public QAbstractListModel {
|
||||
|
@ -22,4 +23,12 @@ private:
|
|||
int internalRowCount;
|
||||
};
|
||||
|
||||
class GeoReferencingOptionsModel : public QStringListModel {
|
||||
Q_OBJECT
|
||||
public:
|
||||
static GeoReferencingOptionsModel *instance();
|
||||
private:
|
||||
GeoReferencingOptionsModel(QObject *parent = 0);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue