You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
166 lines
4.5 KiB
166 lines
4.5 KiB
'\" t
|
|
.TH TQSignal 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*-
|
|
.\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
|
|
.\" license file included in the distribution for a complete license
|
|
.\" statement.
|
|
.\"
|
|
.ad l
|
|
.nh
|
|
.SH NAME
|
|
TQSignal \- Can be used to send signals for classes that don't inherit TQObject
|
|
.SH SYNOPSIS
|
|
\fC#include <tqsignal.h>\fR
|
|
.PP
|
|
Inherits TQObject.
|
|
.PP
|
|
.SS "Public Members"
|
|
.in +1c
|
|
.ti -1c
|
|
.BI "\fBTQSignal\fR ( TQObject * parent = 0, const char * name = 0 )"
|
|
.br
|
|
.ti -1c
|
|
.BI "\fB~TQSignal\fR ()"
|
|
.br
|
|
.ti -1c
|
|
.BI "bool \fBconnect\fR ( const TQObject * receiver, const char * member )"
|
|
.br
|
|
.ti -1c
|
|
.BI "bool \fBdisconnect\fR ( const TQObject * receiver, const char * member = 0 )"
|
|
.br
|
|
.ti -1c
|
|
.BI "void \fBactivate\fR ()"
|
|
.br
|
|
.ti -1c
|
|
.BI "void \fBsetValue\fR ( const QVariant & value )"
|
|
.br
|
|
.ti -1c
|
|
.BI "QVariant \fBvalue\fR () const"
|
|
.br
|
|
.in -1c
|
|
.SH DESCRIPTION
|
|
The TQSignal class can be used to send signals for classes that don't inherit TQObject.
|
|
.PP
|
|
If you want to send signals from a class that does not inherit TQObject, you can create an internal TQSignal object to emit the signal. You must also provide a function that connects the signal to an outside object slot. This is how we have implemented signals in the TQMenuData class, which is not a TQObject.
|
|
.PP
|
|
In general, we recommend inheriting TQObject instead. TQObject provides much more functionality.
|
|
.PP
|
|
You can set a single QVariant parameter for the signal with setValue().
|
|
.PP
|
|
Note that TQObject is a \fIprivate\fR base class of TQSignal, i.e. you cannot call any TQObject member functions from a TQSignal object.
|
|
.PP
|
|
Example:
|
|
.PP
|
|
.nf
|
|
.br
|
|
#include <tqsignal.h>
|
|
.br
|
|
.br
|
|
class MyClass
|
|
.br
|
|
{
|
|
.br
|
|
public:
|
|
.br
|
|
MyClass();
|
|
.br
|
|
~MyClass();
|
|
.br
|
|
.br
|
|
void doSomething();
|
|
.br
|
|
.br
|
|
void connect( TQObject *receiver, const char *member );
|
|
.br
|
|
.br
|
|
private:
|
|
.br
|
|
TQSignal *sig;
|
|
.br
|
|
};
|
|
.br
|
|
.br
|
|
MyClass::MyClass()
|
|
.br
|
|
{
|
|
.br
|
|
sig = new TQSignal;
|
|
.br
|
|
}
|
|
.br
|
|
.br
|
|
MyClass::~MyClass()
|
|
.br
|
|
{
|
|
.br
|
|
delete sig;
|
|
.br
|
|
}
|
|
.br
|
|
.br
|
|
void MyClass::doSomething()
|
|
.br
|
|
{
|
|
.br
|
|
// ... does something
|
|
.br
|
|
sig->activate(); // emits the signal
|
|
.br
|
|
}
|
|
.br
|
|
.br
|
|
void MyClass::connect( TQObject *receiver, const char *member )
|
|
.br
|
|
{
|
|
.br
|
|
sig->connect( receiver, member );
|
|
.br
|
|
}
|
|
.br
|
|
.fi
|
|
.PP
|
|
See also Input/Output and Networking and Miscellaneous Classes.
|
|
.SH MEMBER FUNCTION DOCUMENTATION
|
|
.SH "TQSignal::TQSignal ( TQObject * parent = 0, const char * name = 0 )"
|
|
Constructs a signal object called \fIname\fR, with the parent object \fIparent\fR. These arguments are passed directly to TQObject.
|
|
.SH "TQSignal::~TQSignal ()"
|
|
Destroys the signal. All connections are removed, as is the case with all TQObjects.
|
|
.SH "void TQSignal::activate ()"
|
|
Emits the signal. If the platform supports QVariant and a parameter has been set with setValue(), this value is passed in the signal.
|
|
.SH "bool TQSignal::connect ( const TQObject * receiver, const char * member )"
|
|
Connects the signal to \fImember\fR in object \fIreceiver\fR.
|
|
.PP
|
|
See also disconnect() and TQObject::connect().
|
|
.SH "bool TQSignal::disconnect ( const TQObject * receiver, const char * member = 0 )"
|
|
Disonnects the signal from \fImember\fR in object \fIreceiver\fR.
|
|
.PP
|
|
See also connect() and TQObject::disconnect().
|
|
.SH "void TQSignal::setValue ( const QVariant & value )"
|
|
Sets the signal's parameter to \fIvalue\fR
|
|
.SH "QVariant TQSignal::value () const"
|
|
Returns the signal's parameter
|
|
|
|
.SH "SEE ALSO"
|
|
.BR http://doc.trolltech.com/tqsignal.html
|
|
.BR http://www.trolltech.com/faq/tech.html
|
|
.SH COPYRIGHT
|
|
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
|
|
license file included in the distribution for a complete license
|
|
statement.
|
|
.SH AUTHOR
|
|
Generated automatically from the source code.
|
|
.SH BUGS
|
|
If you find a bug in Qt, please report it as described in
|
|
.BR http://doc.trolltech.com/bughowto.html .
|
|
Good bug reports help us to help you. Thank you.
|
|
.P
|
|
The definitive TQt documentation is provided in HTML format; it is
|
|
located at $TQTDIR/doc/html and can be read using TQt Assistant or with
|
|
a web browser. This man page is provided as a convenience for those
|
|
users who prefer man pages, although this format is not officially
|
|
supported by Trolltech.
|
|
.P
|
|
If you find errors in this manual page, please report them to
|
|
.BR qt-bugs@trolltech.com .
|
|
Please include the name of the manual page (tqsignal.3qt) and the Qt
|
|
version (3.3.8).
|