Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |

# TQSignalMapper Class Reference

The TQSignalMapper class bundles signals from identifiable senders. More...

`#include <ntqsignalmapper.h>`

Inherits TQObject.

List of all member functions.

## Public Members

- TQSignalMapper ( TQObject * parent, const char * name = 0 )
- ~TQSignalMapper ()
- virtual void setMapping ( const TQObject * sender, int identifier )
- virtual void setMapping ( const TQObject * sender, const TQString & identifier )
- void removeMappings ( const TQObject * sender )

## Public Slots

- void map ()

## Signals

- void mapped ( int )
- void mapped ( const TQString & )

## Detailed Description

The TQSignalMapper class bundles signals from identifiable senders.

This class collects a set of parameterless signals, and re-emits them with integer or string parameters corresponding to the object that sent the signal.

See also Input/Output and Networking.

## Member Function Documentation

### TQSignalMapper::TQSignalMapper ( TQObject * parent, const char * name = 0 )

Constructs a TQSignalMapper called name, with parent parent. Like all TQObjects, it will be deleted when the parent is deleted.

### TQSignalMapper::~TQSignalMapper ()

Destroys the TQSignalMapper.

### void TQSignalMapper::map ()`[slot]`

This slot emits signals based on which object sends signals to it.

Examples: i18n/main.cpp and themes/themes.cpp.

### void TQSignalMapper::mapped ( int )`[signal]`

This signal is emitted when map() is signaled from an object that has an integer mapping set.

See also setMapping().

Examples: i18n/main.cpp and themes/themes.cpp.

### void TQSignalMapper::mapped ( const TQString & )`[signal]`

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

This signal is emitted when map() is signaled from an object that has a string mapping set.

See also setMapping().

### void TQSignalMapper::removeMappings ( const TQObject * sender )

Removes all mappings for sender. This is done automatically when mapped objects are destroyed.

### void TQSignalMapper::setMapping ( const TQObject * sender, int identifier )`[virtual]`

Adds a mapping so that when map() is signaled from the given sender, the signal mapped(identifier) is emitted.

There may be at most one integer identifier for each object.

Examples: i18n/main.cpp and themes/themes.cpp.

### void TQSignalMapper::setMapping ( const TQObject * sender, const TQString & identifier )`[virtual]`

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Adds a mapping so that when map() is signaled from the given sender, the signal mapper(identifier) is emitted.

There may be at most one string identifier for each object, and it may not be empty.

This file is part of the TQt toolkit. Copyright © 1995-2007 Trolltech. All Rights Reserved.