Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 4442dd9bdde98a1d9ca2177557e87d7d > files > 586

libqxt-devel-0.6.1-3.fc15.i686.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- /builddir/build/BUILD/libqxt/src/core/qxtslotmapper.cpp -->
<head>
  <title>QxtSlotMapper Class Reference</title>
  <link href="stylesheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://libqxt.org"><img src="images/qxt-logo.png" width="50" height="40" align="left" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">Classes</font></a>&nbsp;&middot; <a href="namespaces.html"><font color="#004faf">Namespaces</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230"></td></tr></table><h1 class="title">QxtSlotMapper Class Reference<br /><span class="small-subtitle">[<a href="qxtcore.html">QxtCore</a> module]</span>
</h1>
<p>The QxtSlotMapper class maps signals with a specific parameter value to certain slots. <a href="#details">More...</a></p>
<pre>    #include &lt;QxtSlotMapper&gt;</pre><p>Inherits <a href="http://doc.qtsoftware.com/4.5/qobject.html">QObject</a>.</p>
<ul>
<li><a href="qxtslotmapper-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h3>Public Functions</h3>
<ul>
<li><div class="fn"></div><b><a href="qxtslotmapper.html#QxtSlotMapper">QxtSlotMapper</a></b> ( QObject * <i>parent</i> = 0 )</li>
<li><div class="fn"></div><b><a href="qxtslotmapper.html#dtor.QxtSlotMapper">~QxtSlotMapper</a></b> ()</li>
<li><div class="fn"></div>void <b><a href="qxtslotmapper.html#addMapping">addMapping</a></b> ( const QVariant &amp; <i>parameter</i>, QObject * <i>receiver</i>, const char * <i>member</i> )</li>
<li><div class="fn"></div>bool <b><a href="qxtslotmapper.html#connect">connect</a></b> ( const QObject * <i>sender</i>, const char * <i>signal</i> )</li>
<li><div class="fn"></div>void <b><a href="qxtslotmapper.html#removeMapping">removeMapping</a></b> ( const QVariant &amp; <i>parameter</i>, QObject * <i>receiver</i> = 0, const char * <i>member</i> = 0 )</li>
</ul>
<ul>
<li><div class="fn"></div>29 public functions inherited from <a href="http://doc.qtsoftware.com/4.5/qobject.html#public-functions">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li><div class="fn"></div>1 property inherited from <a href="http://doc.qtsoftware.com/4.5/qobject.html#properties">QObject</a></li>
<li><div class="fn"></div>1 public slot inherited from <a href="http://doc.qtsoftware.com/4.5/qobject.html#public-slots">QObject</a></li>
<li><div class="fn"></div>1 signal inherited from <a href="http://doc.qtsoftware.com/4.5/qobject.html#signals">QObject</a></li>
<li><div class="fn"></div>1 public type inherited from <a href="http://doc.qtsoftware.com/4.5/qobject.html#public-variables">QObject</a></li>
<li><div class="fn"></div>4 static public members inherited from <a href="http://doc.qtsoftware.com/4.5/qobject.html#static-public-members">QObject</a></li>
<li><div class="fn"></div>7 protected functions inherited from <a href="http://doc.qtsoftware.com/4.5/qobject.html#protected-functions">QObject</a></li>
<li><div class="fn"></div>2 protected variables inherited from <a href="http://doc.qtsoftware.com/4.5/qobject.html#protected-variables">QObject</a></li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QxtSlotMapper class maps signals with a specific parameter value to certain slots.</p>
<p>QxtSlotMapper is the counterpart of <a href="http://doc.qtsoftware.com/4.5/qsignalmapper.html">QSignalMapper</a>. Where <a href="http://doc.qtsoftware.com/4.5/qsignalmapper.html">QSignalMapper</a> maps a parameterless signal into one that has a parameter based on the sender, QxtSlotMapper maps a signal with a parameter to a specified slot and receiver based on that parameter's value. Different slots on potentially different receivers can be invoked by the same signal, according to that parameter.</p>
<p>The parameter comparison is based on QVariant::operator==(). Thus, any built-in Qt type supported by <a href="http://doc.qtsoftware.com/4.5/qvariant.html">QVariant</a> and <a href="http://doc.qtsoftware.com/4.5/qmetatype.html">QMetaType</a> is supported.</p>
<p align="center"><img src="images/qxtslotmapper.png" /></p><p>Example usage:</p>
<pre>    QxtSlotMapper mapper;
    mapper.connect(sender, SIGNAL(signal1(int)));
    mapper.connect(sender, SIGNAL(signal2(QString)));

    mapper.addMapping(3, receiver1, SLOT(slot1(int)));
    mapper.addMapping(QString(&quot;abc&quot;), receiver2, SLOT(slot2(QString)));</pre>
<p>See also <a href="http://doc.qtsoftware.com/4.5/qvariant.html">QVariant</a>, <a href="http://doc.qtsoftware.com/4.5/qmetatype.html#Type-enum">QMetaType::Type</a>, and <a href="http://doc.qtsoftware.com/4.5/qsignalmapper.html">QSignalMapper</a>.</p>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="QxtSlotMapper"></a>QxtSlotMapper::QxtSlotMapper ( <a href="http://doc.qtsoftware.com/4.5/qobject.html">QObject</a> * <i>parent</i> = 0 )</h3>
<p>Constructs a new <a href="qxtslotmapper.html">QxtSlotMapper</a> with <i>parent</i>.</p>
<h3 class="fn"><a name="dtor.QxtSlotMapper"></a>QxtSlotMapper::~QxtSlotMapper ()</h3>
<p>Destructs the slot mapper.</p>
<h3 class="fn"><a name="addMapping"></a>void QxtSlotMapper::addMapping ( const <a href="http://doc.qtsoftware.com/4.5/qvariant.html">QVariant</a> &amp; <i>parameter</i>, <a href="http://doc.qtsoftware.com/4.5/qobject.html">QObject</a> * <i>receiver</i>, const char * <i>member</i> )</h3>
<p>Adds mapping from connected signals with <i>parameter</i> to <i>receiver</i>'s <i>member</i>.</p>
<h3 class="fn"><a name="connect"></a>bool QxtSlotMapper::connect ( const <a href="http://doc.qtsoftware.com/4.5/qobject.html">QObject</a> * <i>sender</i>, const char * <i>signal</i> )</h3>
<p>Connects to <i>sender</i>'s <i>signal</i>. Returns <tt>true</tt> if the connection succeeds and <tt>false</tt> otherwise.</p>
<h3 class="fn"><a name="removeMapping"></a>void QxtSlotMapper::removeMapping ( const <a href="http://doc.qtsoftware.com/4.5/qvariant.html">QVariant</a> &amp; <i>parameter</i>, <a href="http://doc.qtsoftware.com/4.5/qobject.html">QObject</a> * <i>receiver</i> = 0, const char * <i>member</i> = 0 )</h3>
<p>Removes mapping from connected signals with <i>parameter</i> to <i>receiver</i>'s <i>member</i>.</p>
<p>If <i>member</i> is <tt>0</tt>, any mapping with <i>parameter</i> to <i>receiver</i> is removed. If <i>receiver</i> is <tt>0</tt>, any mapping with <i>parameter</i> is removed.</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td align="left">Copyright &copy; 2007-2010
<a href="mailto:foundation@libqxt.org">Qxt Foundation</a></td>
<td align="right"><div align="right">
<a href="http://libqxt.org">Qxt</a> 0.6.1</div></td>
</tr></table></div></address></body>
</html>