* Added keyboard shorcuts to focus and unfocus chat * Fixed format * Changed the Esc behavior to work on any QLineEdit in the main Window and ignore shortcut conflicts * Fixed a conflict with shortcuts * Configurable unfocus shortcut and format fixes * minor style fix
29 lines
603 B
C++
29 lines
603 B
C++
#ifndef LINEEDITCOMPLETER_H
|
|
#define LINEEDITCOMPLETER_H
|
|
|
|
#include "customlineedit.h"
|
|
|
|
#include <QFocusEvent>
|
|
#include <QKeyEvent>
|
|
#include <QStringList>
|
|
|
|
class LineEditCompleter : public LineEditUnfocusable
|
|
{
|
|
Q_OBJECT
|
|
private:
|
|
QString cursorWord(const QString &line) const;
|
|
QCompleter *c;
|
|
private slots:
|
|
void insertCompletion(QString);
|
|
|
|
protected:
|
|
void keyPressEvent(QKeyEvent *event);
|
|
void focusOutEvent(QFocusEvent *e);
|
|
|
|
public:
|
|
explicit LineEditCompleter(QWidget *parent = nullptr);
|
|
void setCompleter(QCompleter *);
|
|
void setCompletionList(QStringList);
|
|
};
|
|
|
|
#endif
|