pqPythonScriptEditor.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
4 #ifndef pqPythonScriptEditor_h
5 #define pqPythonScriptEditor_h
6 
7 #include "pqPythonModule.h"
8 
9 #include "pqCoreUtilities.h"
10 #include "pqPythonEditorActions.h"
11 
12 #include <QMainWindow>
13 
14 class QAction;
15 class QMenu;
16 
17 class pqPythonManager;
18 class pqPythonTabWidget;
19 
40 class PQPYTHON_EXPORT pqPythonScriptEditor : public QMainWindow
41 {
42  Q_OBJECT
43 
44 public:
45  explicit pqPythonScriptEditor(QWidget* parent = nullptr);
46 
52  void setSaveDialogDefaultDirectory(const QString& dir);
53 
57  void setPythonManager(pqPythonManager* manager);
58 
62  void scrollToBottom();
63 
67  void open(const QString& filename);
68 
72  void load(const QString& filename);
73 
77  void updateTrace(const QString& str);
78 
82  void stopTrace(const QString& str);
83 
87  void runCurrentTab();
88 
92  static pqPythonScriptEditor* getUniqueInstance();
93 
97  static void updateMacroList();
98 
102  static void updateScriptList();
103 
108  static void linkTo(QTextEdit* obj);
109 
113  static void bringFront();
114 
118  static QString getMacrosDir();
119 
123  static QString getScriptsDir();
124 
125 protected:
130  void closeEvent(QCloseEvent* event) override;
131 
132 private:
133  void createMenus();
134 
135  void createStatusBar();
136 
137  QMenu* fileMenu = nullptr;
138  QMenu* editMenu = nullptr;
139 
140  using ScriptActionType = pqPythonEditorActions::ScriptAction::Type;
142 
143  pqPythonTabWidget* TabWidget;
144 
145  pqPythonEditorActions Actions;
146 
150  pqPythonManager* PythonManager;
151 
155  static pqPythonScriptEditor* UniqueInstance;
156 };
157 
158 #endif
Encapsulates the multitab python editor.
Stack array using an enum as indexer.
Definition: pqPythonUtils.h:61
#define PQPYTHON_EXPORT
load
dir
pqPythonManager is a class to facilitate the use of a python interpreter by various paraview GUI comp...