pqConsoleWidget.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 
5 #ifndef pqConsoleWidget_h
6 #define pqConsoleWidget_h
7 
8 #include "pqWidgetCompleter.h"
9 #include "pqWidgetsModule.h"
10 
11 #include <QTextCharFormat>
12 #include <QWidget>
13 
21 class PQWIDGETS_EXPORT pqConsoleWidget : public QWidget
22 {
23  Q_OBJECT
24 
25 public:
26  pqConsoleWidget(QWidget* parent = nullptr);
27  ~pqConsoleWidget() override;
28 
32  QTextCharFormat getFormat();
36  void setFormat(const QTextCharFormat& Format);
37 
41  void setCompleter(pqWidgetCompleter* completer);
42 
43  QPoint getCursorPosition();
44 
48  void setFontSize(int size);
49 
50 Q_SIGNALS:
54  void executeCommand(const QString& Command);
55 
59  void consoleFocusInEvent();
60 
61 public Q_SLOTS:
65  void printString(const QString& Text);
66 
71  void printCommand(const QString& cmd);
72 
76  QString text();
77 
81  void clear();
82 
89  void prompt(const QString& text);
90 
96  void insertCompletion(const QString& text);
97 
101  void takeFocus();
102 
103 private:
105  pqConsoleWidget& operator=(const pqConsoleWidget&);
106 
107  void internalExecuteCommand(const QString& Command);
108 
109  class pqImplementation;
110  pqImplementation* const Implementation;
111  friend class pqImplementation;
112 
114 
115  int FontSize;
116 
121  void printAndExecuteCommand(const QString& text);
122 };
123 
124 #endif // pqConsoleWidget_h
Text
Abstact class for widget completers.
#define PQWIDGETS_EXPORT
size
Qt widget that provides an interactive console - you can send text to the console by calling printStr...
pqConsoleWidgetEventPlayer is used to play back test commands recorded by pqConsoleWidgetEventTransla...