andre@4: #ifndef FILTERWIDGET_H andre@4: #define FILTERWIDGET_H andre@25: /* Copyright (C) 2015 by ETH Zürich andre@25: * Software engineering by Intevation GmbH andre@4: * andre@4: * This file is Free Software under the GNU GPL (v>=2) andre@4: * and comes with ABSOLUTELY NO WARRANTY! andre@4: * See LICENSE.txt for details. andre@4: */ andre@4: #include andre@14: #include andre@4: andre@4: class QSortFilterProxyModel; andre@4: class QComboBox; andre@4: class QLineEdit; andre@66: /** andre@66: * @class FilterWidget andre@66: * @brief Generic Widget to apply a filter on SortFilterProxymodel andre@66: */ andre@4: class FilterWidget: public QWidget andre@4: { andre@4: Q_OBJECT andre@4: andre@4: public: andre@4: /**@brief construct a filterwidget for the model model.*/ andre@4: FilterWidget (QSortFilterProxyModel *model, andre@4: QWidget * parent = 0, Qt::WindowFlags f = 0); andre@4: andre@28: Q_SIGNALS: andre@28: void filterHasChanged(); andre@28: andre@4: protected: andre@4: void setupGUI(); andre@4: andre@4: protected slots: andre@4: void headersChanged(); andre@4: andre@4: void filterChanged(); andre@4: andre@4: private: andre@4: QSortFilterProxyModel *mModel; andre@4: QComboBox *mCombo; andre@4: QLineEdit *mEditLine; andre@14: /* Maps the combo index to the model col index */ andre@14: QMap mColFilterMap; andre@4: }; andre@4: #endif // FILTERWIDGET_H