From be6e190bd2b0480d76fc29bed95d46ad1aa7f414 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Mon, 21 Sep 2015 14:01:58 -0300 Subject: Skeleton of the new LocationCombobox This is the bare minimum skeleton of the new completer for the dive site management. Nothing works, yet, nothing is hoocked up, yet. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/locationinformation.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'qt-ui/locationinformation.h') diff --git a/qt-ui/locationinformation.h b/qt-ui/locationinformation.h index 080e013a8..18c3dc760 100644 --- a/qt-ui/locationinformation.h +++ b/qt-ui/locationinformation.h @@ -4,6 +4,7 @@ #include "ui_locationInformation.h" #include #include +#include class LocationInformationWidget : public QGroupBox { Q_OBJECT @@ -58,4 +59,43 @@ private: uint32_t last_uuid; }; +class DiveLocationFilterProxyModel : public QSortFilterProxyModel { + Q_OBJECT +public: + DiveLocationFilterProxyModel(QObject *parent = 0); + virtual bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const; +}; + +class DiveLocationModel : public QAbstractTableModel { + Q_OBJECT +public: + enum columns{UUID, NAME, LATITUDE, LONGITUDE, DESCRIPTION, NOTES, COLUMNS}; + DiveLocationModel(QObject *o = 0); + void resetModel(); + QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; + int rowCount(const QModelIndex& parent = QModelIndex()) const; + int columnCount(const QModelIndex& parent = QModelIndex()) const; + bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole); +private: + QString new_ds_value[2]; +}; + +class DiveLocationListView : public QListView { + Q_OBJECT +public: + DiveLocationListView(QWidget *parent = 0); +}; + +class DiveLocationLineEdit : public QLineEdit { + Q_OBJECT +public: + DiveLocationLineEdit(QWidget *parent =0 ); + void refreshDiveSiteCache(); + void setTemporaryDiveSiteName(const QString& s); +private: + DiveLocationFilterProxyModel *proxy; + DiveLocationModel *model; + DiveLocationListView *view; +}; + #endif -- cgit v1.2.3-70-g09d2