pqPythonCalculatorCompleter.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
3 #ifndef pqPythonCalculatorCompleter_h
4 #define pqPythonCalculatorCompleter_h
5 
6 #include "pqPythonCompleter.h"
7 #include "vtkSMSourceProxy.h" // For vtkSMSourceProxy
8 
14 class PQPYTHON_EXPORT pqPythonCalculatorCompleter : public pqPythonCompleter
15 {
16 public:
18  : pqPythonCompleter(parent)
19  , Input(input)
20  {
21  this->setCompleteEmptyPrompts(true); // Override pqPythonCompleter default
22  }
23 
24  struct FunctionInfo
25  {
26  QString name;
27  QString docstring;
28  QString module;
29  };
30 
36  static QList<FunctionInfo> getFunctionInfos(const QStringList& ignoredModules = {});
37 
38 protected:
39  QStringList getPythonCompletions(const QString& pythonObjectName, bool call) override;
40 
45  void AddArrayNamesToResults(
46  const vtkPVDataSetAttributesInformation* attributesInformation, QStringList& results);
47 
48 private:
49  vtkSMSourceProxy* Input; // Needed to retrieve input field names
50 };
51 #endif
Completer to be used for the Python calculator expression field.
Abstract class for Python completers.
proxy for a VTK source on a server
void setCompleteEmptyPrompts(bool newValue)
get/set CompleteEmptyPrompts, indicating whether or not the completer should show anything if an empt...
pqPythonCalculatorCompleter(QWidget *parent, vtkSMSourceProxy *input)