Geometrize  1.0
An application for geometrizing images into geometric primitives
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
commandlineedit.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <memory>
4 #include <string>
5 
6 #include <QWidget>
7 
8 class QEvent;
9 
10 namespace chaiscript
11 {
12 class ChaiScript;
13 }
14 
15 namespace geometrize
16 {
17 
18 namespace dialog
19 {
20 
24 class CommandLineEdit : public QWidget
25 {
26  Q_OBJECT
27 
28 public:
29  explicit CommandLineEdit(QWidget* parent = nullptr);
30  virtual ~CommandLineEdit();
31 
35  void clearHistory();
36 
41  std::vector<std::string> getHistory() const;
42 
47  void setHistory(const std::vector<std::string>& history);
48 
53  void setCompletionList(const std::vector<std::string>& completionList);
54 
55 signals:
59  void signal_commandSubmitted(const std::string&);
60 
64  void signal_historyStepped(const std::string&);
65 
66 protected:
67  void changeEvent(QEvent*) override;
68 
69 private:
70  virtual void keyPressEvent(QKeyEvent* e) override;
71  virtual bool focusNextPrevChild(bool next) override;
72  virtual void mouseDoubleClickEvent(QMouseEvent* event) override;
73 
75  std::unique_ptr<CommandLineEditImpl> d;
76 };
77 
78 }
79 
80 }
CommandLineEdit(QWidget *parent=nullptr)
Definition: commandlineedit.cpp:148
std::unique_ptr< CommandLineEditImpl > d
Definition: commandlineedit.h:74
virtual bool focusNextPrevChild(bool next) override
Definition: commandlineedit.cpp:181
void changeEvent(QEvent *) override
Definition: commandlineedit.cpp:191
void signal_historyStepped(const std::string &)
signal_historyStepped is fired when the user steps through the command line history (e...
virtual ~CommandLineEdit()
Definition: commandlineedit.cpp:152
void setCompletionList(const std::vector< std::string > &completionList)
setCompletionList Sets the autocomplete list of commands.
Definition: commandlineedit.cpp:176
void setHistory(const std::vector< std::string > &history)
setHistory Sets the history of commands.
Definition: commandlineedit.cpp:171
virtual void keyPressEvent(QKeyEvent *e) override
Definition: commandlineedit.cpp:156
std::vector< std::string > getHistory() const
getHistory Gets the history of commands entered this session, oldest first.
Definition: commandlineedit.cpp:166
The CommandLineEdit class models the UI for the command line in a graphical script console...
Definition: commandlineedit.h:24
virtual void mouseDoubleClickEvent(QMouseEvent *event) override
Definition: commandlineedit.cpp:186
void clearHistory()
clearHistory Wipe the history of commands entered this session.
Definition: commandlineedit.cpp:161
void signal_commandSubmitted(const std::string &)
signal_commandSubmitted is fired when a command is submitted by the user (e.g. after pressing return)...