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  void triggerCommand(const QString& cmd) {
51  emit commandConfirmed(cmd);
52  }
53 
54 public slots:
55  void paste();
56 
57 protected:
58  virtual void keyPressEvent(QKeyEvent* event);
59  virtual bool event(QEvent* event);
60 
61 private:
62  QStringList history;
63  QStringList::iterator it;
64 };
65 
67 
68 #endif
RCommandLine
Copyright (c) 2011-2018 by Andrew Mustun.
Definition: RCommandLine.h:34
gui_global.h
RCommandLine::it
QStringList::iterator it
Definition: RCommandLine.h:63
RCommandLine::triggerCommand
void triggerCommand(const QString &cmd)
Definition: RCommandLine.h:50
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(RMath *)
RCommandLine::completeCommand
void completeCommand(const QString &command)
QCADGUI_EXPORT
#define QCADGUI_EXPORT
Definition: gui_global.h:10
RCommandLine::clearHistory
void clearHistory()
RCommandLine::history
QStringList history
Definition: RCommandLine.h:62
paste
void paste(void docSource, void diDestination, void offset, void scale, void rotation, void flipHorizontal, void flipVertical, void toCurrentLayer, void overwriteLayers, void overwriteBlocks)
Pastes the given document into the current document or into the second given document.
Definition: simple_modify.js:95
RCommandLine::commandConfirmed
void commandConfirmed(const QString &command)
RCommandLine::escape
void escape()