##// END OF EJS Templates
Some refactoring on PB11 wrappers...
Some refactoring on PB11 wrappers Most sciqlop core wrappers are moved into a dedicated python module. We needs to get rid off sqpapp! All current sciqlop modules should either be stateless or act as real singletons they must not need any app to be used. This will ease testing, wrapping and usage. Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>

File last commit:

r1328:eb278710ae3b
r1341:f18e017310bc
Show More
FilteringAction.cpp
27 lines | 827 B | text/x-c | CppLexer
/ gui / src / Actions / FilteringAction.cpp
#include "Actions/FilteringAction.h"
#include <QLineEdit>
struct FilteringAction::FilteringActionPrivate {
QLineEdit *m_FilterLineEdit;
QVector<QAction *> m_FilteredActions;
};
FilteringAction::FilteringAction(QWidget *parent)
: QWidgetAction(parent), impl{spimpl::make_unique_impl<FilteringActionPrivate>()}
{
impl->m_FilterLineEdit = new QLineEdit(parent);
setDefaultWidget(impl->m_FilterLineEdit);
connect(impl->m_FilterLineEdit, &QLineEdit::textEdited, [this](auto text) {
for (auto action : impl->m_FilteredActions) {
auto match = action->text().contains(text, Qt::CaseInsensitive);
action->setVisible(match);
}
});
}
void FilteringAction::addActionToFilter(QAction *action)
{
impl->m_FilteredActions << action;
}