23 #ifndef KDCHARTLAYOUTITEMS_H 24 #define KDCHARTLAYOUTITEMS_H 28 #include <QFontMetricsF> 30 #include <QLayoutItem> 41 QRectF
rotatedRect(
const QRectF& pt, qreal rotation );
44 class AbstractDiagram;
65 virtual void paintAll( QPainter& painter );
67 virtual void paint( QPainter* ) = 0;
70 virtual void setParentWidget(
QWidget* widget );
71 virtual void sizeHintChanged()
const;
83 if ( mParentLayout ) {
85 mParentLayout->removeWidget( widget() );
87 mParentLayout->removeItem(
this );
105 const QObject* autoReferenceArea,
107 Qt::Alignment alignment = 0 );
109 void setAutoReferenceArea(
const QObject* area );
110 const QObject* autoReferenceArea()
const;
112 void setText(
const QString & text);
113 QString text()
const;
115 void setTextAlignment( Qt::Alignment );
116 Qt::Alignment textAlignment()
const;
122 bool isEmpty()
const override;
124 Qt::Orientations expandingDirections()
const override;
126 QSize maximumSize()
const override;
128 QSize minimumSize()
const override;
130 QSize sizeHint()
const override;
132 void setGeometry(
const QRect& r )
override;
134 QRect geometry()
const override;
136 virtual int marginWidth()
const;
138 virtual QSize sizeHintUnrotated()
const;
140 virtual bool intersects(
const TextLayoutItem& other,
const QPointF& myPos,
const QPointF& otherPos )
const;
141 virtual bool intersects(
const TextLayoutItem& other,
const QPoint& myPos,
const QPoint& otherPos )
const;
143 virtual qreal realFontSize()
const;
144 virtual QFont realFont()
const;
146 void paint( QPainter* )
override;
148 QPolygon boundingPolygon()
const;
150 bool maybeUpdateRealFont()
const;
151 QSize unrotatedSizeHint(
const QFont& fnt = QFont() )
const;
152 QSize unrotatedTextSize( QFont fnt = QFont() )
const;
153 QSize calcSizeHint(
const QFont& font )
const;
154 int marginWidth(
const QSize& textSize )
const;
160 Qt::Alignment mTextAlignment;
162 const QObject* mAutoReferenceArea;
164 mutable QSize cachedSizeHint;
165 mutable QPolygon mCachedBoundingPolygon;
166 mutable qreal cachedFontSize;
167 mutable QFont cachedFont;
176 const QObject* autoReferenceArea,
178 Qt::Alignment alignment = 0 );
182 void setAutoReferenceArea(
const QObject* area );
183 const QObject* autoReferenceArea()
const;
185 void setText(
const QString & text);
186 QString text()
const;
192 bool isEmpty()
const override;
194 Qt::Orientations expandingDirections()
const override;
196 QSize maximumSize()
const override;
198 QSize minimumSize()
const override;
200 QSize sizeHint()
const override;
202 void setGeometry(
const QRect& r )
override;
204 QRect geometry()
const override;
206 void paint( QPainter* painter )
override;
209 int borderWidth()
const;
226 Qt::Alignment alignment = 0 );
228 Qt::Orientations expandingDirections()
const override;
229 QRect geometry()
const override;
230 bool isEmpty()
const override;
231 QSize maximumSize()
const override;
232 QSize minimumSize()
const override;
233 void setGeometry(
const QRect& r )
override;
234 QSize sizeHint()
const override;
236 void paint( QPainter* )
override;
238 static void paintIntoRect(
264 Qt::Alignment mLegendLineSymbolAlignment,
265 Qt::Alignment alignment = 0 );
267 Qt::Orientations expandingDirections()
const override;
268 QRect geometry()
const override;
269 bool isEmpty()
const override;
270 QSize maximumSize()
const override;
271 QSize minimumSize()
const override;
272 void setGeometry(
const QRect& r )
override;
273 QSize sizeHint()
const override;
275 void setLegendLineSymbolAlignment(Qt::Alignment legendLineSymbolAlignment);
276 virtual Qt::Alignment legendLineSymbolAlignment()
const;
278 void paint( QPainter* )
override;
280 static void paintIntoRect(
284 Qt::Alignment lineAlignment);
291 Qt::Alignment mLegendLineSymbolAlignment;
306 const QBrush& markerBrush,
307 const QPen& markerPen,
308 Qt::Alignment alignment = 0 );
310 Qt::Orientations expandingDirections()
const override;
311 QRect geometry()
const override;
312 bool isEmpty()
const override;
313 QSize maximumSize()
const override;
314 QSize minimumSize()
const override;
315 void setGeometry(
const QRect& r )
override;
316 QSize sizeHint()
const override;
318 void paint( QPainter* )
override;
341 Qt::Orientations expandingDirections()
const override;
342 QRect geometry()
const override;
343 bool isEmpty()
const override;
344 QSize maximumSize()
const override;
345 QSize minimumSize()
const override;
346 void setGeometry(
const QRect& r )
override;
347 QSize sizeHint()
const override;
349 void paint( QPainter* )
override;
364 Qt::Orientations expandingDirections()
const override;
365 QRect geometry()
const override;
366 bool isEmpty()
const override;
367 QSize maximumSize()
const override;
368 QSize minimumSize()
const override;
369 void setGeometry(
const QRect& r )
override;
370 QSize sizeHint()
const override;
372 void paint( QPainter* )
override;
452 bool layoutIsAtTopPosition, QHBoxLayout *rightLeftLayout,
453 bool layoutIsAtLeftPosition, QVBoxLayout *topBottomLayout );
455 Qt::Orientations expandingDirections()
const override;
456 QRect geometry()
const override;
457 bool isEmpty()
const override;
458 QSize maximumSize()
const override;
459 QSize minimumSize()
const override;
460 void setGeometry(
const QRect& r )
override;
461 QSize sizeHint()
const override;
463 void paint( QPainter* )
override;
467 bool mLayoutIsAtTopPosition;
468 QHBoxLayout *mRightLeftLayout;
469 bool mLayoutIsAtLeftPosition;
470 QVBoxLayout *mTopBottomLayout;
472 mutable QBrush mCommonBrush;
473 mutable QSize mCachedSize;
MeasureOrientation
Measure orientation mode: the way how the absolute value of a KDChart::Measure is determined during K...
Layout item showing a coloured line and a data point marker.
Layout item showing a text.
void removeFromParentLayout()
AbstractDiagram defines the interface for diagram classes.
Layout item showing a data point marker.
QT_END_NAMESPACE QRectF rotatedRect(const QRectF &pt, qreal rotation)
Class only listed here to document inheritance of some KDChart classes.
Layout item showing a horizontal line.
Base class for all layout items of KD Chart.
AbstractLayoutItem(Qt::Alignment itemAlignment=0)
Layout item showing a vertial line.
Stores information about painting diagrams.
A set of attributes controlling the appearance of data set markers.
Layout item showing a coloured line.
Class only listed here to document inheritance of some KDChart classes.
void setParentLayout(QLayout *lay)
static qreal fitFontSizeToGeometry(const QString &text, const QFont &font, const QRectF &geometry, const TextAttributes &ta)
A set of text attributes.