blob: a6ca0ed8106ec60fe992da59e07dd0ebf3316129 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#pragma once
#include <QBoxLayout>
#include <QKeyEvent>
#include <QLineEdit>
class CommandInput : public QWidget {
Q_OBJECT
public:
CommandInput(QString defaultInput = "", QWidget *parentNode = nullptr);
void setInputFocus(bool focussed);
bool isInputFocussed();
QString getInputCommand();
void setInputText(QString text);
signals:
void submitted(QString command);
void cancelled();
protected:
void keyPressEvent(QKeyEvent *event) override;
void emitSubmit();
private:
QBoxLayout *layout;
QLineEdit *input;
};
|