QCAD
Open Source 2D CAD
RCommandLine.h
Go to the documentation of this file.
1 
20 #ifndef RCOMMANDLINE_H_
21 #define RCOMMANDLINE_H_
22 
23 #include "gui_global.h"
24 
25 #include <QEvent>
26 #include <QLineEdit>
27 #include <QMetaType>
28 #include <QStringList>
29 
34 class QCADGUI_EXPORT RCommandLine: public QLineEdit {
35 
36 Q_OBJECT
37 
38 signals:
39  void clearHistory();
40  void commandConfirmed(const QString& command);
41  void completeCommand(const QString& command);
42  void escape();
43 
44 public:
45  RCommandLine(QWidget* parent = 0);
46  QString getLastCommand();
47  void appendCommand(const QString& cmd);
48  QStringList getHistory() const;
49  void setHistory(QStringList& h);
50 
51 protected:
52  virtual void keyPressEvent(QKeyEvent* event);
53  virtual bool event(QEvent* event);
54 
55 private:
56  QStringList history;
57  QStringList::iterator it;
58 };
59 
61 
62 #endif
Copyright (c) 2011-2016 by Andrew Mustun.
Definition: RCommandLine.h:34
QStringList::iterator it
Definition: RCommandLine.h:57
#define QCADGUI_EXPORT
Definition: gui_global.h:10
Q_DECLARE_METATYPE(RMath *)
QStringList history
Definition: RCommandLine.h:56