summaryrefslogtreecommitdiffstats
path: root/qt-ui/locationinformation.h
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-09-21 14:01:58 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-09-23 14:07:07 -0700
commitbe6e190bd2b0480d76fc29bed95d46ad1aa7f414 (patch)
treefcbf03eacc3cdc05c0b12c0705937034354b85c7 /qt-ui/locationinformation.h
parent000a93fb64d92729c51762e1483d36859d442e9d (diff)
downloadsubsurface-be6e190bd2b0480d76fc29bed95d46ad1aa7f414.tar.gz
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 <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/locationinformation.h')
-rw-r--r--qt-ui/locationinformation.h40
1 files changed, 40 insertions, 0 deletions
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 <stdint.h>
#include <QAbstractListModel>
+#include <QSortFilterProxyModel>
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