1QSignal(3qt)                                                      QSignal(3qt)
2
3
4

NAME

6       QSignal - Can be used to send signals for classes that don't inherit
7       QObject
8

SYNOPSIS

10       #include <qsignal.h>
11
12       Inherits QObject.
13
14   Public Members
15       QSignal ( QObject * parent = 0, const char * name = 0 )
16       ~QSignal ()
17       bool connect ( const QObject * receiver, const char * member )
18       bool disconnect ( const QObject * receiver, const char * member = 0 )
19       void activate ()
20       bool isBlocked () const  (obsolete)
21       void block ( bool b )  (obsolete)
22       void setParameter ( int value )  (obsolete)
23       int parameter () const  (obsolete)
24       void setValue ( const QVariant & value )
25       QVariant value () const
26

DESCRIPTION

28       The QSignal class can be used to send signals for classes that don't
29       inherit QObject.
30
31       If you want to send signals from a class that does not inherit QObject,
32       you can create an internal QSignal object to emit the signal. You must
33       also provide a function that connects the signal to an outside object
34       slot. This is how we have implemented signals in the QMenuData class,
35       which is not a QObject.
36
37       In general, we recommend inheriting QObject instead. QObject provides
38       much more functionality.
39
40       You can set a single QVariant parameter for the signal with setValue().
41
42       Note that QObject is a private base class of QSignal, i.e. you cannot
43       call any QObject member functions from a QSignal object.
44
45       Example:
46
47               #include <qsignal.h>
48               class MyClass
49               {
50               public:
51                   MyClass();
52                   ~MyClass();
53                   void doSomething();
54                   void connect( QObject *receiver, const char *member );
55               private:
56                   QSignal *sig;
57               };
58               MyClass::MyClass()
59               {
60                   sig = new QSignal;
61               }
62               MyClass::~MyClass()
63               {
64                   delete sig;
65               }
66               void MyClass::doSomething()
67               {
68                   // ... does something
69                   sig->activate(); // emits the signal
70               }
71               void MyClass::connect( QObject *receiver, const char *member )
72               {
73                   sig->connect( receiver, member );
74               }
75
76       See also Input/Output and Networking and Miscellaneous Classes.
77

MEMBER FUNCTION DOCUMENTATION

QSignal::QSignal ( QObject * parent = 0, const char * name = 0 )

80       Constructs a signal object called name, with the parent object parent.
81       These arguments are passed directly to QObject.
82

QSignal::~QSignal ()

84       Destroys the signal. All connections are removed, as is the case with
85       all QObjects.
86

void QSignal::activate ()

88       Emits the signal. If the platform supports QVariant and a parameter has
89       been set with setValue(), this value is passed in the signal.
90

void QSignal::block ( bool b )

92       This function is obsolete. It is provided to keep old source working.
93       We strongly advise against using it in new code.
94
95       Blocks the signal if b is TRUE, or unblocks the signal if b is FALSE.
96
97       An activated signal disappears into hyperspace if it is blocked.
98
99       See also isBlocked(), activate(), and QObject::blockSignals().
100

bool QSignal::connect ( const QObject * receiver, const char * member )

102       Connects the signal to member in object receiver.
103
104       See also disconnect() and QObject::connect().
105

bool QSignal::disconnect ( const QObject * receiver, const char * member = 0 )

107
108       Disonnects the signal from member in object receiver.
109
110       See also connect() and QObject::disconnect().
111

bool QSignal::isBlocked () const

113       This function is obsolete. It is provided to keep old source working.
114       We strongly advise against using it in new code.
115
116       Returns TRUE if the signal is blocked, or FALSE if it is not blocked.
117
118       The signal is not blocked by default.
119
120       See also block() and QObject::signalsBlocked().
121

int QSignal::parameter () const

123       This function is obsolete. It is provided to keep old source working.
124       We strongly advise against using it in new code.
125

void QSignal::setParameter ( int value )

127       This function is obsolete. It is provided to keep old source working.
128       We strongly advise against using it in new code.
129

void QSignal::setValue ( const QVariant & value )

131       Sets the signal's parameter to value
132

QVariant QSignal::value () const

134       Returns the signal's parameter
135
136

SEE ALSO

138       http://doc.trolltech.com/qsignal.html
139       http://www.trolltech.com/faq/tech.html
140
142       Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com.  See the
143       license file included in the distribution for a complete license
144       statement.
145

AUTHOR

147       Generated automatically from the source code.
148

BUGS

150       If you find a bug in Qt, please report it as described in
151       http://doc.trolltech.com/bughowto.html.  Good bug reports help us to
152       help you. Thank you.
153
154       The definitive Qt documentation is provided in HTML format; it is
155       located at $QTDIR/doc/html and can be read using Qt Assistant or with a
156       web browser. This man page is provided as a convenience for those users
157       who prefer man pages, although this format is not officially supported
158       by Trolltech.
159
160       If you find errors in this manual page, please report them to qt-
161       bugs@trolltech.com.  Please include the name of the manual page
162       (qsignal.3qt) and the Qt version (3.3.8).
163
164
165
166Trolltech AS                    2 February 2007                   QSignal(3qt)
Impressum