diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-10-10 12:40:27 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-10-11 08:35:20 -0700 |
commit | 215e5a45447f53047bfcc167da46714bf1496e8f (patch) | |
tree | aec5877f482b5f53c9fb92372ff69228402c51dc /desktop-widgets/divecomputermanagementdialog.h | |
parent | 5931be4c880bcefb406510b714f83fec30e9bc4d (diff) | |
download | subsurface-215e5a45447f53047bfcc167da46714bf1496e8f.tar.gz |
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>
Diffstat (limited to 'desktop-widgets/divecomputermanagementdialog.h')
-rw-r--r-- | desktop-widgets/divecomputermanagementdialog.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/desktop-widgets/divecomputermanagementdialog.h b/desktop-widgets/divecomputermanagementdialog.h index 806ec8073..d80f8f9d3 100644 --- a/desktop-widgets/divecomputermanagementdialog.h +++ b/desktop-widgets/divecomputermanagementdialog.h @@ -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 |