#include <KDChartHeaderFooter.h>
Inheritance diagram for KDChart::HeaderFooter:
Public Types | |
| enum | HeaderFooterType { Header, Footer } |
Public Member Functions | |
| void | alignToReferencePoint (const RelativePosition &position) |
| const QObject * | autoReferenceArea () const |
| BackgroundAttributes | backgroundAttributes () const |
| virtual HeaderFooter * | clone () const |
| bool | compare (const AbstractAreaBase *other) const |
| Returns true if both areas have the same settings. | |
| bool | compare (const HeaderFooter &other) const |
| virtual Qt::Orientations | expandingDirections () const |
| pure virtual in QLayoutItem | |
| FrameAttributes | frameAttributes () const |
| virtual QRect | geometry () const |
| pure virtual in QLayoutItem | |
| void | getFrameLeadings (int &left, int &top, int &right, int &bottom) const |
| HeaderFooter (Chart *parent=0) | |
| virtual bool | intersects (const TextLayoutItem &other, const QPoint &myPos, const QPoint &otherPos) const |
| virtual bool | intersects (const TextLayoutItem &other, const QPointF &myPos, const QPointF &otherPos) const |
| virtual bool | isEmpty () const |
| pure virtual in QLayoutItem | |
| virtual QSize | maximumSize () const |
| pure virtual in QLayoutItem | |
| virtual QSize | minimumSize () const |
| pure virtual in QLayoutItem | |
| virtual void | paint (QPainter *) |
| void | paintAll (QPainter &painter) |
| Call paintAll, if you want the background and the frame to be drawn before the normal paint() is invoked automatically. | |
| virtual void | paintBackground (QPainter &painter, const QRect &rectangle) |
| virtual void | paintCtx (PaintContext *context) |
| Default impl: Paint the complete item using its layouted position and size. | |
| virtual void | paintFrame (QPainter &painter, const QRect &rectangle) |
| virtual void | paintIntoRect (QPainter &painter, const QRect &rect) |
| Draws the background and frame, then calls paint(). | |
| QLayout * | parentLayout () |
| Position | position () const |
| void | positionChanged (HeaderFooter *) |
| virtual QFont | realFont () const |
| virtual qreal | realFontSize () const |
| void | removeFromParentLayout () |
| void | setAutoReferenceArea (const QObject *area) |
| void | setBackgroundAttributes (const BackgroundAttributes &a) |
| void | setFrameAttributes (const FrameAttributes &a) |
| virtual void | setGeometry (const QRect &r) |
| pure virtual in QLayoutItem | |
| void | setParent (QObject *parent) |
| void | setParentLayout (QLayout *lay) |
| virtual void | setParentWidget (QWidget *widget) |
| Inform the item about its widget: This enables the item, to trigger that widget's update, whenever the size of the item's contents has changed. | |
| void | setPosition (Position position) |
| void | setText (const QString &text) |
| void | setTextAttributes (const TextAttributes &a) |
| Use this to specify the text attributes to be used for this item. | |
| void | setType (HeaderFooterType type) |
| virtual QSize | sizeHint () const |
| pure virtual in QLayoutItem | |
| virtual void | sizeHintChanged () const |
| Report changed size hint: ask the parent widget to recalculate the layout. | |
| QString | text () const |
| TextAttributes | textAttributes () const |
| Returns the text attributes to be used for this item. | |
| HeaderFooterType | type () const |
| virtual | ~HeaderFooter () |
Static Public Member Functions | |
| void | paintBackgroundAttributes (QPainter &painter, const QRect &rectangle, const KDChart::BackgroundAttributes &attributes) |
| void | paintFrameAttributes (QPainter &painter, const QRect &rectangle, const KDChart::FrameAttributes &attributes) |
Public Attributes | |
| Q_SIGNALS | __pad0__: void destroyedHeaderFooter( HeaderFooter* ) |
Protected Member Functions | |
| virtual QRect | areaGeometry () const |
| QRect | innerRect () const |
| virtual void | positionHasChanged () |
Protected Attributes | |
| QWidget * | mParent |
| QLayout * | mParentLayout |
|
|
Definition at line 56 of file KDChartHeaderFooter.h.
|
|
|
Definition at line 55 of file KDChartHeaderFooter.cpp. References setParent(). Referenced by clone().
|
|
|
Definition at line 62 of file KDChartHeaderFooter.cpp.
00063 {
00064 emit destroyedHeaderFooter( this );
00065 }
|
|
|
Definition at line 90 of file KDChartAbstractAreaBase.cpp.
00091 {
00092 Q_UNUSED( position );
00093 // PENDING(kalle) FIXME
00094 qWarning( "Sorry, not implemented: void AbstractAreaBase::alignToReferencePoint( const RelativePosition& position )" );
00095 }
|
|
|
Implements KDChart::AbstractAreaBase. Definition at line 105 of file KDChartTextArea.cpp. References KDChart::TextLayoutItem::geometry(). Referenced by KDChart::TextArea::paintAll().
00106 {
00107 return geometry();
00108 }
|
|
|
Definition at line 135 of file KDChartLayoutItems.cpp. Referenced by setParent().
00136 {
00137 return mAutoReferenceArea;
00138 }
|
|
|
Definition at line 112 of file KDChartAbstractAreaBase.cpp. References d. Referenced by updateCommonBrush().
00113 {
00114 return d->backgroundAttributes;
00115 }
|
|
|
Definition at line 91 of file KDChartHeaderFooter.cpp. References d, HeaderFooter(), position(), setPosition(), KDChart::TextLayoutItem::setTextAttributes(), setType(), KDChart::TextLayoutItem::textAttributes(), and type().
00092 {
00093 HeaderFooter* headerFooter = new HeaderFooter( new Private( *d ), 0 );
00094 headerFooter->setType( type() );
00095 headerFooter->setPosition( position() );
00096 headerFooter->setTextAttributes( textAttributes() );
00097 return headerFooter;
00098 }
|
|
|
Returns true if both areas have the same settings.
Definition at line 75 of file KDChartAbstractAreaBase.cpp.
00076 {
00077 if( other == this ) return true;
00078 if( ! other ){
00079 //qDebug() << "CartesianAxis::compare() cannot compare to Null pointer";
00080 return false;
00081 }
00082 /*
00083 qDebug() << "AbstractAreaBase:" << (frameAttributes() == other->frameAttributes())
00084 << (backgroundAttributes() == other->backgroundAttributes()) << "\n";
00085 */
00086 return (frameAttributes() == other->frameAttributes()) &&
00087 (backgroundAttributes() == other->backgroundAttributes());
00088 }
|
|
|
Definition at line 100 of file KDChartHeaderFooter.cpp.
00101 {
00102 return (type() == other.type()) &&
00103 (position() == other.position()) &&
00104 // also compare members inherited from the base class:
00105 (autoReferenceArea() == other.autoReferenceArea()) &&
00106 (text() == other.text()) &&
00107 (textAttributes() == other.textAttributes());
00108 }
|
|
|
pure virtual in QLayoutItem
Definition at line 175 of file KDChartLayoutItems.cpp.
00176 {
00177 return 0; // Grow neither vertically nor horizontally
00178 }
|
|
|
Definition at line 102 of file KDChartAbstractAreaBase.cpp. References d. Referenced by KDChart::Legend::clone(), and updateCommonBrush().
00103 {
00104 return d->frameAttributes;
00105 }
|
|
|
pure virtual in QLayoutItem
Definition at line 180 of file KDChartLayoutItems.cpp. Referenced by KDChart::TextArea::areaGeometry(), KDChart::TextLayoutItem::paint(), KDChart::TextArea::paintAll(), KDChart::CartesianAxis::paintCtx(), and KDChart::TextArea::paintIntoRect().
00181 {
00182 return mRect;
00183 }
|
|
||||||||||||||||||||
|
Definition at line 204 of file KDChartAbstractAreaBase.cpp. References d. Referenced by KDChart::AbstractAreaBase::innerRect(), and KDChart::AbstractAreaWidget::paintAll().
00205 {
00206 if( d && d->frameAttributes.isVisible() ){
00207 const int padding = qMax( d->frameAttributes.padding(), 0 );
00208 left = padding;
00209 top = padding;
00210 right = padding;
00211 bottom = padding;
00212 }else{
00213 left = 0;
00214 top = 0;
00215 right = 0;
00216 bottom = 0;
00217 }
00218 }
|
|
|
Definition at line 220 of file KDChartAbstractAreaBase.cpp. References KDChart::AbstractAreaBase::areaGeometry(), and KDChart::AbstractAreaBase::getFrameLeadings(). Referenced by KDChart::TextArea::paintAll(), and KDChart::AbstractArea::paintAll().
00221 {
00222 int left;
00223 int top;
00224 int right;
00225 int bottom;
00226 getFrameLeadings( left, top, right, bottom );
00227 return
00228 QRect( QPoint(0,0), areaGeometry().size() )
00229 .adjusted( left, top, -right, -bottom );
00230 }
|
|
||||||||||||||||
|
Definition at line 254 of file KDChartLayoutItems.cpp. References KDChart::TextLayoutItem::mAttributes, PI, KDChart::TextLayoutItem::rotatedCorners(), KDChart::TextAttributes::rotation(), and KDChart::TextLayoutItem::unrotatedSizeHint().
00255 {
00256 if ( mAttributes.rotation() != other.mAttributes.rotation() )
00257 {
00258 // that's the code for the common case: the rotation angles don't need to match here
00259 QPolygon myPolygon( rotatedCorners() );
00260 QPolygon otherPolygon( other.rotatedCorners() );
00261
00262 // move the polygons to their positions
00263 myPolygon.translate( myPos );
00264 otherPolygon.translate( otherPos );
00265
00266 // create regions out of it
00267 QRegion myRegion( myPolygon );
00268 QRegion otherRegion( otherPolygon );
00269
00270 // now the question - do they intersect or not?
00271 return ! myRegion.intersect( otherRegion ).isEmpty();
00272
00273 } else {
00274 // and that's the code for the special case: the rotation angles match, which is less time consuming in calculation
00275 const qreal angle = mAttributes.rotation() * PI / 180.0;
00276 // both sizes
00277 const QSizeF mySize( unrotatedSizeHint() );
00278 const QSizeF otherSize( other.unrotatedSizeHint() );
00279
00280 // that's myP1 relative to myPos
00281 QPointF myP1( mySize.height() * sin( angle ), 0.0 );
00282 // that's otherP1 to myPos
00283 QPointF otherP1 = QPointF( otherSize.height() * sin( angle ), 0.0 ) + otherPos - myPos;
00284
00285 // now rotate both points the negative angle around myPos
00286 myP1 = QPointF( myP1.x() * cos( -angle ), myP1.x() * sin( -angle ) );
00287 qreal r = sqrt( otherP1.x() * otherP1.x() + otherP1.y() * otherP1.y() );
00288 otherP1 = QPointF( r * cos( -angle ), r * sin( -angle ) );
00289
00290 // finally we look, whether both rectangles intersect or even not
00291 return QRectF( myP1, mySize ).intersects( QRectF( otherP1, otherSize ) );
00292 }
00293 }
|
|
||||||||||||||||
|
Definition at line 249 of file KDChartLayoutItems.cpp. Referenced by KDChart::CartesianAxis::paintCtx().
00250 {
00251 return intersects( other, myPos.toPoint(), otherPos.toPoint() );
00252 }
|
|
|
pure virtual in QLayoutItem
Definition at line 185 of file KDChartLayoutItems.cpp.
00186 {
00187 return false; // never empty, otherwise the layout item would not exist
00188 }
|
|
|
pure virtual in QLayoutItem
Definition at line 190 of file KDChartLayoutItems.cpp. References KDChart::TextLayoutItem::sizeHint().
00191 {
00192 return sizeHint(); // PENDING(kalle) Review, quite inflexible
00193 }
|
|
|
pure virtual in QLayoutItem
Definition at line 195 of file KDChartLayoutItems.cpp. References KDChart::TextLayoutItem::sizeHint().
00196 {
00197 return sizeHint(); // PENDING(kalle) Review, quite inflexible
00198 }
|
|
|
Implements KDChart::AbstractLayoutItem. Definition at line 382 of file KDChartLayoutItems.cpp. References KDChart::TextLayoutItem::geometry(), KDChart::TextAttributes::pen(), rotatedRect(), and KDChart::TextAttributes::rotation(). Referenced by KDChart::TextArea::paintAll(), and KDChart::CartesianAxis::paintCtx().
00383 {
00384 // make sure, cached font is updated, if needed:
00385 // sizeHint();
00386
00387 if( !mRect.isValid() )
00388 return;
00389
00390 PainterSaver painterSaver( painter );
00391 painter->setFont( cachedFont );
00392 QRectF rect( geometry() );
00393
00394 // #ifdef DEBUG_ITEMS_PAINT
00395 // painter->setPen( Qt::black );
00396 // painter->drawRect( rect );
00397 // #endif
00398 painter->translate( rect.center() );
00399 rect.moveTopLeft( QPointF( - rect.width() / 2, - rect.height() / 2 ) );
00400 #ifdef DEBUG_ITEMS_PAINT
00401 painter->setPen( Qt::blue );
00402 painter->drawRect( rect );
00403 #endif
00404 painter->rotate( mAttributes.rotation() );
00405 rect = rotatedRect( rect, mAttributes.rotation() );
00406 #ifdef DEBUG_ITEMS_PAINT
00407 painter->setPen( Qt::red );
00408 painter->drawRect( rect );
00409 #endif
00410 painter->setPen( mAttributes.pen() );
00411 painter->drawText( rect, Qt::AlignHCenter | Qt::AlignVCenter, mText );
00412 // if ( calcSizeHint( cachedFont ).width() > rect.width() )
00413 // qDebug() << "rect.width()" << rect.width() << "text.width()" << calcSizeHint( cachedFont ).width();
00414 //
00415 // //painter->drawText( rect, Qt::AlignHCenter | Qt::AlignVCenter, mText );
00416 }
|
|
|
Call paintAll, if you want the background and the frame to be drawn before the normal paint() is invoked automatically.
Reimplemented from KDChart::AbstractLayoutItem. Definition at line 83 of file KDChartTextArea.cpp. References KDChart::TextArea::areaGeometry(), KDChart::TextLayoutItem::geometry(), KDChart::AbstractAreaBase::innerRect(), KDChart::TextLayoutItem::paint(), KDChart::AbstractAreaBase::paintBackground(), KDChart::AbstractAreaBase::paintFrame(), and KDChart::TextLayoutItem::setGeometry(). Referenced by KDChart::TextArea::paintIntoRect().
00084 {
00085 // Paint the background and frame
00086 paintBackground( painter, geometry() );
00087 paintFrame( painter, geometry() );
00088
00089 // temporarily adjust the widget size, to be sure all content gets calculated
00090 // to fit into the inner rectangle
00091 const QRect oldGeometry( areaGeometry() );
00092 QRect inner( innerRect() );
00093 inner.moveTo(
00094 oldGeometry.left() + inner.left(),
00095 oldGeometry.top() + inner.top() );
00096 const bool needAdjustGeometry = oldGeometry != inner;
00097 if( needAdjustGeometry )
00098 setGeometry( inner );
00099 paint( &painter );
00100 if( needAdjustGeometry )
00101 setGeometry( oldGeometry );
00102 //qDebug() << "TextAreaWidget::paintAll() done.";
00103 }
|
|
||||||||||||
|
Definition at line 188 of file KDChartAbstractAreaBase.cpp. References d, and KDChart::AbstractAreaBase::paintBackgroundAttributes(). Referenced by KDChart::TextArea::paintAll(), KDChart::AbstractAreaWidget::paintAll(), and KDChart::AbstractArea::paintAll().
00189 {
00190 Q_ASSERT_X ( d != 0, "AbstractAreaBase::paintBackground()",
00191 "Private class was not initialized!" );
00192 paintBackgroundAttributes( painter, rect, d->backgroundAttributes );
00193 }
|
|
||||||||||||||||
|
Definition at line 119 of file KDChartAbstractAreaBase.cpp. References KDChart::BackgroundAttributes::brush(), KDChart::BackgroundAttributes::isVisible(), KDChart::BackgroundAttributes::pixmap(), and KDChart::BackgroundAttributes::pixmapMode(). Referenced by KDChart::AbstractAreaBase::paintBackground().
00121 {
00122 if( !attributes.isVisible() ) return;
00123
00124 /* first draw the brush (may contain a pixmap)*/
00125 if( Qt::NoBrush != attributes.brush().style() ) {
00126 KDChart::PainterSaver painterSaver( &painter );
00127 painter.setPen( Qt::NoPen );
00128 const QPointF newTopLeft( painter.deviceMatrix().map( rect.topLeft() ) );
00129 painter.setBrushOrigin( newTopLeft );
00130 painter.setBrush( attributes.brush() );
00131 painter.drawRect( rect.adjusted( 0, 0, -1, -1 ) );
00132 }
00133 /* next draw the backPixmap over the brush */
00134 if( !attributes.pixmap().isNull() &&
00135 attributes.pixmapMode() != BackgroundAttributes::BackgroundPixmapModeNone ) {
00136 QPointF ol = rect.topLeft();
00137 if( BackgroundAttributes::BackgroundPixmapModeCentered == attributes.pixmapMode() )
00138 {
00139 ol.setX( rect.center().x() - attributes.pixmap().width() / 2 );
00140 ol.setY( rect.center().y() - attributes.pixmap().height()/ 2 );
00141 painter.drawPixmap( ol, attributes.pixmap() );
00142 } else {
00143 QMatrix m;
00144 double zW = (double)rect.width() / (double)attributes.pixmap().width();
00145 double zH = (double)rect.height() / (double)attributes.pixmap().height();
00146 switch( attributes.pixmapMode() ) {
00147 case BackgroundAttributes::BackgroundPixmapModeScaled:
00148 {
00149 double z;
00150 z = qMin( zW, zH );
00151 m.scale( z, z );
00152 }
00153 break;
00154 case BackgroundAttributes::BackgroundPixmapModeStretched:
00155 m.scale( zW, zH );
00156 break;
00157 default:
00158 ; // Cannot happen, previously checked
00159 }
00160 QPixmap pm = attributes.pixmap().transformed( m );
00161 ol.setX( rect.center().x() - pm.width() / 2 );
00162 ol.setY( rect.center().y() - pm.height()/ 2 );
00163 painter.drawPixmap( ol, pm );
00164 }
00165 }
00166 }
|
|
|
Default impl: Paint the complete item using its layouted position and size.
Reimplemented in KDChart::CartesianAxis. Definition at line 77 of file KDChartLayoutItems.cpp. References KDChart::AbstractLayoutItem::paint(), and KDChart::PaintContext::painter().
00078 {
00079 if( context )
00080 paint( context->painter() );
00081 }
|
|
||||||||||||
|
Definition at line 196 of file KDChartAbstractAreaBase.cpp. References d, and KDChart::AbstractAreaBase::paintFrameAttributes(). Referenced by KDChart::TextArea::paintAll(), KDChart::AbstractAreaWidget::paintAll(), and KDChart::AbstractArea::paintAll().
00197 {
00198 Q_ASSERT_X ( d != 0, "AbstractAreaBase::paintFrame()",
00199 "Private class was not initialized!" );
00200 paintFrameAttributes( painter, rect, d->frameAttributes );
00201 }
|
|
||||||||||||||||
|
Definition at line 169 of file KDChartAbstractAreaBase.cpp. References KDChart::FrameAttributes::isVisible(), and KDChart::FrameAttributes::pen(). Referenced by KDChart::AbstractAreaBase::paintFrame().
00171 {
00172
00173 if( !attributes.isVisible() ) return;
00174
00175 // Note: We set the brush to NoBrush explicitely here.
00176 // Otherwise we might get a filled rectangle, so any
00177 // previously drawn background would be overwritten by that area.
00178
00179 const QPen oldPen( painter.pen() );
00180 const QBrush oldBrush( painter.brush() );
00181 painter.setPen( attributes.pen() );
00182 painter.setBrush( Qt::NoBrush );
00183 painter.drawRect( rect.adjusted( 0, 0, -1, -1 ) );
00184 painter.setBrush( oldBrush );
00185 painter.setPen( oldPen );
00186 }
|
|
||||||||||||
|
Draws the background and frame, then calls paint(). In most cases there is no need to overwrite this method in a derived class, but you would overwrite TextLayoutItem::paint() instead. Definition at line 71 of file KDChartTextArea.cpp. References KDChart::TextLayoutItem::geometry(), KDChart::TextArea::paintAll(), and KDChart::TextLayoutItem::setGeometry().
00072 {
00073 const QRect oldGeometry( geometry() );
00074 if( oldGeometry != rect )
00075 setGeometry( rect );
00076 painter.translate( rect.left(), rect.top() );
00077 paintAll( painter );
00078 painter.translate( -rect.left(), -rect.top() );
00079 if( oldGeometry != rect )
00080 setGeometry( oldGeometry );
00081 }
|
|
|
Definition at line 74 of file KDChartLayoutItems.h.
00075 {
00076 return mParentLayout;
00077 }
|
|
|
Definition at line 127 of file KDChartHeaderFooter.cpp. References d. Referenced by clone().
00128 {
00129 return d->position;
00130 }
|
|
|
Referenced by setPosition(), and setType(). |
|
|
Reimplemented from KDChart::AbstractAreaBase. Definition at line 110 of file KDChartTextArea.cpp.
00111 {
00112 emit positionChanged( this );
00113 }
|
|
|
Definition at line 226 of file KDChartLayoutItems.cpp. Referenced by KDChart::CartesianAxis::maximumSize(), and KDChart::CartesianAxis::paintCtx().
00227 {
00228 realFontWasRecalculated(); // we can safely ignore the boolean return value
00229 return cachedFont;
00230 }
|
|
|
Definition at line 206 of file KDChartLayoutItems.cpp. References KDChart::TextAttributes::calculatedFontSize().
00207 {
00208 return mAttributes.calculatedFontSize( mAutoReferenceArea, mAutoReferenceOrientation );
00209 }
|
|
|
Definition at line 78 of file KDChartLayoutItems.h. Referenced by KDChart::Chart::takeCoordinatePlane().
00079 {
00080 if( mParentLayout ){
00081 if( widget() )
00082 mParentLayout->removeWidget( widget() );
00083 else
00084 mParentLayout->removeItem( this );
00085 }
00086 }
|
|
|
Definition at line 128 of file KDChartLayoutItems.cpp. References KDChart::TextLayoutItem::sizeHint(). Referenced by setParent().
00129 {
00130 mAutoReferenceArea = area;
00131 cachedSizeHint = QSize();
00132 sizeHint();
00133 }
|
|
|
Definition at line 107 of file KDChartAbstractAreaBase.cpp. References d.
00108 {
00109 d->backgroundAttributes = a;
00110 }
|
|
|
Definition at line 97 of file KDChartAbstractAreaBase.cpp. References d. Referenced by KDChart::Legend::clone().
00098 {
00099 d->frameAttributes = a;
00100 }
|
|
|
pure virtual in QLayoutItem
Definition at line 200 of file KDChartLayoutItems.cpp. Referenced by KDChart::TextArea::paintAll(), KDChart::CartesianAxis::paintCtx(), and KDChart::TextArea::paintIntoRect().
00201 {
00202 mRect = r;
00203 }
|
|
|
Definition at line 67 of file KDChartHeaderFooter.cpp. References KDChart::TextLayoutItem::autoReferenceArea(), and KDChart::TextLayoutItem::setAutoReferenceArea(). Referenced by KDChart::Widget::addHeaderFooter(), KDChart::Chart::addHeaderFooter(), HeaderFooter(), KDChart::Widget::replaceHeaderFooter(), and KDChart::Chart::takeHeaderFooter().
00068 {
00069 QObject::setParent( parent );
00070 if( parent && ! autoReferenceArea() )
00071 setAutoReferenceArea( parent );
00072 }
|
|
|
Definition at line 70 of file KDChartLayoutItems.h.
00071 {
00072 mParentLayout = lay;
00073 }
|
|
|
Inform the item about its widget: This enables the item, to trigger that widget's update, whenever the size of the item's contents has changed. Thus, you need to call setParentWidget on every item, that has a non-fixed size. Definition at line 64 of file KDChartLayoutItems.cpp. References KDChart::AbstractLayoutItem::mParent. Referenced by KDChart::Legend::buildLegend(), and KDChart::AbstractCartesianDiagram::takeAxis().
00065 {
00066 mParent = widget;
00067 }
|
|
|
Definition at line 121 of file KDChartHeaderFooter.cpp. References d, and positionChanged(). Referenced by KDChart::Widget::addHeaderFooter(), and clone().
00122 {
00123 d->position = position;
00124 emit positionChanged( this );
00125 }
|
|
|
Definition at line 140 of file KDChartLayoutItems.cpp. References KDChart::TextLayoutItem::sizeHint(). Referenced by KDChart::Widget::addHeaderFooter(), KDChart::CartesianAxis::maximumSize(), and KDChart::CartesianAxis::paintCtx().
00141 {
00142 mText = text;
00143 cachedSizeHint = QSize();
00144 sizeHint();
00145 }
|
|
|
Use this to specify the text attributes to be used for this item.
Definition at line 157 of file KDChartLayoutItems.cpp. References KDChart::TextLayoutItem::sizeHint(). Referenced by clone().
00158 {
00159 mAttributes = a;
00160 cachedSizeHint = QSize(); // invalidate size hint
00161 sizeHint();
00162 }
|
|
|
Definition at line 110 of file KDChartHeaderFooter.cpp. References d, and positionChanged(). Referenced by KDChart::Widget::addHeaderFooter(), and clone().
00111 {
00112 d->type = type;
00113 emit positionChanged( this );
00114 }
|
|
|
pure virtual in QLayoutItem
Definition at line 295 of file KDChartLayoutItems.cpp. References KDChart::AbstractLayoutItem::sizeHintChanged(). Referenced by KDChart::TextLayoutItem::maximumSize(), KDChart::CartesianAxis::maximumSize(), KDChart::TextLayoutItem::minimumSize(), KDChart::CartesianAxis::paintCtx(), KDChart::TextLayoutItem::setAutoReferenceArea(), KDChart::TextLayoutItem::setText(), and KDChart::TextLayoutItem::setTextAttributes().
00296 {
00297 if( realFontWasRecalculated() )
00298 {
00299 const QSize newSizeHint( calcSizeHint( cachedFont ) );
00300 if( newSizeHint != cachedSizeHint ){
00301 cachedSizeHint = newSizeHint;
00302 sizeHintChanged();
00303 }
00304 }
00305 //qDebug() << "-------- KDChart::TextLayoutItem::sizeHint() returns:"<<cachedSizeHint<<" ----------";
00306 return cachedSizeHint;
00307 }
|
|
|
Report changed size hint: ask the parent widget to recalculate the layout.
Definition at line 86 of file KDChartLayoutItems.cpp. Referenced by KDChart::TextLayoutItem::sizeHint().
00087 {
00088 // This is exactly like what QWidget::updateGeometry does.
00089 // qDebug("KDChart::AbstractLayoutItem::sizeHintChanged() called");
00090 if( mParent ) {
00091 if ( mParent->layout() )
00092 mParent->layout()->invalidate();
00093 else
00094 QApplication::postEvent( mParent, new QEvent( QEvent::LayoutRequest ) );
00095 }
00096 }
|
|
|
Definition at line 147 of file KDChartLayoutItems.cpp. Referenced by KDChart::CartesianAxis::paintCtx().
00148 {
00149 return mText;
00150 }
|
|
|
Returns the text attributes to be used for this item.
Definition at line 169 of file KDChartLayoutItems.cpp. Referenced by clone().
00170 {
00171 return mAttributes;
00172 }
|
|
|
Definition at line 116 of file KDChartHeaderFooter.cpp. References d. Referenced by clone().
00117 {
00118 return d->type;
00119 }
|
|
|
Reimplemented from KDChart::TextArea. Definition at line 68 of file KDChartHeaderFooter.h. |
|
|
Definition at line 88 of file KDChartLayoutItems.h. Referenced by KDChart::AbstractLayoutItem::setParentWidget(). |
|
|
Definition at line 89 of file KDChartLayoutItems.h. |
1.3.6