-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathQConsole.h
40 lines (34 loc) · 879 Bytes
/
QConsole.h
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
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef QCONSOLE_H
#define QCONSOLE_H
#include <QWidget>
#include <QString>
#include <QtGui>
#include <QTextEdit>
#include <QVBoxLayout>
class QConsole : public QWidget
{
Q_OBJECT
public:
QConsole(QWidget *parent = 0);
QString getAddress();
std::string getArg();
std::string getTxt();
void setArg(const std::string &arg);
protected:
void keyPressEvent(QKeyEvent *);
//void keyReleaseEvent(QKeyEvent *);
private:
void Process(const std::string &cmd);
void launch_process(std::vector<std::string> tokens);
void execute_command(std::vector<std::string> tokens);
void launch_built_in(std::vector<std::string> tokens);
QTextEdit *console;
int lineStart;
QVBoxLayout *mainLayout;
std::vector<std::string> history;
std::string temp_hist;
int hist_idx;
QString address;
std::string user;
};
#endif