Skip to content

Commit

Permalink
Allow range selections
Browse files Browse the repository at this point in the history
The filter options can now be selected in a row (click an option and hold down)
  • Loading branch information
juuz0 committed Aug 11, 2023
1 parent 6db2309 commit 599f88a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/kiwixchoicebox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ KiwixChoiceBox::KiwixChoiceBox(QWidget *parent) :
}
});

connect(choiceSelector, &QListWidget::itemSelectionChanged, this, [=]() {
for (auto &item : choiceSelector->selectedItems()) {
if (!m_choiceItems.contains(item->text())) {
addSelection(item->text(), item->data(Qt::UserRole).toString());
}
}
});

connect(choiceSearch, &QLineEdit::textChanged, [=](QString search) {
for (auto i = 0; i < choiceSelector->count(); i++) {
auto itemAtRow = choiceSelector->item(i);
Expand Down

0 comments on commit 599f88a

Please sign in to comment.