aboutsummaryrefslogtreecommitdiff
path: root/include/CommandInput.hpp
blob: 5cebcd18e4617d4eeab6ece65fed509f7dd32f68 (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
#pragma once

#include <QBoxLayout>
#include <QKeyEvent>
#include <QLineEdit>

class CommandInput : public QFrame {
  Q_OBJECT

public:
  CommandInput(QString defaultInput = "", QWidget *parentNode = nullptr);
  void setInputFocus(bool focussed);
  bool isInputFocussed();
  QString getInputCommand();

signals:
  void submitted(QString command);

protected:
  void keyPressEvent(QKeyEvent *event) override;

private:
  QBoxLayout *layout;
  QLineEdit *input;
};