#include <KDChartLayoutItems.h>
Definition at line 174 of file KDChartLayoutItems.h.
Public Member Functions | |
const QObject * | autoReferenceArea () const |
virtual Qt::Orientations | expandingDirections () const |
pure virtual in QLayoutItem | |
virtual QRect | geometry () const |
pure virtual in QLayoutItem | |
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 *painter) |
virtual void | paintAll (QPainter &painter) |
Default impl: just call paint. | |
virtual void | paintCtx (PaintContext *context) |
Default impl: Paint the complete item using its layouted position and size. | |
QLayout * | parentLayout () |
void | removeFromParentLayout () |
void | setAutoReferenceArea (const QObject *area) |
virtual void | setGeometry (const QRect &r) |
pure virtual in QLayoutItem | |
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 | setText (const QString &text) |
void | setTextAttributes (const TextAttributes &a) |
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 |
TextBubbleLayoutItem (const QString &text, const TextAttributes &attributes, const QObject *autoReferenceArea, KDChartEnums::MeasureOrientation autoReferenceOrientation, Qt::Alignment alignment=0) | |
TextBubbleLayoutItem () | |
~TextBubbleLayoutItem () | |
Protected Member Functions | |
int | borderWidth () const |
Protected Attributes | |
QWidget * | mParent |
QLayout * | mParentLayout |
KDChart::TextBubbleLayoutItem::TextBubbleLayoutItem | ( | ) |
Definition at line 109 of file KDChartLayoutItems.cpp.
00110 : AbstractLayoutItem( Qt::AlignLeft ), 00111 m_text( new TextLayoutItem() ) 00112 { 00113 }
KDChart::TextBubbleLayoutItem::TextBubbleLayoutItem | ( | const QString & | text, | |
const TextAttributes & | attributes, | |||
const QObject * | autoReferenceArea, | |||
KDChartEnums::MeasureOrientation | autoReferenceOrientation, | |||
Qt::Alignment | alignment = 0 | |||
) |
Definition at line 99 of file KDChartLayoutItems.cpp.
00104 : AbstractLayoutItem( alignment ), 00105 m_text( new TextLayoutItem( text, attributes, area, orientation, alignment ) ) 00106 { 00107 }
KDChart::TextBubbleLayoutItem::~TextBubbleLayoutItem | ( | ) |
const QObject * KDChart::TextBubbleLayoutItem::autoReferenceArea | ( | ) | const |
Definition at line 125 of file KDChartLayoutItems.cpp.
References KDChart::TextLayoutItem::autoReferenceArea().
int KDChart::TextBubbleLayoutItem::borderWidth | ( | ) | const [protected] |
Definition at line 202 of file KDChartLayoutItems.cpp.
Referenced by geometry(), maximumSize(), minimumSize(), setGeometry(), and sizeHint().
Qt::Orientations KDChart::TextBubbleLayoutItem::expandingDirections | ( | ) | const [virtual] |
pure virtual in QLayoutItem
Definition at line 155 of file KDChartLayoutItems.cpp.
References KDChart::TextLayoutItem::expandingDirections().
QRect KDChart::TextBubbleLayoutItem::geometry | ( | ) | const [virtual] |
pure virtual in QLayoutItem
Definition at line 184 of file KDChartLayoutItems.cpp.
References borderWidth(), and KDChart::TextLayoutItem::geometry().
Referenced by paint().
00185 { 00186 const int border = borderWidth(); 00187 return m_text->geometry().adjusted( -border, -border, border, border ); 00188 }
bool KDChart::TextBubbleLayoutItem::isEmpty | ( | ) | const [virtual] |
pure virtual in QLayoutItem
Definition at line 150 of file KDChartLayoutItems.cpp.
References KDChart::TextLayoutItem::isEmpty().
QSize KDChart::TextBubbleLayoutItem::maximumSize | ( | ) | const [virtual] |
pure virtual in QLayoutItem
Definition at line 160 of file KDChartLayoutItems.cpp.
References borderWidth(), and KDChart::TextLayoutItem::maximumSize().
00161 { 00162 const int border = borderWidth(); 00163 return m_text->maximumSize() + QSize( 2 * border, 2 * border ); 00164 }
QSize KDChart::TextBubbleLayoutItem::minimumSize | ( | ) | const [virtual] |
pure virtual in QLayoutItem
Definition at line 166 of file KDChartLayoutItems.cpp.
References borderWidth(), and KDChart::TextLayoutItem::minimumSize().
00167 { 00168 const int border = borderWidth(); 00169 return m_text->minimumSize() + QSize( 2 * border, 2 * border ); 00170 }
void KDChart::TextBubbleLayoutItem::paint | ( | QPainter * | painter | ) | [virtual] |
Implements KDChart::AbstractLayoutItem.
Definition at line 190 of file KDChartLayoutItems.cpp.
References geometry(), and KDChart::TextLayoutItem::paint().
00191 { 00192 const QPen oldPen = painter->pen(); 00193 const QBrush oldBrush = painter->brush(); 00194 painter->setPen( Qt::black ); 00195 painter->setBrush( QColor( 255, 255, 220 ) ); 00196 painter->drawRoundRect( geometry(), 10 ); 00197 painter->setPen( oldPen ); 00198 painter->setBrush( oldBrush ); 00199 m_text->paint( painter ); 00200 }
void KDChart::AbstractLayoutItem::paintAll | ( | QPainter & | painter | ) | [virtual, inherited] |
Default impl: just call paint.
Derived classes like KDChart::AbstractArea are providing additional action here.
Reimplemented in KDChart::AbstractArea, KDChart::TextArea, and KDChart::TernaryAxis.
Definition at line 70 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::paint().
00071 { 00072 paint( &painter ); 00073 }
void KDChart::AbstractLayoutItem::paintCtx | ( | PaintContext * | context | ) | [virtual, inherited] |
Default impl: Paint the complete item using its layouted position and size.
Reimplemented in KDChart::CartesianAxis, KDChart::LeveyJenningsAxis, and KDChart::TernaryAxis.
Definition at line 78 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::paint(), and KDChart::PaintContext::painter().
00079 { 00080 if( context ) 00081 paint( context->painter() ); 00082 }
QLayout* KDChart::AbstractLayoutItem::parentLayout | ( | ) | [inherited] |
void KDChart::AbstractLayoutItem::removeFromParentLayout | ( | ) | [inherited] |
Definition at line 83 of file KDChartLayoutItems.h.
Referenced by KDChart::Chart::takeCoordinatePlane().
00084 { 00085 if( mParentLayout ){ 00086 if( widget() ) 00087 mParentLayout->removeWidget( widget() ); 00088 else 00089 mParentLayout->removeItem( this ); 00090 } 00091 }
void KDChart::TextBubbleLayoutItem::setAutoReferenceArea | ( | const QObject * | area | ) |
Definition at line 120 of file KDChartLayoutItems.cpp.
References KDChart::TextLayoutItem::setAutoReferenceArea().
void KDChart::TextBubbleLayoutItem::setGeometry | ( | const QRect & | r | ) | [virtual] |
pure virtual in QLayoutItem
Definition at line 178 of file KDChartLayoutItems.cpp.
References borderWidth(), and KDChart::TextLayoutItem::setGeometry().
00179 { 00180 const int border = borderWidth(); 00181 m_text->setGeometry( r.adjusted( border, border, -border, -border ) ); 00182 }
void KDChart::AbstractLayoutItem::setParentLayout | ( | QLayout * | lay | ) | [inherited] |
void KDChart::AbstractLayoutItem::setParentWidget | ( | QWidget * | widget | ) | [virtual, inherited] |
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 65 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::mParent.
Referenced by KDChart::HeaderFooter::setParent(), and KDChart::AbstractCartesianDiagram::takeAxis().
00066 { 00067 mParent = widget; 00068 }
void KDChart::TextBubbleLayoutItem::setText | ( | const QString & | text | ) |
Definition at line 130 of file KDChartLayoutItems.cpp.
References KDChart::TextLayoutItem::setText().
00131 { 00132 m_text->setText( text ); 00133 }
void KDChart::TextBubbleLayoutItem::setTextAttributes | ( | const TextAttributes & | a | ) |
Definition at line 140 of file KDChartLayoutItems.cpp.
References KDChart::TextLayoutItem::setTextAttributes().
QSize KDChart::TextBubbleLayoutItem::sizeHint | ( | ) | const [virtual] |
pure virtual in QLayoutItem
Definition at line 172 of file KDChartLayoutItems.cpp.
References borderWidth(), and KDChart::TextLayoutItem::sizeHint().
00173 { 00174 const int border = borderWidth(); 00175 return m_text->sizeHint() + QSize( 2 * border, 2 * border ); 00176 }
void KDChart::AbstractLayoutItem::sizeHintChanged | ( | ) | const [virtual, inherited] |
Report changed size hint: ask the parent widget to recalculate the layout.
Definition at line 87 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::mParent.
Referenced by KDChart::TextLayoutItem::sizeHintAndRotatedCorners().
00088 { 00089 // This is exactly like what QWidget::updateGeometry does. 00090 // qDebug("KDChart::AbstractLayoutItem::sizeHintChanged() called"); 00091 if( mParent ) { 00092 if ( mParent->layout() ) 00093 mParent->layout()->invalidate(); 00094 else 00095 QApplication::postEvent( mParent, new QEvent( QEvent::LayoutRequest ) ); 00096 } 00097 }
QString KDChart::TextBubbleLayoutItem::text | ( | ) | const |
KDChart::TextAttributes KDChart::TextBubbleLayoutItem::textAttributes | ( | ) | const |
Definition at line 145 of file KDChartLayoutItems.cpp.
References KDChart::TextLayoutItem::textAttributes().
QWidget* KDChart::AbstractLayoutItem::mParent [protected, inherited] |
QLayout* KDChart::AbstractLayoutItem::mParentLayout [protected, inherited] |
Definition at line 94 of file KDChartLayoutItems.h.
Referenced by KDChart::AutoSpacerLayoutItem::paint().