Commit 262b09c9 authored by Tomaz  Canabrava's avatar Tomaz Canabrava Committed by Tomaz Canabrava
Browse files

Add filter capabilities on the Quick Actions plugin

parent bea850a6
......@@ -6,6 +6,7 @@
*/
#include "filtermodel.h"
#include <QDebug>
FilterModel::FilterModel(QObject *parent)
: QSortFilterProxyModel(parent)
......
......@@ -14,6 +14,37 @@
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QWidget" name="widget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLineEdit" name="filterLine"/>
</item>
<item>
<widget class="QCheckBox" name="invertFilter">
<property name="text">
<string>Invert</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QTreeView" name="commandsTreeView">
<property name="editTriggers">
......
......@@ -30,6 +30,12 @@ QuickCommandsWidget::QuickCommandsWidget(QWidget *parent)
connect(ui->btnSave, &QPushButton::clicked, this, &QuickCommandsWidget::saveCommand);
connect(ui->btnUpdate, &QPushButton::clicked, this, &QuickCommandsWidget::updateCommand);
connect(ui->btnCancel, &QPushButton::clicked, this, &QuickCommandsWidget::viewMode);
connect(ui->invertFilter, &QPushButton::clicked, priv->filterModel, &FilterModel::setInvertFilter);
connect(ui->filterLine, &QLineEdit::textChanged, this, [this] {
priv->filterModel->setFilterRegularExpression(ui->filterLine->text());
priv->filterModel->invalidate();
});
ui->commandsTreeView->setModel(priv->filterModel);
ui->commandsTreeView->setContextMenuPolicy(Qt::CustomContextMenu);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment