Go to the documentation of this file.
22 #if QT_VERSION >= 0x050200
24 static QwtText qwtStringToText(
const QString& text )
33 static const struct RegisterQwtText
35 inline RegisterQwtText()
37 qRegisterMetaType< QwtText >();
39 #if QT_VERSION >= 0x050200
40 QMetaType::registerConverter< QString, QwtText >( qwtStringToText );
52 static TextEngineDict& dict();
66 inline const QwtTextEngine* engine( EngineMap::const_iterator& it )
const
74 TextEngineDict& TextEngineDict::dict()
76 static TextEngineDict engineDict;
80 TextEngineDict::TextEngineDict()
83 #ifndef QT_NO_RICHTEXT
88 TextEngineDict::~TextEngineDict()
90 for ( EngineMap::const_iterator it = m_map.constBegin();
91 it != m_map.constEnd(); ++it )
98 const QwtTextEngine* TextEngineDict::textEngine(
const QString& text,
103 for ( EngineMap::const_iterator it = m_map.begin();
104 it != m_map.end(); ++it )
115 EngineMap::const_iterator it = m_map.find(
format );
116 if ( it != m_map.end() )
136 EngineMap::const_iterator it = m_map.constFind(
format );
137 if ( it != m_map.constEnd() )
139 delete this->engine( it );
143 if ( engine != NULL )
144 m_map.insert(
format, engine );
152 EngineMap::const_iterator it = m_map.find(
format );
153 if ( it != m_map.end() )
266 return !( other == *this );
633 painter->setRenderHint( QPainter::Antialiasing,
true );
634 painter->drawRoundedRect( rect,
655 QRectF expandedRect = rect;
667 expandedRect.setTop( rect.top() -
top );
668 expandedRect.setBottom( rect.bottom() + bottom );
669 expandedRect.setLeft( rect.left() -
left );
670 expandedRect.setRight( rect.right() +
right );
697 return TextEngineDict::dict().textEngine(
text,
format );
716 TextEngineDict::dict().setTextEngine(
format, engine );
729 return TextEngineDict::dict().textEngine(
format );
Abstract base class for rendering text strings.
void setBorderPen(const QPen &)
void setText(const QString &, QwtText::TextFormat textFormat=AutoText)
virtual double heightForWidth(const QFont &font, int flags, const QString &text, double width) const =0
static void drawRect(QPainter *, qreal x, qreal y, qreal w, qreal h)
Wrapper for QPainter::drawRect()
LayoutCache * m_layoutCache
QBrush backgroundBrush() const
@ RichText
Use the Scribe framework (Qt Rich Text) to render the text.
virtual void draw(QPainter *painter, const QRectF &rect, int flags, const QString &text) const =0
PaintAttribute
Paint Attributes.
void setRenderFlags(int)
Change the render flags.
static QFont scaledFont(const QFont &, const QPaintDevice *=nullptr)
bool operator!=(const QwtText &) const
Relational operator.
static void setTextEngine(QwtText::TextFormat, QwtTextEngine *)
@ PaintBackground
The text has an individual background.
@ PaintUsingTextColor
The text has an individual color.
A class representing a text.
void setPaintAttribute(PaintAttribute, bool on=true)
QWT_CONSTEXPR float qwtMaxF(float a, float b)
@ PlainText
Draw the text as it is, using a QwtPlainTextEngine.
QFont font() const
Return the font.
QwtText & operator=(const QwtText &)
Assignment operator.
QwtText::PaintAttributes paintAttributes
double borderRadius() const
double heightForWidth(double width) const
void setBackgroundBrush(const QBrush &)
QColor usedColor(const QColor &) const
void setFont(const QFont &)
auto format(const text_style &ts, const S &format_str, const Args &... args) -> std::basic_string< Char >
A text engine for Qt rich texts.
virtual bool mightRender(const QString &text) const =0
void setColor(const QColor &)
LayoutAttribute
Layout Attributes The layout attributes affects some aspects of the layout of the text.
QFont usedFont(const QFont &) const
virtual void textMargins(const QFont &font, const QString &text, double &left, double &right, double &top, double &bottom) const =0
@ PaintUsingTextFont
The text has an individual font.
bool testLayoutAttribute(LayoutAttribute) const
void setLayoutAttribute(LayoutAttribute, bool on=true)
bool testPaintAttribute(PaintAttribute) const
void draw(QPainter *painter, const QRectF &rect) const
virtual QSizeF textSize(const QFont &font, int flags, const QString &text) const =0
A text engine for plain texts.
QwtText::LayoutAttributes layoutAttributes
QColor color() const
Return the pen color, used for painting the text.
void setBorderRadius(double)
const QwtTextEngine * textEngine
static const QwtTextEngine * textEngine(const QString &text, QwtText::TextFormat=AutoText)
bool operator==(const QwtText &) const
Relational operator.
plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:46