Add select-all, deselect-all and invert-selection options to filters

To every filter list add a menu button that allows selection of all,
selection of none or inversion of selection.

Implements #435.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2017-12-23 15:49:21 +01:00 committed by Dirk Hohndel
parent 668635e98e
commit 7451517e4a
4 changed files with 33 additions and 0 deletions

View file

@ -51,6 +51,16 @@
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="selectionButton">
<property name="text">
<string>...</string>
</property>
<property name="popupMode">
<enum>QToolButton::InstantPopup</enum>
</property>
</widget>
</item>
</layout>
</item>
<item>

View file

@ -513,6 +513,12 @@ FilterBase::FilterBase(FilterModelBase *model_, QWidget *parent)
filter->setFilterCaseSensitivity(Qt::CaseInsensitive);
connect(ui.filterInternalList, SIGNAL(textChanged(QString)), filter, SLOT(setFilterFixedString(QString)));
ui.filterList->setModel(filter);
QMenu *menu = new QMenu(this);
menu->addAction(tr("Select All"), model, &FilterModelBase::selectAll);
menu->addAction(tr("Unselect All"), model, &FilterModelBase::clearFilter);
menu->addAction(tr("Invert Selection"), model, &FilterModelBase::invertSelection);
ui.selectionButton->setMenu(menu);
}
void FilterBase::showEvent(QShowEvent *event)