VTK
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 
47 #ifndef VTK_EVENT_QT_SLOT_CONNECT
48 #define VTK_EVENT_QT_SLOT_CONNECT
49 
50 #include "vtkObject.h"
51 #include "vtkCommand.h" // for event defines
52 #include "QVTKWin32Header.h" // for export define
53 #include "qobject.h" // for version info
54 
55 class QObject;
56 class vtkQtConnections;
57 class vtkQtConnection;
58 
59 // manage connections between VTK object events and Qt slots
60 class QVTK_EXPORT vtkEventQtSlotConnect : public vtkObject
61 {
62  public:
63  static vtkEventQtSlotConnect* New();
65 
66 
67  void PrintSelf(ostream& os, vtkIndent indent);
68 
70 
73  virtual void Connect(vtkObject* vtk_obj, unsigned long event,
74  const QObject* qt_obj, const char* slot,
75  void* client_data=NULL, float priority=0.0
76  ,Qt::ConnectionType type = Qt::AutoConnection);
78 
80 
85  virtual void Disconnect(
86  vtkObject* vtk_obj=NULL, unsigned long event=vtkCommand::NoEvent,
87  const QObject* qt_obj=NULL, const char* slot = 0, void* client_data=NULL);
89 
90  protected:
91  vtkQtConnections* Connections;
92  friend class vtkQtConnection;
93  void RemoveConnection(vtkQtConnection*);
94 
97 
98  private:
99  // unimplemented
101  void operator=(const vtkEventQtSlotConnect&);
102 };
103 
104 #endif
105