mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
[FEATURE] add search bar to the Configure Shortcuts dialog (fix #12681)
Supports search by action name and by shortcut
This commit is contained in:
parent
248e7d1d5e
commit
1fb9ef6ca5
@ -28,6 +28,7 @@
|
||||
#include <QFileDialog>
|
||||
#include <QTextStream>
|
||||
#include <QSettings>
|
||||
#include <QDebug>
|
||||
|
||||
QgsConfigureShortcutsDialog::QgsConfigureShortcutsDialog( QWidget* parent, QgsShortcutsManager* manager )
|
||||
: QDialog( parent )
|
||||
@ -480,3 +481,19 @@ void QgsConfigureShortcutsDialog::setCurrentActionShortcut( const QKeySequence&
|
||||
|
||||
actionChanged( treeActions->currentItem(), nullptr );
|
||||
}
|
||||
|
||||
void QgsConfigureShortcutsDialog::on_mLeFilter_textChanged( const QString& text )
|
||||
{
|
||||
for ( int i = 0; i < treeActions->topLevelItemCount(); i++ )
|
||||
{
|
||||
QTreeWidgetItem* item = treeActions->topLevelItem( i );
|
||||
if ( !item->text( 0 ).contains( text, Qt::CaseInsensitive ) && !item->text( 1 ).contains( text, Qt::CaseInsensitive ) )
|
||||
{
|
||||
item->setHidden( true );
|
||||
}
|
||||
else
|
||||
{
|
||||
item->setHidden( false );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -54,6 +54,7 @@ class GUI_EXPORT QgsConfigureShortcutsDialog : public QDialog, private Ui::QgsCo
|
||||
void setNoShortcut();
|
||||
void saveShortcuts();
|
||||
void loadShortcuts();
|
||||
void on_mLeFilter_textChanged( const QString& text );
|
||||
|
||||
void actionChanged( QTreeWidgetItem* current, QTreeWidgetItem* previous );
|
||||
|
||||
|
@ -14,6 +14,13 @@
|
||||
<string>Keyboard shortcuts</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QgsFilterLineEdit" name="mLeFilter">
|
||||
<property name="placeholderText">
|
||||
<string>Search...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTreeWidget" name="treeActions">
|
||||
<property name="rootIsDecorated">
|
||||
@ -110,6 +117,13 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>QgsFilterLineEdit</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header>qgsfilterlineedit.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>treeActions</tabstop>
|
||||
<tabstop>btnSetNoShortcut</tabstop>
|
||||
|
Loading…
x
Reference in New Issue
Block a user