VTK  9.3.0
QQuickVTKInteractiveWidget.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
11 #ifndef QQuickVTKInteractiveWidget_h
12 #define QQuickVTKInteractiveWidget_h
13 
14 // Qt includes
15 #include <QObject>
16 
17 // vtk includes
18 #include "vtkDeprecation.h"
19 #include "vtkGUISupportQtQuickModule.h" // for export macro
20 #include "vtkWeakPointer.h" // For vtkWeakPointer
21 
22 // Forward declarations
23 VTK_ABI_NAMESPACE_BEGIN
24 class vtkAbstractWidget;
25 class vtkRenderer;
26 
28  "Use QQuickVTKItem instead") VTKGUISUPPORTQTQUICK_EXPORT QQuickVTKInteractiveWidget
29  : public QObject
30 {
31  Q_OBJECT
32  typedef QObject Superclass;
33 
34  Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged);
35 
36 public:
37  QQuickVTKInteractiveWidget(QObject* parent = nullptr);
38  ~QQuickVTKInteractiveWidget() override = default;
39 
41 
47 
49 
52  void setEnabled(bool e);
53  bool enabled() const;
55 
56 public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
57  virtual void sync(vtkRenderer* ren);
58 
59 Q_SIGNALS:
60  void enabledChanged(bool e);
61 
62 protected:
63  // Helper members
65 
66  // Enabled/disabled
67  bool m_enabled = false;
68 
69 private:
71  void operator=(const QQuickVTKInteractiveWidget) = delete;
72 };
73 
74 VTK_ABI_NAMESPACE_END
75 #endif // QQuickVTKInteractiveWidget_h
QObject that manages a VTK interactive widget to ensure that it behaves as per the QtQuick threaded r...
QQuickVTKInteractiveWidget(QObject *parent=nullptr)
void setWidget(vtkAbstractWidget *w)
Set/Get the widget reference.
virtual void sync(vtkRenderer *ren)
vtkWeakPointer< vtkAbstractWidget > m_widget
bool enabled() const
Set/Get whether the widget is enabled.
vtkAbstractWidget * widget() const
Set/Get the widget reference.
~QQuickVTKInteractiveWidget() override=default
void setEnabled(bool e)
Set/Get whether the widget is enabled.
QQuickItem that manages a VTK rendering in the QML scenegraph.
Definition: QQuickVTKItem.h:27
define the API for widget / widget representation
abstract specification for renderers
Definition: vtkRenderer.h:62
@ enabled
Definition: vtkX3D.h:259
#define VTK_DEPRECATED_IN_9_3_0(reason)