QCAD
Open Source 2D CAD
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
43 public:
44  RCommandLine(QWidget* parent = 0);
45  QString getLastCommand();
46  void appendCommand(const QString& cmd);
47 
48 protected:
49  virtual void keyPressEvent(QKeyEvent * event);
50  virtual bool event(QEvent* event);
51 
52 private:
53  QStringList history;
54  QStringList::iterator it;
55 };
56 
58 
59 #endif