aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/simplewidgets.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-11-13 17:32:17 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-11-13 12:09:58 -0800
commitdee20906e377508831a70b74aec0001f22511f5c (patch)
treee35c16f84a5be3a7fbbd8fbb91d7e5f24c50a00d /qt-ui/simplewidgets.cpp
parentb7da2a9c444ef3995a23881d3f847c2e18a48cd3 (diff)
downloadsubsurface-dee20906e377508831a70b74aec0001f22511f5c.tar.gz
Suits Widget created and working.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/simplewidgets.cpp')
-rw-r--r--qt-ui/simplewidgets.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/qt-ui/simplewidgets.cpp b/qt-ui/simplewidgets.cpp
index fb9b9043b..161f4f14a 100644
--- a/qt-ui/simplewidgets.cpp
+++ b/qt-ui/simplewidgets.cpp
@@ -535,6 +535,31 @@ void LocationFilter::hideEvent(QHideEvent *event)
QWidget::hideEvent(event);
}
+SuitFilter::SuitFilter(QWidget *parent) : QWidget(parent)
+{
+ ui.setupUi(this);
+ ui.label->setText(tr("Suits: "));
+#if QT_VERSION >= 0x050000
+ ui.filterInternalList->setClearButtonEnabled(true);
+#endif
+ QSortFilterProxyModel *filter = new QSortFilterProxyModel();
+ filter->setSourceModel(SuitsFilterModel::instance());
+ connect(ui.filterInternalList, SIGNAL(textChanged(QString)), filter, SLOT(setFilterFixedString(QString)));
+ ui.filterList->setModel(filter);
+}
+
+void SuitFilter::showEvent(QShowEvent *event)
+{
+ MultiFilterSortModel::instance()->addFilterModel(SuitsFilterModel::instance());
+ QWidget::showEvent(event);
+}
+
+void SuitFilter::hideEvent(QHideEvent *event)
+{
+ MultiFilterSortModel::instance()->removeFilterModel(SuitsFilterModel::instance());
+ QWidget::hideEvent(event);
+}
+
MultiFilter::MultiFilter(QWidget *parent) : QScrollArea(parent)
{
QWidget *expandedWidget = new QWidget();
@@ -575,6 +600,7 @@ MultiFilter::MultiFilter(QWidget *parent) : QScrollArea(parent)
l->addWidget(tagFilter);
l->addWidget(new BuddyFilter());
l->addWidget(new LocationFilter());
+ l->addWidget(new SuitFilter());
l->setContentsMargins(0, 0, 0, 0);
l->setSpacing(0);