20 #ifndef SHORTCUTSDIALOG_HPP
21 #define SHORTCUTSDIALOG_HPP
23 #include <QKeySequence>
24 #include <QModelIndex>
25 #include <QSortFilterProxyModel>
27 #include "StelDialog.hpp"
30 class Ui_shortcutsDialogForm;
33 class QStandardItemModel;
48 bool filterAcceptsRow(
int source_row,
49 const QModelIndex &source_parent)
const;
85 void restoreDefaultShortcuts();
86 void updateTreeData();
94 static bool itemIsEditable(QStandardItem *item);
104 QStandardItem* updateGroup(
const QString& group);
107 QStandardItem* findItemByData(QVariant value,
int role,
int column = 0);
113 QList<QStandardItem*> collisionItems;
115 Ui_shortcutsDialogForm *ui;
117 QStandardItemModel* mainModel;
121 void setModelHeader();
124 #endif // SHORTCUTSDIALOG_HPP
void initEditors()
ititialize editors state when current item changed.
Specialised GUI control for entering keyboard shortcut combinations.
virtual void createDialogContent()
Initialize the dialog widgets and connect the signals/slots.
bool prefixMatchKeySequence(const QKeySequence &ks1, const QKeySequence &ks2)
checks whether one QKeySequence is prefix of another.
Custom filter class for filtering tree sub-items.
Base class for all the GUI windows in Stellarium.
void resetCollisions()
restore colors of all items it TreeWidget to defaults.
void updateShortcutsItem(class StelAction *action, QStandardItem *shortcutItem=NULL)
update shortcut representation in tree correspondingly to its actual contents.
void applyChanges()
called when apply button clicked.
void drawCollisions()
higlight items that have collisions with current lineEdits' state according to css.
void handleChanges()
called when editors' state changed.
void switchToEditors(const QModelIndex &index)
called by doubleclick; if click is on editable item, switch to editors
QList< QStandardItem * > findCollidingItems(QKeySequence ks)
Compile a list of items that share a prefix with this sequence.