filter: add filter preset table

Add a table view that shows all presets and a button to delete
old presets. When clicking on an item, load the preset.
When the filter is reset, deselect any item.

Change the preset-loading code: instead of simply loading the
preset, select the preset in the table. Thus, it will be loaded
implicitly.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2020-05-28 22:19:58 +02:00 committed by Dirk Hohndel
parent c6bd2a7ffb
commit 142f76374c
3 changed files with 241 additions and 189 deletions

View file

@ -35,6 +35,8 @@ private slots:
void constraintChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles);
void constraintsReset();
void updatePresetMenu();
void presetClicked(const QModelIndex &index);
void presetSelected(const QItemSelection &selected, const QItemSelection &);
void on_addSetButton_clicked();
private:
@ -47,6 +49,8 @@ private:
FilterData createFilterData() const;
void setFilterData(const FilterData &filterData);
void loadPreset(int index);
void selectPreset(int i);
void clearFilterData();
std::unique_ptr<QMenu> loadFilterPresetMenu;
};