mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-03 15:43:09 +00:00
215e5a4544
Add a small proxy-model on top of DiveComputerModel so that clicking on table headers makes the table sortable. The UI feature here is not as important as the fact that the UI does its own sorting and we can keep the device-table in the core sorted differently. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
32 lines
743 B
C++
32 lines
743 B
C++
// SPDX-License-Identifier: GPL-2.0
|
|
#ifndef DIVECOMPUTERMANAGEMENTDIALOG_H
|
|
#define DIVECOMPUTERMANAGEMENTDIALOG_H
|
|
|
|
#include "ui_divecomputermanagementdialog.h"
|
|
#include "qt-models/divecomputermodel.h"
|
|
#include <QDialog>
|
|
#include <memory>
|
|
|
|
class QModelIndex;
|
|
|
|
class DiveComputerManagementDialog : public QDialog {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
static DiveComputerManagementDialog *instance();
|
|
void init();
|
|
|
|
public
|
|
slots:
|
|
void tryRemove(const QModelIndex &index);
|
|
void accept();
|
|
void reject();
|
|
|
|
private:
|
|
explicit DiveComputerManagementDialog(QWidget *parent = 0, Qt::WindowFlags f = 0);
|
|
Ui::DiveComputerManagementDialog ui;
|
|
std::unique_ptr<DiveComputerModel> model;
|
|
DiveComputerSortedModel proxyModel;
|
|
};
|
|
|
|
#endif // DIVECOMPUTERMANAGEMENTDIALOG_H
|