Dive site: add dive site list tab

Add a very simple tab-widget presenting the list of known dive sites.
The table is rendered using our custom "TableView".
The (mis)uses the "LocationInformationModel". It moves the items
to be displayed (delete, name, description, number of dives) to the
front and makes the others hidden.

Moreover, it was necessary to limit the geo-tag decoration role to
the name to avoid having the icon next to each column.

Make the trash-can icon active and the name and description editable.
This is modelled after the cylinders-table code.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-03-09 22:32:16 +01:00 committed by Dirk Hohndel
parent 992ad2fa27
commit dd12bdaf94
8 changed files with 143 additions and 14 deletions

View file

@ -33,6 +33,7 @@
#include "TabDiveInformation.h"
#include "TabDivePhotos.h"
#include "TabDiveStatistics.h"
#include "TabDiveSite.h"
#include <QCompleter>
#include <QSettings>
@ -62,6 +63,8 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
ui.tabWidget->addTab(extraWidgets.last(), tr("Media"));
extraWidgets << new TabDiveExtraInfo();
ui.tabWidget->addTab(extraWidgets.last(), tr("Extra Info"));
extraWidgets << new TabDiveSite();
ui.tabWidget->addTab(extraWidgets.last(), tr("Dive sites"));
ui.dateEdit->setDisplayFormat(prefs.date_format);
ui.timeEdit->setDisplayFormat(prefs.time_format);
@ -205,8 +208,6 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
acceptingEdit = false;
ui.diveTripLocation->hide();
}
MainTab::~MainTab()