X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FCustomizedWidgets.h;h=0741a64e8aa1844db14da9fa7267a67b3102b279;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=cb01094446c21f43ab671a3f24857a08cc7d22e2;hpb=6981d14f80d606989c5582b2f93f845e59dcb00b;p=lyx.git diff --git a/src/frontends/qt4/CustomizedWidgets.h b/src/frontends/qt4/CustomizedWidgets.h index cb01094446..0741a64e8a 100644 --- a/src/frontends/qt4/CustomizedWidgets.h +++ b/src/frontends/qt4/CustomizedWidgets.h @@ -6,6 +6,7 @@ * * \author Bo Peng * \author Edwin Leuven + * \author Jürgen Spitzmüller * * Full author contact details are available in file CREDITS. */ @@ -13,36 +14,37 @@ #ifndef CUSTOMIZEDWIDGETS_H #define CUSTOMIZEDWIDGETS_H -#include -#include -#include +#include +#include "KeySequence.h" -/** - * A lineedit for inputting shortcuts - */ -class ShortcutLineEdit : public QLineEdit { - Q_OBJECT -public: - ShortcutLineEdit(QWidget * parent) : QLineEdit(parent) {} -protected Q_SLOTS: - void keyPressEvent(QKeyEvent * e); - bool event(QEvent * e); -}; +class QEvent; +class QKeyEvent; +namespace lyx { +namespace frontend { /** - * A lineedit that displays a hint message when there is no - * text and not under focus. - */ -class SearchLineEdit : public QLineEdit { + * A widget for inputting shortcuts + */ +class ShortcutWidget : public QLabel { Q_OBJECT public: - QString const hintMessage() const; - SearchLineEdit(QWidget * parent) : QLineEdit(parent) {} + ShortcutWidget(QWidget * parent); + void reset(); + bool eventFilter(QObject*, QEvent* e ); + KeySequence const getKeySequence() const; + void setKeySequence(lyx::KeySequence const s); + void removeFromSequence(); protected Q_SLOTS: - void focusInEvent(QFocusEvent * e); - void focusOutEvent(QFocusEvent * e); + bool event(QEvent* e); + void keyPressEvent(QKeyEvent * e); +private: + void appendToSequence(QKeyEvent * e); + KeySequence keysequence_; + bool has_cursor_; }; +} // namespace frontend +} // namespace lyx #endif // CUSTOMIZEDWIDGETS_H