mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
000a93fb64
commit
be6e190bd2
4 changed files with 180 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue