VTK  9.3.1
vtkQWidgetWidget.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
19 #ifndef vtkQWidgetWidget_h
20 #define vtkQWidgetWidget_h
21 
22 #include "vtkAbstractWidget.h"
23 #include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
24 #include "vtkGUISupportQtModule.h" // For export macro
25 #include <QPointF> // for ivar
26 
27 class QWidget;
28 
29 VTK_ABI_NAMESPACE_BEGIN
31 
32 class VTKGUISUPPORTQT_EXPORT vtkQWidgetWidget : public vtkAbstractWidget
33 {
34  friend class vtkInteractionCallback;
35 
36 public:
40  static vtkQWidgetWidget* New();
41 
43 
47  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
55  void SetRepresentation(vtkQWidgetRepresentation* rep);
56 
57  // Description:
58  // Disable/Enable the widget if needed.
59  // Unobserved the camera if the widget is disabled.
60  void SetEnabled(int enabling) override;
61 
65  vtkQWidgetRepresentation* GetQWidgetRepresentation();
66 
70  void CreateDefaultRepresentation() override;
71 
75  void SetWidget(QWidget* w);
76  QWidget* GetWidget() { return this->Widget; }
77 
78 protected:
80  ~vtkQWidgetWidget() override;
81 
82  // Manage the state of the widget
85  {
86  Start = 0,
87  Active
88  };
89 #if !defined(VTK_LEGACY_REMOVE)
90  VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
92 #endif
93 
94  QWidget* Widget;
98 
99  // These methods handle events
100  static void SelectAction3D(vtkAbstractWidget*);
101  static void EndSelectAction3D(vtkAbstractWidget*);
102  static void MoveAction3D(vtkAbstractWidget*);
103 
104 private:
105  vtkQWidgetWidget(const vtkQWidgetWidget&) = delete;
106  void operator=(const vtkQWidgetWidget&) = delete;
107 };
108 
109 VTK_ABI_NAMESPACE_END
110 #endif
#define VTK_DEPRECATED_IN_9_2_0(reason)
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros implementing standard VTK methods.
3D VTK widget for a QWidget
virtual void CreateDefaultRepresentation()=0
Create the default widget representation if one is not set.
a class defining the representation for a vtkQWidgetWidget
QPointF SteadyWidgetCoordinates
a simple class to control print indentation
Definition: vtkIndent.h:28
QWidget * GetWidget()
define the API for widget / widget representation
void SetEnabled(int) override
Methods for activating this widget.
QPointF LastWidgetCoordinates
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...