 |
KD Chart 2
[rev.2.7]
|
Go to the documentation of this file.
26 #include <KDChartCartesianCoordinatePlane_p.h>
31 #include <QApplication>
32 #include <QSharedPointer>
33 #include <QTextDocument>
34 #include <KDABLibFakes>
40 class TextAttributes::Private
48 mutable QFont cachedFont;
49 mutable qreal cachedFontSize;
57 QSharedPointer<QTextDocument> document;
60 TextAttributes::Private::Private()
62 font( QApplication::font() ),
63 cachedFontSize( -1.0 ),
72 TextAttributes::TextAttributes()
78 : _d( new Private( *r.
d ) )
103 const QFont myFont(
font() );
104 QFont r_font( r.
font() );
105 r_font.setStyleHint( myFont.styleHint(), myFont.styleStrategy() );
120 d->visible = visible;
131 d->cachedFont =
font;
132 d->cachedFontSize = -1.0;
142 d->fontSize = measure;
152 d->minimalFontSize = measure;
157 return d->minimalFontSize;
171 return qMax( normalSize, minimalSize );
174 #if QT_VERSION < 0x040400 || defined(Q_COMPILER_MANGLES_RETURN_TYPE)
182 return qMax( normalSize, minimalSize );
197 CartesianCoordinatePlane::Private *priv
200 autoReferenceOrientation );
205 if ( size > 0.0 &&
d->cachedFontSize != size ) {
206 d->cachedFontSize = size;
207 d->cachedFont.setPointSizeF(
d->cachedFontSize );
210 return d->cachedFont;
221 return d->autoRotate;
231 return d->autoShrink;
236 d->hasRotation =
true;
247 d->hasRotation =
false;
253 return d->hasRotation;
268 return d->document.data();
273 d->document = QSharedPointer<QTextDocument>(document);
276 #if !defined(QT_NO_DEBUG_STREAM)
279 dbg <<
"KDChart::TextAttributes("
281 <<
"font=" << ta.
font().toString()
287 <<
"pen=" << ta.
pen()
const QFont calculatedFont(const QObject *autoReferenceArea, KDChartEnums::MeasureOrientation autoReferenceOrientation) const
Returns the font in the size that is used at drawing time.
bool hasFixedDataCoordinateSpaceRelation() const
TextAttributes & operator=(const TextAttributes &)
void setTextDocument(QTextDocument *layout)
Sets the document to use for the text.
bool hasAbsoluteFontSize() const
QDebug operator<<(QDebug stream, const DataDimension &r)
A set of text attributes.
Measure is used to specify relative and absolute sizes in KDChart, e.g.
QTextDocument * textDocument() const
Class only listed here to document inheritance of some KDChart classes.
void setVisible(bool visible)
Set whether the text is to be rendered at all.
void setMinimalFontSize(const Measure &measure)
Set the minimal size of the font used for rendering text.
@ MeasureCalculationModeAbsolute
void setFontSize(const Measure &measure)
Set the size of the font used for rendering text.
Measure minimalFontSize() const
MeasureOrientation
Measure orientation mode: the way how the absolute value of a KDChart::Measure is determined during K...
void setAutoRotate(bool autoRotate)
Set whether the text should be automatically rotated as needed when space is tight.
qreal calculatedValue(const QObject *autoArea, KDChartEnums::MeasureOrientation autoOrientation) const
The reference area must either be derived from AbstractArea or from QWidget, so it can also be derive...
void setPen(const QPen &pen)
Set the pen to use for rendering the text.
void setRotation(int rotation)
Set the rotation angle to use for the text.
Cartesian coordinate plane.
void setFont(const QFont &font)
Set the font to be used for rendering the text.
bool operator==(const TextAttributes &) const
qreal calculatedFontSize(const QSizeF &referenceSize, KDChartEnums::MeasureOrientation autoReferenceOrientation) const
Returns the font size that is used at drawing time.
void setAutoShrink(bool autoShrink)
Set whether the text should automatically be shrunk if space is tight.