mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
desktop: make divecomputer table sortable
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>
This commit is contained in:
parent
5931be4c88
commit
215e5a4544
4 changed files with 50 additions and 3 deletions
|
@ -1,9 +1,11 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
#ifndef DIVECOMPUTERMANAGEMENTDIALOG_H
|
||||
#define DIVECOMPUTERMANAGEMENTDIALOG_H
|
||||
#include <QDialog>
|
||||
|
||||
#include "ui_divecomputermanagementdialog.h"
|
||||
#include "qt-models/divecomputermodel.h"
|
||||
#include <QDialog>
|
||||
#include <memory>
|
||||
|
||||
class QModelIndex;
|
||||
|
||||
|
@ -23,7 +25,8 @@ slots:
|
|||
private:
|
||||
explicit DiveComputerManagementDialog(QWidget *parent = 0, Qt::WindowFlags f = 0);
|
||||
Ui::DiveComputerManagementDialog ui;
|
||||
QScopedPointer<DiveComputerModel> model;
|
||||
std::unique_ptr<DiveComputerModel> model;
|
||||
DiveComputerSortedModel proxyModel;
|
||||
};
|
||||
|
||||
#endif // DIVECOMPUTERMANAGEMENTDIALOG_H
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue