pqPythonCompleter.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
3 #ifndef pqPythonCompleter_h
4 #define pqPythonCompleter_h
5 
6 #include "vtkPython.h"
7 
8 #include "pqPythonModule.h" // needed for PQPYTHON_EXPORT.
9 #include "pqWidgetCompleter.h" // Defines pqWidgetCompleter interface
10 
16 {
17 public:
18  pqPythonCompleter(QWidget* parent)
19  : pqWidgetCompleter(parent){};
20 
21 protected:
22  QStringList getCompletions(const QString& prompt) override;
23  QString getCompletionPrefix(const QString& prompt) override;
24 
29  QString getVariableToComplete(const QString& prompt);
30 
34  void appendPyObjectAttributes(PyObject* object, QStringList& results);
35 
42  PyObject* derivePyObject(const QString& pythonObjectName, PyObject* locals);
43 
48  virtual QStringList getPythonCompletions(const QString& pythonObjectName) = 0;
49 };
50 #endif
virtual QString getCompletionPrefix(const QString &prompt)=0
Return the part of the prompt that can be completed.
Abstact class for widget completers.
#define PQPYTHON_EXPORT
Abstract class for Python completers.
pqPythonCompleter(QWidget *parent)
virtual QStringList getCompletions(const QString &prompt)=0
Return a list of strings that could match the given prompt.
struct _object PyObject