mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-26 00:23:55 -07:00
implement search bar in shortcuts menu (#5285)
* implement search bar in shortcuts menu * remove unneeded imports * use expandAll
This commit is contained in:
parent
a0e5871c6e
commit
5bdbd51fa8
5 changed files with 197 additions and 75 deletions
34
cockatrice/src/settings/shortcut_treeview.h
Normal file
34
cockatrice/src/settings/shortcut_treeview.h
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#ifndef SHORTCUT_TREEVIEW_H
|
||||
#define SHORTCUT_TREEVIEW_H
|
||||
|
||||
#include <QModelIndex>
|
||||
#include <QStandardItemModel>
|
||||
#include <QTreeView>
|
||||
|
||||
class QSortFilterProxyModel;
|
||||
class ShortcutTreeView : public QTreeView
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ShortcutTreeView(QWidget *parent);
|
||||
void retranslateUi();
|
||||
|
||||
signals:
|
||||
void currentItemChanged(const QString &shortcut);
|
||||
|
||||
public slots:
|
||||
void updateSearchString(const QString &searchString);
|
||||
|
||||
private:
|
||||
QStandardItemModel *shortcutsModel;
|
||||
QSortFilterProxyModel *proxyModel;
|
||||
void populateShortcutsModel();
|
||||
|
||||
private slots:
|
||||
void refreshShortcuts();
|
||||
|
||||
protected:
|
||||
void currentChanged(const QModelIndex ¤t, const QModelIndex &previous) override;
|
||||
};
|
||||
|
||||
#endif // SHORTCUT_TREEVIEW_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue