diff options
Diffstat (limited to 'desktop-widgets')
-rw-r--r-- | desktop-widgets/filterwidget2.cpp | 14 | ||||
-rw-r--r-- | desktop-widgets/filterwidget2.h | 6 |
2 files changed, 20 insertions, 0 deletions
diff --git a/desktop-widgets/filterwidget2.cpp b/desktop-widgets/filterwidget2.cpp index 50cad019a..473a4ad54 100644 --- a/desktop-widgets/filterwidget2.cpp +++ b/desktop-widgets/filterwidget2.cpp @@ -81,5 +81,19 @@ void FilterWidget2::updateFilter() data.equipment = ui->equipment->text().split(",", QString::SkipEmptyParts); data.invertFilter = ui->invertFilter->isChecked(); + filterData = data; + emit filterDataChanged(data); +} + +void FilterWidget2::showEvent(QShowEvent *event) +{ + QWidget::showEvent(event); + emit filterDataChanged(filterData); +} + +void FilterWidget2::hideEvent(QHideEvent *event) +{ + QWidget::hideEvent(event); + FilterData data; emit filterDataChanged(data); } diff --git a/desktop-widgets/filterwidget2.h b/desktop-widgets/filterwidget2.h index a9d976ec8..80629f0cc 100644 --- a/desktop-widgets/filterwidget2.h +++ b/desktop-widgets/filterwidget2.h @@ -2,6 +2,8 @@ #define FILTERWIDGET_2_H #include <QWidget> +#include <QHideEvent> +#include <QShowEvent> #include <memory> @@ -18,12 +20,16 @@ class FilterWidget2 : public QWidget { public: explicit FilterWidget2(QWidget *parent = 0); void updateFilter(); +protected: + void hideEvent(QHideEvent *event) override; + void showEvent(QShowEvent *event) override; signals: void filterDataChanged(const FilterData& data); private: std::unique_ptr<Ui::FilterWidget2> ui; + FilterData filterData; }; #endif |