![]() |
Home · Modules · Classes · Namespaces · Functions |
The QxtSlotMapper class maps signals with a specific parameter value to certain slots. More...
#include <QxtSlotMapper>
Inherits QObject.
The QxtSlotMapper class maps signals with a specific parameter value to certain slots.
QxtSlotMapper is the counterpart of QSignalMapper. Where QSignalMapper 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.
The parameter comparison is based on QVariant::operator==(). Thus, any built-in Qt type supported by QVariant and QMetaType is supported.
Example usage:
QxtSlotMapper mapper; mapper.connect(sender, SIGNAL(signal1(int))); mapper.connect(sender, SIGNAL(signal2(QString))); mapper.addMapping(3, receiver1, SLOT(slot1(int))); mapper.addMapping(QString("abc"), receiver2, SLOT(slot2(QString)));
See also QVariant, QMetaType::Type, and QSignalMapper.
Constructs a new QxtSlotMapper with parent.
Destructs the slot mapper.
Adds mapping from connected signals with parameter to receiver's member.
Connects to sender's signal. Returns true if the connection succeeds and false otherwise.
Removes mapping from connected signals with parameter to receiver's member.
If member is 0, any mapping with parameter to receiver is removed. If receiver is 0, any mapping with parameter is removed.
Copyright © 2007-2010 Qxt Foundation |
Qxt 0.6.1 |