VTK  9.0.1
vtkEventQtSlotConnect.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Copyright 2004 Sandia Corporation.
4  Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
5  license for use of this work by or on behalf of the
6  U.S. Government. Redistribution and use in source and binary forms, with
7  or without modification, are permitted provided that this Notice and any
8  statement of authorship are reproduced on all copies.
9 
10 =========================================================================*/
11 
12 /*========================================================================
13  For general information about using VTK and Qt, see:
14  http://www.trolltech.com/products/3rdparty/vtksupport.html
15 =========================================================================*/
16 
17 /*========================================================================
18  !!! WARNING for those who want to contribute code to this file.
19  !!! If you use a commercial edition of Qt, you can modify this code.
20  !!! If you use an open source version of Qt, you are free to modify
21  !!! and use this code within the guidelines of the GPL license.
22  !!! Unfortunately, you cannot contribute the changes back into this
23  !!! file. Doing so creates a conflict between the GPL and BSD-like VTK
24  !!! license.
25 =========================================================================*/
26 
43 #ifndef vtkEventQtSlotConnect_h
44 #define vtkEventQtSlotConnect_h
45 
46 #include "QVTKWin32Header.h" // for export define
47 #include "vtkCommand.h" // for event defines
48 #include "vtkGUISupportQtModule.h" // For export macro
49 #include "vtkObject.h"
50 #include <QtCore/QObject> // for version info
51 
52 class QObject;
53 class vtkQtConnections;
54 class vtkQtConnection;
55 
56 // manage connections between VTK object events and Qt slots
57 class VTKGUISUPPORTQT_EXPORT vtkEventQtSlotConnect : public vtkObject
58 {
59 public:
60  static vtkEventQtSlotConnect* New();
62 
66  void PrintSelf(ostream& os, vtkIndent indent) override;
67 
72  virtual void Connect(vtkObject* vtk_obj, unsigned long event, const QObject* qt_obj,
73  const char* slot, void* client_data = nullptr, float priority = 0.0,
74  Qt::ConnectionType type = Qt::AutoConnection);
75 
84  virtual void Disconnect(vtkObject* vtk_obj = nullptr, unsigned long event = vtkCommand::NoEvent,
85  const QObject* qt_obj = nullptr, const char* slot = nullptr, void* client_data = nullptr);
86 
91  virtual int GetNumberOfConnections() const;
92 
93 protected:
94  vtkQtConnections* Connections;
95  friend class vtkQtConnection;
96  void RemoveConnection(vtkQtConnection*);
97 
99  ~vtkEventQtSlotConnect() override;
100 
101 private:
103  void operator=(const vtkEventQtSlotConnect&) = delete;
104 };
105 
106 #endif
vtkX3D::type
@ type
Definition: vtkX3D.h:522
vtkEventQtSlotConnect
Manage connections between VTK events and Qt slots.
Definition: vtkEventQtSlotConnect.h:57
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkCommand.h
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkQtConnection
Definition: vtkQtConnection.h:43
vtkCommand::NoEvent
@ NoEvent
Definition: vtkCommand.h:445
vtkObject::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkEventQtSlotConnect::Connections
vtkQtConnections * Connections
Definition: vtkEventQtSlotConnect.h:94
vtkObject.h
QVTKWin32Header.h
vtkX3D::priority
@ priority
Definition: vtkX3D.h:456