From 19ac1dfa0983b98d9cc2680e9553020d1c936bb9 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Fri, 31 Oct 2014 15:22:21 -0200 Subject: Added a 'MultiFilter' widget. The multifilter widget is a container with all the filter widgets inside of it. currently there's just one. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/mainwindow.cpp | 4 ++-- qt-ui/mainwindow.ui | 4 ++-- qt-ui/simplewidgets.cpp | 12 ++++++++++++ qt-ui/simplewidgets.h | 6 ++++++ 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index a86eb8e99..c052867fe 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -69,7 +69,7 @@ MainWindow::MainWindow() : QMainWindow(), Q_ASSERT_X(m_Instance == NULL, "MainWindow", "MainWindow recreated!"); m_Instance = this; ui.setupUi(this); - ui.tagFilter->hide(); + ui.multiFilter->hide(); profileToolbarActions << ui.profCalcAllTissues << ui.profCalcCeiling << ui.profDcCeiling << ui.profEad << ui.profHR << ui.profIncrement3m << ui.profMod << ui.profNdl_tts << ui.profNdl_tts << ui.profPhe << ui.profPn2 << ui.profPO2 << ui.profRuler << ui.profSAC << ui.profScaled << @@ -1379,5 +1379,5 @@ void MainWindow::on_paste_triggered() void MainWindow::on_actionFilterTags_triggered() { - ui.tagFilter->setVisible(!ui.tagFilter->isVisible()); + ui.multiFilter->setVisible(!ui.multiFilter->isVisible()); } diff --git a/qt-ui/mainwindow.ui b/qt-ui/mainwindow.ui index 4e9c94a2d..926e8159d 100644 --- a/qt-ui/mainwindow.ui +++ b/qt-ui/mainwindow.ui @@ -126,7 +126,7 @@ - + @@ -897,7 +897,7 @@ p, li { white-space: pre-wrap; } 1 - TagFilter + MultiFilter QWidget
simplewidgets.h
1 diff --git a/qt-ui/simplewidgets.cpp b/qt-ui/simplewidgets.cpp index b31261518..47952c323 100644 --- a/qt-ui/simplewidgets.cpp +++ b/qt-ui/simplewidgets.cpp @@ -476,3 +476,15 @@ void TagFilter::hideEvent(QHideEvent *event) TagFilterSortModel::instance()->removeFilterModel(TagFilterModel::instance()); QWidget::hideEvent(event); } + +MultiFilter::MultiFilter(QWidget *parent): QScrollArea(parent) +{ + QWidget *w = new QWidget(); + QHBoxLayout *l = new QHBoxLayout(); + + l->addWidget(new TagFilter()); + + w->setLayout(l); + w->setMinimumSize(l->count() * 150, 200); + setWidget(w); +} diff --git a/qt-ui/simplewidgets.h b/qt-ui/simplewidgets.h index d3e27c06c..48a57493b 100644 --- a/qt-ui/simplewidgets.h +++ b/qt-ui/simplewidgets.h @@ -140,6 +140,12 @@ private: Ui::TagFilter ui; }; +class MultiFilter : public QScrollArea { + Q_OBJECT +public: + MultiFilter(QWidget *parent); +}; + bool isGnome3Session(); QImage grayImage(const QImage &coloredImg); -- cgit v1.2.3-70-g09d2