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 <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2014-10-31 15:22:21 -02:00 committed by Dirk Hohndel
parent 063e6d9fbf
commit 19ac1dfa09
4 changed files with 22 additions and 4 deletions

View file

@ -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());
}

View file

@ -126,7 +126,7 @@
<widget class="QWidget" name="page_3">
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="TagFilter" name="tagFilter" native="true"/>
<widget class="MultiFilter" name="multiFilter" native="true"/>
</item>
<item>
<widget class="DiveListView" name="ListWidget"/>
@ -897,7 +897,7 @@ p, li { white-space: pre-wrap; }
<container>1</container>
</customwidget>
<customwidget>
<class>TagFilter</class>
<class>MultiFilter</class>
<extends>QWidget</extends>
<header>simplewidgets.h</header>
<container>1</container>

View file

@ -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);
}

View file

@ -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);