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.
157 lines
6.4 KiB
157 lines
6.4 KiB
13 years ago
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||
|
<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/kernel/qsignal.cpp:42 -->
|
||
|
<html>
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||
|
<title>TQSignal Class</title>
|
||
|
<style type="text/css"><!--
|
||
|
fn { margin-left: 1cm; text-indent: -1cm; }
|
||
|
a:link { color: #004faf; text-decoration: none }
|
||
|
a:visited { color: #672967; text-decoration: none }
|
||
|
body { background: #ffffff; color: black; }
|
||
|
--></style>
|
||
|
</head>
|
||
|
<body>
|
||
|
|
||
|
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||
|
<tr bgcolor="#E5E5E5">
|
||
|
<td valign=center>
|
||
|
<a href="index.html">
|
||
|
<font color="#004faf">Home</font></a>
|
||
|
| <a href="classes.html">
|
||
|
<font color="#004faf">All Classes</font></a>
|
||
|
| <a href="mainclasses.html">
|
||
|
<font color="#004faf">Main Classes</font></a>
|
||
|
| <a href="annotated.html">
|
||
|
<font color="#004faf">Annotated</font></a>
|
||
|
| <a href="groups.html">
|
||
|
<font color="#004faf">Grouped Classes</font></a>
|
||
|
| <a href="functions.html">
|
||
|
<font color="#004faf">Functions</font></a>
|
||
|
</td>
|
||
|
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>TQSignal Class Reference</h1>
|
||
|
|
||
|
<p>The TQSignal class can be used to send signals for classes
|
||
|
that don't inherit TQObject.
|
||
|
<a href="#details">More...</a>
|
||
13 years ago
|
<p><tt>#include <<a href="qsignal-h.html">ntqsignal.h</a>></tt>
|
||
|
<p>Inherits <a href="ntqobject.html">TQObject</a>.
|
||
13 years ago
|
<p><a href="qsignal-members.html">List of all member functions.</a>
|
||
|
<h2>Public Members</h2>
|
||
|
<ul>
|
||
|
<li class=fn><a href="#TQSignal"><b>TQSignal</b></a> ( TQObject * parent = 0, const char * name = 0 )</li>
|
||
|
<li class=fn><a href="#~TQSignal"><b>~TQSignal</b></a> ()</li>
|
||
|
<li class=fn>bool <a href="#connect"><b>connect</b></a> ( const TQObject * receiver, const char * member )</li>
|
||
|
<li class=fn>bool <a href="#disconnect"><b>disconnect</b></a> ( const TQObject * receiver, const char * member = 0 )</li>
|
||
|
<li class=fn>void <a href="#activate"><b>activate</b></a> ()</li>
|
||
|
<li class=fn>void <a href="#setValue"><b>setValue</b></a> ( const TQVariant & value )</li>
|
||
|
<li class=fn>TQVariant <a href="#value"><b>value</b></a> () const</li>
|
||
|
</ul>
|
||
|
<hr><a name="details"></a><h2>Detailed Description</h2>
|
||
|
|
||
|
|
||
|
The TQSignal class can be used to send signals for classes
|
||
13 years ago
|
that don't inherit <a href="ntqobject.html">TQObject</a>.
|
||
13 years ago
|
<p>
|
||
|
|
||
|
<p> 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
|
||
13 years ago
|
signals in the <a href="ntqmenudata.html">TQMenuData</a> class, which is not a TQObject.
|
||
13 years ago
|
<p> In general, we recommend inheriting TQObject instead. TQObject
|
||
|
provides much more functionality.
|
||
13 years ago
|
<p> You can set a single <a href="ntqvariant.html">TQVariant</a> parameter for the signal with
|
||
13 years ago
|
<a href="#setValue">setValue</a>().
|
||
|
<p> Note that TQObject is a <em>private</em> base class of TQSignal, i.e. you
|
||
|
cannot call any TQObject member functions from a TQSignal object.
|
||
|
<p> Example:
|
||
|
<pre>
|
||
13 years ago
|
#include <<a href="qsignal-h.html">ntqsignal.h</a>>
|
||
13 years ago
|
|
||
|
class MyClass
|
||
|
{
|
||
|
public:
|
||
|
MyClass();
|
||
|
~MyClass();
|
||
|
|
||
|
void doSomething();
|
||
|
|
||
13 years ago
|
void connect( <a href="ntqobject.html">TQObject</a> *receiver, const char *member );
|
||
13 years ago
|
|
||
|
private:
|
||
|
TQSignal *sig;
|
||
|
};
|
||
|
|
||
|
MyClass::MyClass()
|
||
|
{
|
||
|
sig = new TQSignal;
|
||
|
}
|
||
|
|
||
|
MyClass::~MyClass()
|
||
|
{
|
||
|
delete sig;
|
||
|
}
|
||
|
|
||
|
void MyClass::doSomething()
|
||
|
{
|
||
|
// ... does something
|
||
|
sig-><a href="#activate">activate</a>(); // emits the signal
|
||
|
}
|
||
|
|
||
13 years ago
|
void MyClass::connect( <a href="ntqobject.html">TQObject</a> *receiver, const char *member )
|
||
13 years ago
|
{
|
||
|
sig-><a href="#connect">connect</a>( receiver, member );
|
||
|
}
|
||
|
</pre>
|
||
|
|
||
|
<p>See also <a href="io.html">Input/Output and Networking</a> and <a href="misc.html">Miscellaneous Classes</a>.
|
||
|
|
||
|
<hr><h2>Member Function Documentation</h2>
|
||
13 years ago
|
<h3 class=fn><a name="TQSignal"></a>TQSignal::TQSignal ( <a href="ntqobject.html">TQObject</a> * parent = 0, const char * name = 0 )
|
||
13 years ago
|
</h3>
|
||
|
Constructs a signal object called <em>name</em>, with the parent object
|
||
13 years ago
|
<em>parent</em>. These arguments are passed directly to <a href="ntqobject.html">TQObject</a>.
|
||
13 years ago
|
|
||
|
<h3 class=fn><a name="~TQSignal"></a>TQSignal::~TQSignal ()
|
||
|
</h3>
|
||
|
Destroys the signal. All connections are removed, as is the case
|
||
|
with all TQObjects.
|
||
|
|
||
|
<h3 class=fn>void <a name="activate"></a>TQSignal::activate ()
|
||
|
</h3>
|
||
|
|
||
13 years ago
|
<p> Emits the signal. If the platform supports <a href="ntqvariant.html">TQVariant</a> and a
|
||
13 years ago
|
parameter has been set with <a href="#setValue">setValue</a>(), this value is passed in
|
||
|
the signal.
|
||
|
|
||
13 years ago
|
<h3 class=fn>bool <a name="connect"></a>TQSignal::connect ( const <a href="ntqobject.html">TQObject</a> * receiver, const char * member )
|
||
13 years ago
|
</h3>
|
||
|
Connects the signal to <em>member</em> in object <em>receiver</em>.
|
||
13 years ago
|
<p> <p>See also <a href="#disconnect">disconnect</a>() and <a href="ntqobject.html#connect">TQObject::connect</a>().
|
||
13 years ago
|
|
||
13 years ago
|
<h3 class=fn>bool <a name="disconnect"></a>TQSignal::disconnect ( const <a href="ntqobject.html">TQObject</a> * receiver, const char * member = 0 )
|
||
13 years ago
|
</h3>
|
||
|
Disonnects the signal from <em>member</em> in object <em>receiver</em>.
|
||
13 years ago
|
<p> <p>See also <a href="#connect">connect</a>() and <a href="ntqobject.html#disconnect">TQObject::disconnect</a>().
|
||
13 years ago
|
|
||
13 years ago
|
<h3 class=fn>void <a name="setValue"></a>TQSignal::setValue ( const <a href="ntqvariant.html">TQVariant</a> & value )
|
||
13 years ago
|
</h3>
|
||
|
Sets the signal's parameter to <em>value</em>
|
||
|
|
||
13 years ago
|
<h3 class=fn><a href="ntqvariant.html">TQVariant</a> <a name="value"></a>TQSignal::value () const
|
||
13 years ago
|
</h3>
|
||
|
Returns the signal's parameter
|
||
|
|
||
|
<!-- eof -->
|
||
|
<hr><p>
|
||
|
This file is part of the <a href="index.html">TQt toolkit</a>.
|
||
|
Copyright © 1995-2007
|
||
|
<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
||
|
<table width=100% cellspacing=0 border=0><tr>
|
||
|
<td>Copyright © 2007
|
||
|
<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
||
|
<td align=right><div align=right>TQt 3.3.8</div>
|
||
|
</table></div></address></body>
|
||
|
</html>
|