Geometrize  1.0
An application for geometrizing images into geometric primitives
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
scriptconsole.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <memory>
4 #include <string>
5 #include <vector>
6 
7 #include <QWidget>
8 
9 class QEvent;
10 
11 namespace chaiscript
12 {
13 class ChaiScript;
14 }
15 
16 namespace geometrize
17 {
18 
19 namespace dialog
20 {
21 
25 class ScriptConsole : public QWidget
26 {
27  Q_OBJECT
28 
29 public:
30  explicit ScriptConsole(QWidget* parent = nullptr);
31  virtual ~ScriptConsole();
32 
33  static const std::string launchConsoleHistoryFilename;
34 
35  void setEngine(chaiscript::ChaiScript* engine);
36  std::vector<std::string> getHistory() const;
37  void setHistory(const std::vector<std::string>& history);
38 
43  void appendString(const std::string& str);
44 
45 protected:
46  void changeEvent(QEvent*) override;
47 
48 private:
50  std::unique_ptr<ScriptConsoleImpl> d;
51 };
52 
53 }
54 
55 }
std::unique_ptr< ScriptConsoleImpl > d
Definition: scriptconsole.h:49
void setEngine(chaiscript::ChaiScript *engine)
Definition: scriptconsole.cpp:122
void appendString(const std::string &str)
appendString Appends a string to the console output window
Definition: scriptconsole.cpp:137
std::vector< std::string > getHistory() const
Definition: scriptconsole.cpp:127
virtual ~ScriptConsole()
Definition: scriptconsole.cpp:118
static const std::string launchConsoleHistoryFilename
The name of the console history settings file used by the console embedded in the launch window...
Definition: scriptconsole.h:33
void changeEvent(QEvent *) override
Definition: scriptconsole.cpp:142
void setHistory(const std::vector< std::string > &history)
Definition: scriptconsole.cpp:132
The ScriptConsole class models a command line and output window.
Definition: scriptconsole.h:25
ScriptConsole(QWidget *parent=nullptr)
Definition: scriptconsole.cpp:114