Public Member Functions | |
| QwtTextEngineDict () | |
| ~QwtTextEngineDict () | |
| void | setTextEngine (QwtText::TextFormat, QwtTextEngine *) |
| const QwtTextEngine * | textEngine (QwtText::TextFormat) const |
| const QwtTextEngine * | textEngine (const QString &, QwtText::TextFormat) const |
Definition at line 26 of file qwt_text.cpp.
| QwtTextEngineDict::QwtTextEngineDict | ( | ) |
Definition at line 52 of file qwt_text.cpp.
References QwtText::PlainText, and QwtText::RichText.
{
d_map.insert(QwtText::PlainText, new QwtPlainTextEngine());
#ifndef QT_NO_RICHTEXT
d_map.insert(QwtText::RichText, new QwtRichTextEngine());
#endif
}
| QwtTextEngineDict::~QwtTextEngineDict | ( | ) |
Definition at line 60 of file qwt_text.cpp.
References textEngine().
{
for ( EngineMap::const_iterator it = d_map.begin();
it != d_map.end(); ++it )
{
QwtTextEngine *textEngine = (QwtTextEngine *)engine(it);
delete textEngine;
}
}
| void QwtTextEngineDict::setTextEngine | ( | QwtText::TextFormat | format, |
| QwtTextEngine * | engine | ||
| ) |
Definition at line 99 of file qwt_text.cpp.
References QwtText::AutoText, and QwtText::PlainText.
Referenced by QwtText::setTextEngine().
{
if ( format == QwtText::AutoText )
return;
if ( format == QwtText::PlainText && engine == NULL )
return;
EngineMap::const_iterator it = d_map.find(format);
if ( it != d_map.end() )
{
const QwtTextEngine *e = this->engine(it);
if ( e )
delete e;
d_map.remove(format);
}
if ( engine != NULL )
d_map.insert(format, engine);
}
| const QwtTextEngine * QwtTextEngineDict::textEngine | ( | const QString & | text, |
| QwtText::TextFormat | format | ||
| ) | const |
Definition at line 70 of file qwt_text.cpp.
References QwtText::AutoText, QwtTextEngine::mightRender(), and QwtText::PlainText.
{
if ( format == QwtText::AutoText )
{
for ( EngineMap::const_iterator it = d_map.begin();
it != d_map.end(); ++it )
{
if ( it.key() != QwtText::PlainText )
{
const QwtTextEngine *e = engine(it);
if ( e && e->mightRender(text) )
return (QwtTextEngine *)e;
}
}
}
EngineMap::const_iterator it = d_map.find(format);
if ( it != d_map.end() )
{
const QwtTextEngine *e = engine(it);
if ( e )
return e;
}
it = d_map.find(QwtText::PlainText);
return engine(it);
}
| const QwtTextEngine * QwtTextEngineDict::textEngine | ( | QwtText::TextFormat | format ) | const |
Definition at line 122 of file qwt_text.cpp.
Referenced by QwtText::textEngine(), and ~QwtTextEngineDict().
{
const QwtTextEngine *e = NULL;
EngineMap::const_iterator it = d_map.find(format);
if ( it != d_map.end() )
e = engine(it);
return e;
}
1.7.2