mirror of
https://github.com/YACReader/yacreader
synced 2025-07-19 13:34:44 -04:00
Headless server: simplify system config logger
This commit is contained in:
48
shortcuts_management/edit_shortcut_item_delegate.h
Normal file
48
shortcuts_management/edit_shortcut_item_delegate.h
Normal file
@ -0,0 +1,48 @@
|
||||
#ifndef EDIT_SHORTCUT_ITEM_DELEGATE_H
|
||||
#define EDIT_SHORTCUT_ITEM_DELEGATE_H
|
||||
|
||||
#include <QItemDelegate>
|
||||
#include <QLineEdit>
|
||||
#include <QKeyEvent>
|
||||
#include <QKeySequence>
|
||||
#include <QToolButton>
|
||||
|
||||
class KeySequenceLineEdit : public QLineEdit
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit KeySequenceLineEdit(QWidget *parent = 0);
|
||||
|
||||
protected:
|
||||
//int numKeys;
|
||||
//int keys[4];
|
||||
void keyPressEvent(QKeyEvent *);
|
||||
int translateModifiers(Qt::KeyboardModifiers state, const QString &text);
|
||||
void resizeEvent(QResizeEvent *);
|
||||
|
||||
private:
|
||||
QToolButton *clearButton;
|
||||
QToolButton *acceptButton;
|
||||
};
|
||||
|
||||
class EditShortcutItemDelegate : public QItemDelegate
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit EditShortcutItemDelegate(QObject *parent = 0);
|
||||
|
||||
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
|
||||
const QModelIndex &index) const;
|
||||
void setEditorData(QWidget *editor, const QModelIndex &index) const;
|
||||
void setModelData(QWidget *editor, QAbstractItemModel *model,
|
||||
const QModelIndex &index) const;
|
||||
void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex & mi) const;
|
||||
bool eventFilter(QObject *editor, QEvent *event);
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
void closeShortcutEditor();
|
||||
|
||||
};
|
||||
|
||||
#endif // EDIT_SHORTCUT_ITEM_DELEGATE_H
|
Reference in New Issue
Block a user