mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 13:10:19 +00:00
dd12bdaf94
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>
24 lines
589 B
C++
24 lines
589 B
C++
// SPDX-License-Identifier: GPL-2.0
|
|
#include "TabDiveSite.h"
|
|
#include "qt-models/divelocationmodel.h"
|
|
|
|
#include <qt-models/divecomputerextradatamodel.h>
|
|
|
|
TabDiveSite::TabDiveSite(QWidget *parent) : TabBase(parent)
|
|
{
|
|
ui.setupUi(this);
|
|
ui.diveSites->setTitle(tr("Dive sites"));
|
|
ui.diveSites->setModel(LocationInformationModel::instance());
|
|
|
|
// Show only the first few columns
|
|
for (int i = LocationInformationModel::COORDS; i < LocationInformationModel::COLUMNS; ++i)
|
|
ui.diveSites->view()->setColumnHidden(i, true);
|
|
}
|
|
|
|
void TabDiveSite::updateData()
|
|
{
|
|
}
|
|
|
|
void TabDiveSite::clear()
|
|
{
|
|
}
|