KD Chart 2  [rev.2.7]
Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | List of all members
KDChart::PolarCoordinatePlane Class Reference

Polar coordinate plane. More...

#include <KDChartPolarCoordinatePlane.h>

Inheritance diagram for KDChart::PolarCoordinatePlane:
Inheritance graph
[legend]
Collaboration diagram for KDChart::PolarCoordinatePlane:
Collaboration graph
[legend]

Public Types

enum  AxesCalcMode {
  Linear,
  Logarithmic
}
 
typedef QList< CoordinateTransformation > CoordinateTransformationList
 

Public Slots

void layoutPlanes ()
 Calling layoutPlanes() on the plane triggers the global KDChart::Chart::slotLayoutPlanes() More...
 
void relayout ()
 Calling relayout() on the plane triggers the global KDChart::Chart::slotRelayout() More...
 
void setGridNeedsRecalculate ()
 Used by the chart to clear the cached grid data. More...
 
void update ()
 Calling update() on the plane triggers the global KDChart::Chart::update() More...
 

Signals

void boundariesChanged ()
 
void destroyedCoordinatePlane (AbstractCoordinatePlane *)
 Emitted when this coordinate plane is destroyed. More...
 
void geometryChanged (QRect, QRect)
 Emitted after the geometry of the Coordinate Plane has been changed. More...
 
void internal_geometryChanged (QRect, QRect)
 
void needLayoutPlanes ()
 Emitted when plane needs to trigger the Chart's layouting of the coord. More...
 
void needRelayout ()
 Emitted when plane needs to trigger the Chart's layouting. More...
 
void needUpdate ()
 Emitted when plane needs to update its drawings. More...
 
void positionChanged (AbstractArea *)
 
void propertiesChanged ()
 Emitted upon change of a property of the Coordinate Plane or any of its components. More...
 
void viewportCoordinateSystemChanged ()
 Emitted upon change of the view coordinate system. More...
 

Public Member Functions

void addDiagram (AbstractDiagram *diagram) override
 Adds a diagram to this coordinate plane. More...
 
void alignToReferencePoint (const RelativePosition &position)
 
qreal angleUnit () const
 
BackgroundAttributes backgroundAttributes () const
 
virtual int bottomOverlap (bool doNotRecalculate=false) const
 This is called at layout time by KDChart:AutoSpacerLayoutItem::sizeHint(). More...
 
bool compare (const AbstractAreaBase *other) const
 Returns true if both areas have the same settings. More...
 
AbstractDiagramdiagram ()
 
AbstractDiagramList diagrams ()
 
ConstAbstractDiagramList diagrams () const
 
Qt::Orientations expandingDirections () const override
 pure virtual in QLayoutItem More...
 
FrameAttributes frameAttributes () const
 
QRect geometry () const override
 pure virtual in QLayoutItem More...
 
void getFrameLeadings (int &left, int &top, int &right, int &bottom) const
 
GridAttributes globalGridAttributes () const
 
const GridAttributes gridAttributes (bool circular) const
 
DataDimensionsList gridDimensionsList ()
 Returns the dimensions used for drawing the grid lines. More...
 
bool hasOwnGridAttributes (bool circular) const
 
bool isCornerSpacersEnabled () const
 
bool isEmpty () const override
 pure virtual in QLayoutItem More...
 
bool isRubberBandZoomingEnabled () const
 
const bool isVisiblePoint (const QPointF &point) const
 Tests, if a point is visible on the coordinate plane. More...
 
virtual int leftOverlap (bool doNotRecalculate=false) const
 This is called at layout time by KDChart::AutoSpacerLayoutItem::sizeHint(). More...
 
QSize maximumSize () const override
 pure virtual in QLayoutItem More...
 
QSize minimumSize () const override
 pure virtual in QLayoutItem More...
 
virtual void mouseDoubleClickEvent (QMouseEvent *event)
 
virtual void mouseMoveEvent (QMouseEvent *event)
 
virtual void mousePressEvent (QMouseEvent *event)
 
virtual void mouseReleaseEvent (QMouseEvent *event)
 
void paint (QPainter *) override
 reimpl More...
 
void paintAll (QPainter &painter) override
 Call paintAll, if you want the background and the frame to be drawn before the normal paint() is invoked automatically. More...
 
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. More...
 
virtual void paintFrame (QPainter &painter, const QRect &rectangle)
 
virtual void paintIntoRect (QPainter &painter, const QRect &rect)
 Draws the background and frame, then calls paint(). More...
 
Chartparent ()
 
const Chartparent () const
 
QLayout * parentLayout ()
 
 PolarCoordinatePlane (Chart *parent=0)
 
qreal radiusUnit () const
 
AbstractCoordinatePlanereferenceCoordinatePlane () const
 There are two ways, in which planes can be caused to interact, in where they are put layouting wise: The first is the reference plane. More...
 
void removeFromParentLayout ()
 
virtual void replaceDiagram (AbstractDiagram *diagram, AbstractDiagram *oldDiagram=0)
 Replaces the old diagram, or appends the diagram, it there is none yet. More...
 
void resetGridAttributes (bool circular)
 Reset the attributes to be used for grid lines drawn in circular direction (or in sagittal direction, resp.). More...
 
virtual int rightOverlap (bool doNotRecalculate=false) const
 This is called at layout time by KDChart::AutoSpacerLayoutItem::sizeHint(). More...
 
void setBackgroundAttributes (const BackgroundAttributes &a)
 
void setCornerSpacersEnabled (bool enable)
 Enables or disables the use of spacers in the plane corners. More...
 
void setFrameAttributes (const FrameAttributes &a)
 
void setGeometry (const QRect &r) override
 pure virtual in QLayoutItem More...
 
void setGlobalGridAttributes (const GridAttributes &)
 Set the grid attributes to be used by this coordinate plane. More...
 
void setGridAttributes (bool circular, const GridAttributes &)
 Set the attributes to be used for grid lines drawn in circular direction (or in sagittal direction, resp.). More...
 
void setParent (Chart *parent)
 Called internally by KDChart::Chart. More...
 
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. More...
 
void setReferenceCoordinatePlane (AbstractCoordinatePlane *plane)
 Set another coordinate plane to be used as the reference plane for this one. More...
 
void setRubberBandZoomingEnabled (bool enable)
 Enables or disables zooming with a rubber band using the mouse. More...
 
void setStartPosition (qreal degrees)
 Specify the rotation of the coordinate plane. More...
 
void setZoomCenter (const QPointF &center) override
 Set the point (in value coordinates) to be used as the center point in zoom operations. More...
 
void setZoomFactors (qreal factorX, qreal factorY) override
 Sets both zoom factors in one go. More...
 
void setZoomFactorX (qreal factor) override
 Sets the zoom factor in horizontal direction, that is applied to all coordinate transformations. More...
 
void setZoomFactorY (qreal factor) override
 Sets the zoom factor in vertical direction, that is applied to all coordinate transformations. More...
 
virtual AbstractCoordinatePlanesharedAxisMasterPlane (QPainter *p=0)
 
QSize sizeHint () const override
 pure virtual in QLayoutItem More...
 
virtual void sizeHintChanged () const
 Report changed size hint: ask the parent widget to recalculate the layout. More...
 
qreal startPosition () const
 Retrieve the rotation of the coordinate plane. More...
 
virtual void takeDiagram (AbstractDiagram *diagram)
 Removes the diagram from the plane, without deleting it. More...
 
virtual int topOverlap (bool doNotRecalculate=false) const
 This is called at layout time by KDChart::AutoSpacerLayoutItem::sizeHint(). More...
 
const QPointF translate (const QPointF &diagramPoint) const override
 Translate the given point in value space coordinates to a position in pixel space. More...
 
const QPointF translatePolar (const QPointF &diagramPoint) const
 
QPointF zoomCenter () const override
 
qreal zoomFactorX () const override
 
qreal zoomFactorY () const override
 
 ~PolarCoordinatePlane () override
 

Static Public Member Functions

static void paintBackgroundAttributes (QPainter &painter, const QRect &rectangle, const KDChart::BackgroundAttributes &attributes)
 
static void paintFrameAttributes (QPainter &painter, const QRect &rectangle, const KDChart::FrameAttributes &attributes)
 

Protected Slots

void adjustZoomAndRepaint ()
 
void slotLayoutChanged (AbstractDiagram *diagram)
 

Protected Member Functions

QRect areaGeometry () const override
 
DataDimensionsList getDataDimensionsList () const override
 
QRect innerRect () const
 
void layoutDiagrams () override
 Distribute the available space among the diagrams and axes. More...
 
void paintEvent (QPaintEvent *)
 
void positionHasChanged () override
 
void resizeEvent (QResizeEvent *)
 

Protected Attributes

QWidgetmParent
 
QLayout * mParentLayout
 

Detailed Description

Polar coordinate plane.

Definition at line 36 of file KDChartPolarCoordinatePlane.h.

Member Typedef Documentation

Definition at line 44 of file KDChartPolarCoordinatePlane.h.

Member Enumeration Documentation

Enumerator
Linear 
Logarithmic 

Definition at line 53 of file KDChartAbstractCoordinatePlane.h.

Constructor & Destructor Documentation

PolarCoordinatePlane::PolarCoordinatePlane ( Chart parent = 0)
explicit

Definition at line 47 of file KDChartPolarCoordinatePlane.cpp.

PolarCoordinatePlane::~PolarCoordinatePlane ( )
override

Definition at line 53 of file KDChartPolarCoordinatePlane.cpp.

Member Function Documentation

void PolarCoordinatePlane::addDiagram ( AbstractDiagram diagram)
overridevirtual

Adds a diagram to this coordinate plane.

Parameters
diagramThe diagram to add.
See also
replaceDiagram, takeDiagram

Reimplemented from KDChart::AbstractCoordinatePlane.

Definition at line 63 of file KDChartPolarCoordinatePlane.cpp.

References KDChart::AbstractCoordinatePlane::addDiagram(), and slotLayoutChanged().

void PolarCoordinatePlane::adjustZoomAndRepaint ( )
protectedslot
void AbstractAreaBase::alignToReferencePoint ( const RelativePosition position)
inherited

Definition at line 81 of file KDChartAbstractAreaBase.cpp.

qreal PolarCoordinatePlane::angleUnit ( ) const

Definition at line 210 of file KDChartPolarCoordinatePlane.cpp.

References d.

Referenced by layoutDiagrams().

QRect AbstractArea::areaGeometry ( ) const
overrideprotectedvirtualinherited
BackgroundAttributes AbstractAreaBase::backgroundAttributes ( ) const
inherited

Definition at line 111 of file KDChartAbstractAreaBase.cpp.

References d.

Referenced by KDChart::AbstractAreaBase::compare(), and updateCommonBrush().

int AbstractArea::bottomOverlap ( bool  doNotRecalculate = false) const
virtualinherited

This is called at layout time by KDChart:AutoSpacerLayoutItem::sizeHint().

The method triggers AbstractArea::sizeHint() to find out the amount of overlap at the bottom edge of the area.

Note
The default implementation is not using any caching, it might make sense to implement a more sophisticated solution for derived classes that have complex work to do in sizeHint(). All we have here is a primitive flag to be set by the caller if it is sure that no sizeHint() needs to be called.

Definition at line 98 of file KDChartAbstractArea.cpp.

References d.

Referenced by KDChart::AutoSpacerLayoutItem::sizeHint().

void KDChart::AbstractCoordinatePlane::boundariesChanged ( )
signalinherited
bool AbstractAreaBase::compare ( const AbstractAreaBase other) const
inherited

Returns true if both areas have the same settings.

Definition at line 71 of file KDChartAbstractAreaBase.cpp.

References KDChart::AbstractAreaBase::backgroundAttributes(), and KDChart::AbstractAreaBase::frameAttributes().

Referenced by KDChart::Legend::compare().

void KDChart::AbstractCoordinatePlane::destroyedCoordinatePlane ( AbstractCoordinatePlane )
signalinherited

Emitted when this coordinate plane is destroyed.

Referenced by KDChart::AbstractCoordinatePlane::~AbstractCoordinatePlane().

AbstractDiagram * AbstractCoordinatePlane::diagram ( )
inherited
AbstractDiagramList AbstractCoordinatePlane::diagrams ( )
inherited
ConstAbstractDiagramList AbstractCoordinatePlane::diagrams ( ) const
inherited
Returns
The list of diagrams associated with this coordinate plane.

Definition at line 145 of file KDChartAbstractCoordinatePlane.cpp.

References d.

Qt::Orientations KDChart::AbstractCoordinatePlane::expandingDirections ( ) const
overrideinherited

pure virtual in QLayoutItem

Definition at line 211 of file KDChartAbstractCoordinatePlane.cpp.

FrameAttributes AbstractAreaBase::frameAttributes ( ) const
inherited
QRect KDChart::AbstractCoordinatePlane::geometry ( ) const
overrideinherited
void KDChart::AbstractCoordinatePlane::geometryChanged ( QRect  ,
QRect   
)
signalinherited

Emitted after the geometry of the Coordinate Plane has been changed.

and control has returned to the event loop.

Parameters are the old geometry, the new geometry.

Referenced by KDChart::AbstractCoordinatePlane::~AbstractCoordinatePlane().

DataDimensionsList PolarCoordinatePlane::getDataDimensionsList ( ) const
overrideprotectedvirtual

Implements KDChart::AbstractCoordinatePlane.

Definition at line 310 of file KDChartPolarCoordinatePlane.cpp.

void AbstractAreaBase::getFrameLeadings ( int &  left,
int &  top,
int &  right,
int &  bottom 
) const
inherited
GridAttributes KDChart::AbstractCoordinatePlane::globalGridAttributes ( ) const
inherited
Returns
The grid attributes used by this coordinate plane.
See also
setGlobalGridAttributes
CartesianCoordinatePlane::gridAttributes

Definition at line 163 of file KDChartAbstractCoordinatePlane.cpp.

References d.

Referenced by gridAttributes(), and KDChart::CartesianCoordinatePlane::gridAttributes().

const GridAttributes KDChart::PolarCoordinatePlane::gridAttributes ( bool  circular) const
Returns
The attributes used for grid lines drawn in circular direction (or in sagittal direction, resp.).
Note
This function always returns a valid set of grid attributes: If no special grid attributes were set for this direction the global attributes are returned, as returned by AbstractCoordinatePlane::globalGridAttributes.
See also
setGridAttributes
resetGridAttributes
AbstractCoordinatePlane::globalGridAttributes
hasOwnGridAttributes

Definition at line 339 of file KDChartPolarCoordinatePlane.cpp.

References d, KDChart::AbstractCoordinatePlane::globalGridAttributes(), hasOwnGridAttributes(), KDChart::AbstractCoordinatePlane::propertiesChanged(), and translate().

KDChart::DataDimensionsList KDChart::AbstractCoordinatePlane::gridDimensionsList ( )
inherited

Returns the dimensions used for drawing the grid lines.

Returned data is the result of (cached) grid calculations, so - if you need that information for your own tasks - make sure to call again this function after every data modification that has changed the data range, since grid calculation is based upon the data range, thus the grid start/end might have changed if the data was changed.

Note
Returned list will contain different numbers of DataDimension, depending on the kind of coordinate plane used. For CartesianCoordinatePlane two DataDimension are returned: the first representing grid lines in X direction (matching the Abscissa axes) and the second indicating vertical grid lines (or Ordinate axes, resp.).
Returns
The dimensions used for drawing the grid lines.
See also
DataDimension

Definition at line 168 of file KDChartAbstractCoordinatePlane.cpp.

References d.

Referenced by KDChart::CartesianCoordinatePlane::layoutDiagrams(), KDChart::CartesianAxis::maximumSize(), numSignificantDecimalPlaces(), and KDChart::PaintingHelpers::paintValueTracker().

bool KDChart::PolarCoordinatePlane::hasOwnGridAttributes ( bool  circular) const
Returns
Returns whether the grid attributes have been set for the respective direction via setGridAttributes( bool circular ).

If false, the grid will use the global attributes set by AbstractCoordinatePlane::globalGridAttributes (or the default attributes, resp.)

See also
setGridAttributes
resetGridAttributes
AbstractCoordinatePlane::globalGridAttributes

Definition at line 374 of file KDChartPolarCoordinatePlane.cpp.

References d.

Referenced by gridAttributes().

QRect AbstractAreaBase::innerRect ( ) const
protectedinherited
void KDChart::AbstractCoordinatePlane::internal_geometryChanged ( QRect  ,
QRect   
)
signalinherited
bool KDChart::AbstractCoordinatePlane::isCornerSpacersEnabled ( ) const
inherited
Returns
Whether this plane should have spacers in the corners formed by the presence of axes.

Definition at line 295 of file KDChartAbstractCoordinatePlane.cpp.

References d.

bool KDChart::AbstractCoordinatePlane::isEmpty ( ) const
overrideinherited

pure virtual in QLayoutItem

Definition at line 204 of file KDChartAbstractCoordinatePlane.cpp.

bool KDChart::AbstractCoordinatePlane::isRubberBandZoomingEnabled ( ) const
inherited
Returns
Whether zooming with a rubber band using the mouse is enabled.

Definition at line 282 of file KDChartAbstractCoordinatePlane.cpp.

References d.

const bool KDChart::AbstractCoordinatePlane::isVisiblePoint ( const QPointF &  point) const
inherited

Tests, if a point is visible on the coordinate plane.

Note
Before calling this function the point must have been translated into coordinate plane space.

Definition at line 426 of file KDChartAbstractCoordinatePlane.cpp.

References d.

void PolarCoordinatePlane::layoutDiagrams ( )
overrideprotectedvirtual
void KDChart::AbstractCoordinatePlane::layoutPlanes ( )
slotinherited
int AbstractArea::leftOverlap ( bool  doNotRecalculate = false) const
virtualinherited

This is called at layout time by KDChart::AutoSpacerLayoutItem::sizeHint().

The method triggers AbstractArea::sizeHint() to find out the amount of overlap at the left edge of the area.

Note
The default implementation is not using any caching, it might make sense to implement a more sophisticated solution for derived classes that have complex work to do in sizeHint(). All we have here is a primitive flag to be set by the caller if it is sure that no sizeHint() needs to be called.

Definition at line 74 of file KDChartAbstractArea.cpp.

References d.

Referenced by KDChart::AutoSpacerLayoutItem::sizeHint().

QSize KDChart::AbstractCoordinatePlane::maximumSize ( ) const
overrideinherited

pure virtual in QLayoutItem

Definition at line 216 of file KDChartAbstractCoordinatePlane.cpp.

Referenced by KDChart::AbstractCoordinatePlane::sizeHint().

QSize KDChart::AbstractCoordinatePlane::minimumSize ( ) const
overrideinherited

pure virtual in QLayoutItem

Definition at line 223 of file KDChartAbstractCoordinatePlane.cpp.

void KDChart::AbstractCoordinatePlane::mouseDoubleClickEvent ( QMouseEvent *  event)
virtualinherited
void KDChart::AbstractCoordinatePlane::mouseMoveEvent ( QMouseEvent *  event)
virtualinherited
void KDChart::AbstractCoordinatePlane::mousePressEvent ( QMouseEvent *  event)
virtualinherited
void KDChart::AbstractCoordinatePlane::mouseReleaseEvent ( QMouseEvent *  event)
virtualinherited
void KDChart::AbstractCoordinatePlane::needLayoutPlanes ( )
signalinherited

Emitted when plane needs to trigger the Chart's layouting of the coord.

planes.

Referenced by KDChart::AbstractCoordinatePlane::layoutPlanes().

void KDChart::AbstractCoordinatePlane::needRelayout ( )
signalinherited

Emitted when plane needs to trigger the Chart's layouting.

Referenced by KDChart::AbstractCoordinatePlane::relayout(), and KDChart::AbstractCoordinatePlane::setCornerSpacersEnabled().

void KDChart::AbstractCoordinatePlane::needUpdate ( )
signalinherited

Emitted when plane needs to update its drawings.

Referenced by KDChart::AbstractCoordinatePlane::update().

void PolarCoordinatePlane::paint ( QPainter *  painter)
overridevirtual
void AbstractArea::paintAll ( QPainter &  painter)
overridevirtualinherited

Call paintAll, if you want the background and the frame to be drawn before the normal paint() is invoked automatically.

Reimplemented from KDChart::AbstractLayoutItem.

Reimplemented in KDChart::TernaryAxis.

Definition at line 120 of file KDChartAbstractArea.cpp.

References KDChart::AbstractArea::areaGeometry(), d, KDChart::AbstractAreaBase::innerRect(), KDChart::AbstractLayoutItem::paint(), KDChart::AbstractAreaBase::paintBackground(), and KDChart::AbstractAreaBase::paintFrame().

Referenced by KDChart::AbstractArea::paintIntoRect().

void AbstractAreaBase::paintBackground ( QPainter &  painter,
const QRect &  rectangle 
)
virtualinherited
void AbstractAreaBase::paintBackgroundAttributes ( QPainter &  painter,
const QRect &  rectangle,
const KDChart::BackgroundAttributes attributes 
)
staticinherited
void KDChart::AbstractLayoutItem::paintCtx ( PaintContext context)
virtualinherited

Default impl: Paint the complete item using its layouted position and size.

Reimplemented in KDChart::CartesianAxis, KDChart::LeveyJenningsAxis, and KDChart::TernaryAxis.

Definition at line 72 of file KDChartLayoutItems.cpp.

References KDChart::AbstractLayoutItem::paint(), and KDChart::PaintContext::painter().

void KDChart::PolarCoordinatePlane::paintEvent ( QPaintEvent *  )
protected
void AbstractAreaBase::paintFrame ( QPainter &  painter,
const QRect &  rectangle 
)
virtualinherited
void AbstractAreaBase::paintFrameAttributes ( QPainter &  painter,
const QRect &  rectangle,
const KDChart::FrameAttributes attributes 
)
staticinherited
void AbstractArea::paintIntoRect ( QPainter &  painter,
const QRect &  rect 
)
virtualinherited

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 AbstractLayoutItem::paint() instead.

Definition at line 108 of file KDChartAbstractArea.cpp.

References KDChart::AbstractArea::paintAll().

KDChart::Chart * KDChart::AbstractCoordinatePlane::parent ( )
inherited
const KDChart::Chart * KDChart::AbstractCoordinatePlane::parent ( ) const
inherited

Definition at line 193 of file KDChartAbstractCoordinatePlane.cpp.

References d.

QLayout* KDChart::AbstractLayoutItem::parentLayout ( )
inherited

Definition at line 77 of file KDChartLayoutItems.h.

void KDChart::AbstractArea::positionChanged ( AbstractArea )
signalinherited
void AbstractArea::positionHasChanged ( )
overrideprotectedvirtualinherited

Reimplemented from KDChart::AbstractAreaBase.

Definition at line 156 of file KDChartAbstractArea.cpp.

References KDChart::AbstractArea::positionChanged().

void KDChart::AbstractCoordinatePlane::propertiesChanged ( )
signalinherited
qreal PolarCoordinatePlane::radiusUnit ( ) const

Definition at line 217 of file KDChartPolarCoordinatePlane.cpp.

References d.

Referenced by layoutDiagrams().

AbstractCoordinatePlane * KDChart::AbstractCoordinatePlane::referenceCoordinatePlane ( ) const
inherited

There are two ways, in which planes can be caused to interact, in where they are put layouting wise: The first is the reference plane.

If such a reference plane is set, on a plane, it will use the same cell in the layout as that one. In addition to this, planes can share an axis. In that case they will be laid out in relation to each other as suggested by the position of the axis. If, for example Plane1 and Plane2 share an axis at position Left, that will result in the layout: Axis Plane1 Plane 2, vertically. If Plane1 also happens to be Plane2's reference plane, both planes are drawn over each other. The reference plane concept allows two planes to share the same space even if neither has any axis, and in case there are shared axis, it is used to decided, whether the planes should be painted on top of each other or laid out vertically or horizontally next to each other.

Returns
The reference coordinate plane associated with this one.

Definition at line 183 of file KDChartAbstractCoordinatePlane.cpp.

References d.

Referenced by findSharingAxisDiagrams(), and invalidateLayoutTree().

void KDChart::AbstractCoordinatePlane::relayout ( )
slotinherited

Calling relayout() on the plane triggers the global KDChart::Chart::slotRelayout()

Definition at line 259 of file KDChartAbstractCoordinatePlane.cpp.

References KDChart::AbstractCoordinatePlane::needRelayout().

Referenced by KDChart::AbstractCoordinatePlane::addDiagram(), and KDChart::AbstractCoordinatePlane::takeDiagram().

void KDChart::AbstractLayoutItem::removeFromParentLayout ( )
inherited
void AbstractCoordinatePlane::replaceDiagram ( AbstractDiagram diagram,
AbstractDiagram oldDiagram = 0 
)
virtualinherited

Replaces the old diagram, or appends the diagram, it there is none yet.

Parameters
diagramThe diagram to be used instead of the old diagram. This parameter must not be zero, or the method will do nothing.
oldDiagramThe diagram to be removed by the new diagram. This diagram will be deleted automatically. If the parameter is omitted, the very first diagram will be replaced. In case, there was no diagram yet, the new diagram will just be added.
Note
If you want to re-use the old diagram, call takeDiagram and addDiagram, instead of using replaceDiagram.
See also
addDiagram, takeDiagram

Definition at line 93 of file KDChartAbstractCoordinatePlane.cpp.

References KDChart::AbstractCoordinatePlane::addDiagram(), d, KDChart::AbstractCoordinatePlane::layoutDiagrams(), KDChart::AbstractCoordinatePlane::layoutPlanes(), KDChart::AbstractCoordinatePlane::takeDiagram(), and KDChart::AbstractCoordinatePlane::update().

Referenced by KDChart::Widget::setType().

void KDChart::PolarCoordinatePlane::resetGridAttributes ( bool  circular)

Reset the attributes to be used for grid lines drawn in circular direction (or in sagittal direction, resp.).

By calling this method you specify that the global attributes set by AbstractCoordinatePlane::setGlobalGridAttributes be used.

See also
setGridAttributes, gridAttributes
AbstractCoordinatePlane::globalGridAttributes
hasOwnGridAttributes

Definition at line 332 of file KDChartPolarCoordinatePlane.cpp.

References KDChart::AbstractCoordinatePlane::update().

void PolarCoordinatePlane::resizeEvent ( QResizeEvent *  )
protected

Definition at line 144 of file KDChartPolarCoordinatePlane.cpp.

References d, and layoutDiagrams().

int AbstractArea::rightOverlap ( bool  doNotRecalculate = false) const
virtualinherited

This is called at layout time by KDChart::AutoSpacerLayoutItem::sizeHint().

The method triggers AbstractArea::sizeHint() to find out the amount of overlap at the right edge of the area.

Note
The default implementation is not using any caching, it might make sense to implement a more sophisticated solution for derived classes that have complex work to do in sizeHint(). All we have here is a primitive flag to be set by the caller if it is sure that no sizeHint() needs to be called.

Definition at line 82 of file KDChartAbstractArea.cpp.

References d.

Referenced by KDChart::AutoSpacerLayoutItem::sizeHint().

void AbstractAreaBase::setBackgroundAttributes ( const BackgroundAttributes a)
inherited
void KDChart::AbstractCoordinatePlane::setCornerSpacersEnabled ( bool  enable)
inherited

Enables or disables the use of spacers in the plane corners.

Definition at line 287 of file KDChartAbstractCoordinatePlane.cpp.

References d, and KDChart::AbstractCoordinatePlane::needRelayout().

void AbstractAreaBase::setFrameAttributes ( const FrameAttributes a)
inherited
void KDChart::AbstractCoordinatePlane::setGeometry ( const QRect &  r)
overrideinherited

pure virtual in QLayoutItem

Note
Do not call this function directly, unless you know exactly what you are doing. Geometry management is done by KD Chart's internal layouting measures.

Definition at line 235 of file KDChartAbstractCoordinatePlane.cpp.

References d, and KDChart::AbstractCoordinatePlane::internal_geometryChanged().

Referenced by KDChart::CartesianCoordinatePlane::setGeometry().

void KDChart::AbstractCoordinatePlane::setGlobalGridAttributes ( const GridAttributes a)
inherited

Set the grid attributes to be used by this coordinate plane.

To disable grid painting, for example, your code should like this:

GridAttributes ga = plane->globalGridAttributes();
ga.setGlobalGridVisible( false );
plane->setGlobalGridAttributes( ga );
See also
globalGridAttributes
CartesianCoordinatePlane::setGridAttributes

Definition at line 157 of file KDChartAbstractCoordinatePlane.cpp.

References d, and KDChart::AbstractCoordinatePlane::update().

void KDChart::PolarCoordinatePlane::setGridAttributes ( bool  circular,
const GridAttributes a 
)

Set the attributes to be used for grid lines drawn in circular direction (or in sagittal direction, resp.).

To disable circular grid painting, for example, your code should like this:

GridAttributes ga = plane->gridAttributes( bool );
ga.setGridVisible( false );
plane-setGridAttributes( bool, ga );
Note
setGridAttributes overwrites the global attributes that were set by AbstractCoordinatePlane::setGlobalGridAttributes. To re-activate these global attributes you can call resetGridAttributes.
See also
resetGridAttributes, gridAttributes
AbstractCoordinatePlane::setGlobalGridAttributes
hasOwnGridAttributes

Definition at line 319 of file KDChartPolarCoordinatePlane.cpp.

References d, KDChart::AbstractCoordinatePlane::propertiesChanged(), and KDChart::AbstractCoordinatePlane::update().

void KDChart::AbstractCoordinatePlane::setGridNeedsRecalculate ( )
slotinherited

Used by the chart to clear the cached grid data.

Definition at line 173 of file KDChartAbstractCoordinatePlane.cpp.

References d.

Referenced by findSharingAxisDiagrams(), and KDChart::CartesianCoordinatePlane::setAxesCalcModeY().

void KDChart::AbstractCoordinatePlane::setParent ( KDChart::Chart parent)
inherited
void KDChart::AbstractLayoutItem::setParentLayout ( QLayout *  lay)
inherited
void KDChart::AbstractLayoutItem::setParentWidget ( QWidget widget)
virtualinherited

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 59 of file KDChartLayoutItems.cpp.

References KDChart::AbstractLayoutItem::mParent.

Referenced by KDChart::HeaderFooter::setParent(), KDChart::AbstractCartesianDiagram::takeAxis(), and updateToplevelLayout().

void KDChart::AbstractCoordinatePlane::setReferenceCoordinatePlane ( AbstractCoordinatePlane plane)
inherited

Set another coordinate plane to be used as the reference plane for this one.

Parameters
planeThe coordinate plane to be used the reference plane for this one.
See also
referenceCoordinatePlane

Definition at line 178 of file KDChartAbstractCoordinatePlane.cpp.

References d.

Referenced by invalidateLayoutTree().

void KDChart::AbstractCoordinatePlane::setRubberBandZoomingEnabled ( bool  enable)
inherited

Enables or disables zooming with a rubber band using the mouse.

Definition at line 271 of file KDChartAbstractCoordinatePlane.cpp.

References d.

void PolarCoordinatePlane::setStartPosition ( qreal  degrees)

Specify the rotation of the coordinate plane.

In a pie diagram this indicates the position where the first pie starts, in a polar diagram it specifies the Zero position of the circular axis:

polar-plane-start-position.png
Illustration of "start position" property
See also
startPosition

Definition at line 229 of file KDChartPolarCoordinatePlane.cpp.

References d, and KDChart::AbstractCoordinatePlane::diagram().

void PolarCoordinatePlane::setZoomCenter ( const QPointF &  center)
overridevirtual

Set the point (in value coordinates) to be used as the center point in zoom operations.

Parameters
centerThe point to use.

Reimplemented from KDChart::AbstractCoordinatePlane.

Definition at line 298 of file KDChartPolarCoordinatePlane.cpp.

References d.

void PolarCoordinatePlane::setZoomFactors ( qreal  factorX,
qreal  factorY 
)
overridevirtual

Sets both zoom factors in one go.

See also
setZoomFactorX,setZoomFactorY

Reimplemented from KDChart::AbstractCoordinatePlane.

Definition at line 263 of file KDChartPolarCoordinatePlane.cpp.

References setZoomFactorX(), and setZoomFactorY().

Referenced by adjustZoomAndRepaint().

void PolarCoordinatePlane::setZoomFactorX ( qreal  factor)
overridevirtual

Sets the zoom factor in horizontal direction, that is applied to all coordinate transformations.

Parameters
factorThe new zoom factor

Reimplemented from KDChart::AbstractCoordinatePlane.

Definition at line 269 of file KDChartPolarCoordinatePlane.cpp.

References d.

Referenced by setZoomFactors().

void PolarCoordinatePlane::setZoomFactorY ( qreal  factor)
overridevirtual

Sets the zoom factor in vertical direction, that is applied to all coordinate transformations.

Parameters
factorThe new zoom factor

Reimplemented from KDChart::AbstractCoordinatePlane.

Definition at line 280 of file KDChartPolarCoordinatePlane.cpp.

References d.

Referenced by setZoomFactors().

AbstractCoordinatePlane * KDChart::AbstractCoordinatePlane::sharedAxisMasterPlane ( QPainter *  p = 0)
virtualinherited
QSize KDChart::AbstractCoordinatePlane::sizeHint ( ) const
overrideinherited
void KDChart::AbstractLayoutItem::sizeHintChanged ( ) const
virtualinherited

Report changed size hint: ask the parent widget to recalculate the layout.

Definition at line 81 of file KDChartLayoutItems.cpp.

References KDChart::AbstractLayoutItem::mParent.

Referenced by KDChart::TextLayoutItem::sizeHint().

void PolarCoordinatePlane::slotLayoutChanged ( AbstractDiagram diagram)
protectedslot

Definition at line 224 of file KDChartPolarCoordinatePlane.cpp.

References d, and layoutDiagrams().

Referenced by addDiagram().

qreal PolarCoordinatePlane::startPosition ( ) const

Retrieve the rotation of the coordinate plane.

See also
setStartPosition

Definition at line 242 of file KDChartPolarCoordinatePlane.cpp.

References d.

Referenced by layoutDiagrams(), KDChart::RingDiagram::paint(), and KDChart::PieDiagram::paint().

void AbstractCoordinatePlane::takeDiagram ( AbstractDiagram diagram)
virtualinherited

Removes the diagram from the plane, without deleting it.

The plane no longer owns the diagram, so it is the caller's responsibility to delete the diagram.

See also
addDiagram, replaceDiagram

Definition at line 114 of file KDChartAbstractCoordinatePlane.cpp.

References d, KDChart::AbstractCoordinatePlane::layoutDiagrams(), KDChart::AbstractCoordinatePlane::layoutPlanes(), KDChart::AbstractCoordinatePlane::relayout(), KDChart::AbstractDiagram::setCoordinatePlane(), and KDChart::AbstractCoordinatePlane::update().

Referenced by KDChart::AbstractCoordinatePlane::replaceDiagram().

int AbstractArea::topOverlap ( bool  doNotRecalculate = false) const
virtualinherited

This is called at layout time by KDChart::AutoSpacerLayoutItem::sizeHint().

The method triggers AbstractArea::sizeHint() to find out the amount of overlap at the top edge of the area.

Note
The default implementation is not using any caching, it might make sense to implement a more sophisticated solution for derived classes that have complex work to do in sizeHint(). All we have here is a primitive flag to be set by the caller if it is sure that no sizeHint() needs to be called.

Definition at line 90 of file KDChartAbstractArea.cpp.

References d.

Referenced by KDChart::AutoSpacerLayoutItem::sizeHint().

const QPointF PolarCoordinatePlane::translate ( const QPointF &  diagramPoint) const
overridevirtual

Translate the given point in value space coordinates to a position in pixel space.

Parameters
diagramPointThe point in value coordinates.
Returns
The translated point.

Implements KDChart::AbstractCoordinatePlane.

Definition at line 196 of file KDChartPolarCoordinatePlane.cpp.

References d.

Referenced by gridAttributes().

const QPointF PolarCoordinatePlane::translatePolar ( const QPointF &  diagramPoint) const

Definition at line 203 of file KDChartPolarCoordinatePlane.cpp.

References d.

void KDChart::AbstractCoordinatePlane::update ( )
slotinherited
void KDChart::AbstractCoordinatePlane::viewportCoordinateSystemChanged ( )
signalinherited
QPointF PolarCoordinatePlane::zoomCenter ( ) const
overridevirtual
Returns
The center point (in value coordinates) of the coordinate plane, that is used for zoom operations.

Reimplemented from KDChart::AbstractCoordinatePlane.

Definition at line 291 of file KDChartPolarCoordinatePlane.cpp.

References d.

qreal PolarCoordinatePlane::zoomFactorX ( ) const
overridevirtual
Returns
The zoom factor in horizontal direction, that is applied to all coordinate transformations.

Reimplemented from KDChart::AbstractCoordinatePlane.

Definition at line 249 of file KDChartPolarCoordinatePlane.cpp.

References d.

Referenced by paint().

qreal PolarCoordinatePlane::zoomFactorY ( ) const
overridevirtual
Returns
The zoom factor in vertical direction, that is applied to all coordinate transformations.

Reimplemented from KDChart::AbstractCoordinatePlane.

Definition at line 256 of file KDChartPolarCoordinatePlane.cpp.

References d.

Referenced by paint().

Member Data Documentation

QWidget* KDChart::AbstractLayoutItem::mParent
protectedinherited
QLayout* KDChart::AbstractLayoutItem::mParentLayout
protectedinherited

Definition at line 92 of file KDChartLayoutItems.h.

Referenced by KDChart::AutoSpacerLayoutItem::paint().


The documentation for this class was generated from the following files:

Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/

https://www.kdab.com/development-resources/qt-tools/kd-chart/