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
48#ifndef vtkEventQtSlotConnect_h
49#define vtkEventQtSlotConnect_h
50
51#include "vtkGUISupportQtModule.h" // For export macro
52#include "vtkObject.h"
53#include "vtkCommand.h" // for event defines
54#include "QVTKWin32Header.h" // for export define
55#include <QtCore/QObject> // for version info
56
57class QObject;
58class vtkQtConnections;
59class vtkQtConnection;
60
61// manage connections between VTK object events and Qt slots
62class VTKGUISUPPORTQT_EXPORT vtkEventQtSlotConnect : public vtkObject
63{
64 public:
67
68
71 void PrintSelf(ostream& os, vtkIndent indent);
72
77 virtual void Connect(vtkObject* vtk_obj, unsigned long event,
78 const QObject* qt_obj, const char* slot,
79 void* client_data=NULL, float priority=0.0
80 ,Qt::ConnectionType type = Qt::AutoConnection);
81
90 virtual void Disconnect(
91 vtkObject* vtk_obj=NULL, unsigned long event=vtkCommand::NoEvent,
92 const QObject* qt_obj=NULL, const char* slot = 0, void* client_data=NULL);
93
98 virtual int GetNumberOfConnections() const;
99
100 protected:
101 vtkQtConnections* Connections;
102 friend class vtkQtConnection;
103 void RemoveConnection(vtkQtConnection*);
104
107
108 private:
109 vtkEventQtSlotConnect(const vtkEventQtSlotConnect&) VTK_DELETE_FUNCTION;
110 void operator=(const vtkEventQtSlotConnect&) VTK_DELETE_FUNCTION;
111};
112
113#endif
superclass for callback/observer methods
Definition: vtkCommand.h:342
Manage connections between VTK events and Qt slots.
static vtkEventQtSlotConnect * New()
a simple class to control print indentation
Definition: vtkIndent.h:40
abstract base class for most VTK objects
Definition: vtkObject.h:60
@ priority
Definition: vtkX3D.h:450
@ type
Definition: vtkX3D.h:516