#include <QicsDataItemFormatter.h>
Inherits QicsDataItemFormatter.
Public Member Functions | |
| QicsDataItemSprintfFormatter (QObject *parent=0) | |
| virtual | ~QicsDataItemSprintfFormatter () |
| virtual QString | format (const QicsDataItem &itm) const |
| void | addFormatString (QicsDataItemType type, const char *format_string) |
| void | removeFormatString (QicsDataItemType type) |
Protected Attributes | |
|
QMap< QicsDataItemType, const char * > | myFormats |
QicsDataItemSprintfFormatter is an implementation of the QicsDataItemFormatter interface that uses sprintf-type formatting strings when formatting data items. The programmer provides separate formatting strings for each data type by calling QicsDataItemFormatter::addFormatString. If no formatting string has been added for a type, that type will not be formatted -- its default string representation will be returned.
| QicsDataItemSprintfFormatter::QicsDataItemSprintfFormatter | ( | QObject * | parent = 0 |
) |
Constructs an empty formatter.
| virtual QicsDataItemSprintfFormatter::~QicsDataItemSprintfFormatter | ( | ) | [virtual] |
Destructor.
| virtual QString QicsDataItemSprintfFormatter::format | ( | const QicsDataItem & | itm | ) | const [virtual] |
Returns a formatted string representing the data item itm.
Implements QicsDataItemFormatter.
| void QicsDataItemSprintfFormatter::addFormatString | ( | QicsDataItemType | type, | |
| const char * | format_string | |||
| ) |
Adds the sprintf formatting string format_string to the formatter. This format string will be used when formatting data items of type type.
| void QicsDataItemSprintfFormatter::removeFormatString | ( | QicsDataItemType | type | ) |
Removes the current formatting string (if any) for type type from the formatter.