mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Implemented the LocationFilter widget.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
14bc7dfeeb
commit
d87a1f6784
2 changed files with 35 additions and 0 deletions
|
@ -507,6 +507,30 @@ void BuddyFilter::hideEvent(QHideEvent *event)
|
|||
QWidget::hideEvent(event);
|
||||
}
|
||||
|
||||
LocationFilter::LocationFilter(QWidget *parent) : QWidget(parent)
|
||||
{
|
||||
ui.setupUi(this);
|
||||
ui.label->setText(tr("Location: "));
|
||||
#if QT_VERSION >= 0x050000
|
||||
ui.filterInternalList->setClearButtonEnabled(true);
|
||||
#endif
|
||||
QSortFilterProxyModel *filter = new QSortFilterProxyModel();
|
||||
filter->setSourceModel(BuddyFilterModel::instance());
|
||||
connect(ui.filterInternalList, SIGNAL(textChanged(QString)), filter, SLOT(setFilterFixedString(QString)));
|
||||
ui.filterList->setModel(filter);
|
||||
}
|
||||
|
||||
void LocationFilter::showEvent(QShowEvent *event)
|
||||
{
|
||||
MultiFilterSortModel::instance()->addFilterModel(LocationFilterModel::instance());
|
||||
QWidget::showEvent(event);
|
||||
}
|
||||
|
||||
void LocationFilter::hideEvent(QHideEvent *event)
|
||||
{
|
||||
MultiFilterSortModel::instance()->removeFilterModel(LocationFilterModel::instance());
|
||||
QWidget::hideEvent(event);
|
||||
}
|
||||
MultiFilter::MultiFilter(QWidget *parent): QScrollArea(parent)
|
||||
{
|
||||
QWidget *w = new QWidget();
|
||||
|
|
|
@ -150,6 +150,17 @@ private:
|
|||
Ui::FilterWidget ui;
|
||||
};
|
||||
|
||||
class LocationFilter : public QWidget {
|
||||
Q_OBJECT
|
||||
public:
|
||||
LocationFilter(QWidget *parent = 0);
|
||||
virtual void showEvent(QShowEvent *);
|
||||
virtual void hideEvent(QHideEvent *);
|
||||
private:
|
||||
Ui::FilterWidget ui;
|
||||
};
|
||||
|
||||
|
||||
class MultiFilter : public QScrollArea {
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
|
Loading…
Reference in a new issue