#include "KChartEnums.h"
/**
* @brief base class for prerendered elements like labels, pixmaps, markers, etc.
*/
class PrerenderedElement {
public:
PrerenderedElement();
virtual ~PrerenderedElement() {}
/** Returns the rendered element.
If any of the properties have change, the element will be
regenerated. */
virtual const QPixmap& pixmap() const = 0;
/** Return the location of the reference point relatively to the
pixmap's origin. */
virtual QPointF referencePointLocation( KChartEnums::PositionValue ) const = 0;
/** Set the position of the element. */
void setPosition( const QPointF& position );
/** Get the position of the element. */
const QPointF& position() const;
/** Set the reference point of the element.
Every element has nine possible reference points (all compass
directions, plus the center.
*/
void setReferencePoint( KChartEnums::PositionValue );
/** Get the reference point of the element. */
KChartEnums::PositionValue referencePoint() const;
protected:
/** invalidate() needs to be called if any of the properties that
determine the visual appearance of the prerendered element
change.
It can be called for a const object, as objects may need to
force recalculation of the pixmap.
*/
virtual void invalidate() const = 0;
private:
QPointF m_position;
KChartEnums::PositionValue m_referencePoint;
};
/**
@brief PrerenderedLabel is an internal KChart class that simplifies creation
and caching of cached text labels.
It provides referenze points to anchor the text to other
elements. Reference points use the positions defined in
KChartEnums.
Usage:
qreal angle = 90.0;
CachedLabel label;
label.paint( font, tr("Label"), angle );
*/
// FIXME this is merely a prototype
// FIXME caching could be done by a second layer that can be used to,
// e.g., query for a prerendered element by id or name, or by changing
// the pixmap() method to do lazy evaluation.
class PrerenderedLabel : public PrerenderedElement
{
public:
PrerenderedLabel();
~PrerenderedLabel();
void setFont( const QFont& font );
const QFont& font() const;
void setText( const QString& text );
const QString& text() const;
void setBrush( const QBrush& brush );
const QBrush& brush() const;
void setPen( const QPen& );
const QPen& pen() const;
void setAngle( qreal angle );
qreal angle() const;
// reimpl PrerenderedElement:
- const QPixmap& pixmap() const Q_DECL_OVERRIDE;
- QPointF referencePointLocation( KChartEnums::PositionValue position ) const Q_DECL_OVERRIDE;
+ const QPixmap& pixmap() const override;
+ QPointF referencePointLocation( KChartEnums::PositionValue position ) const override;
// overload: return location of referencePoint():
QPointF referencePointLocation() const;
protected:
- void invalidate() const Q_DECL_OVERRIDE;
+ void invalidate() const override;
private:
/** Create a label with the given text and the given rotation
angle. Needs to be const, otherwise the pixmap() method cannot
update when needed. */
void paint() const;
// store the settings (these are used for the painting):
mutable bool m_dirty;
QFont m_font;
QString m_text;
QBrush m_brush;
QPen m_pen;
qreal m_angle;
// these are valid once the label has been rendered:
mutable QPixmap m_pixmap;
mutable QPointF m_referenceBottomLeft;
mutable QPointF m_textBaseLineVector;
mutable QPointF m_textAscendVector;
};
#endif
diff --git a/src/KChart/Polar/KChartAbstractPolarDiagram_p.h b/src/KChart/Polar/KChartAbstractPolarDiagram_p.h
index 679ddc2..bebd6eb 100644
--- a/src/KChart/Polar/KChartAbstractPolarDiagram_p.h
+++ b/src/KChart/Polar/KChartAbstractPolarDiagram_p.h
@@ -1,92 +1,92 @@
/*
* Copyright (C) 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
*
* This file is part of the KD Chart library.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef KCHARTABSTRACTPOLARDIAGRAM_P_H
#define KCHARTABSTRACTPOLARDIAGRAM_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the KD Chart API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "KChartAbstractPolarDiagram.h"
#include "KChartAbstractDiagram_p.h"
#include
#include "KChartMath_p.h"
namespace KChart {
class PolarCoordinatePlane;
/**
* \internal
*/
class Q_DECL_HIDDEN AbstractPolarDiagram::Private : public AbstractDiagram::Private
{
friend class AbstractPolarDiagram;
public:
Private();
~Private();
Private( const Private& rhs ) :
AbstractDiagram::Private( rhs ),
granularity( 0 )
{
// just for consistency
}
/** \reimpl */
// FIXME: Optimize when needed
- qreal calcPercentValue( const QModelIndex & index ) const Q_DECL_OVERRIDE
+ qreal calcPercentValue( const QModelIndex & index ) const override
{
Q_ASSERT( index.isValid() );
qreal sum = 0.0;
for ( int row = 0; row < attributesModel->rowCount( QModelIndex() ); row++ )
sum += attributesModel->data( attributesModel->index( row, index.column(), QModelIndex() ) ).toReal(); // checked
if ( sum == 0.0 )
return 0.0;
return attributesModel->data( attributesModel->mapFromSource( index ) ).toReal() / sum * 100.0;
}
private:
qreal granularity;
};
KCHART_IMPL_DERIVED_DIAGRAM( AbstractPolarDiagram, AbstractDiagram, PolarCoordinatePlane )
/*
inline AbstractPolarDiagram::AbstractPolarDiagram( Private * p )
: AbstractDiagram( p ) { init(); }
inline AbstractPolarDiagram::AbstractPolarDiagram(
Private *p, QWidget* parent, PolarCoordinatePlane* plane )
: AbstractDiagram( p, parent, plane ) { init(); }
inline AbstractPolarDiagram::Private * AbstractPolarDiagram::d_func()
{ return static_cast( AbstractDiagram::d_func() ); }
inline const AbstractPolarDiagram::Private * AbstractPolarDiagram::d_func() const
{ return static_cast( AbstractDiagram::d_func() ); }
*/
}
#endif /* KCHARTABSTRACTCARTESIANDIAGRAM_P_H */
diff --git a/src/KChart/Polar/KChartPieDiagram.h b/src/KChart/Polar/KChartPieDiagram.h
index 7cb6634..e4b1105 100644
--- a/src/KChart/Polar/KChartPieDiagram.h
+++ b/src/KChart/Polar/KChartPieDiagram.h
@@ -1,123 +1,123 @@
/*
* Copyright (C) 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
*
* This file is part of the KD Chart library.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef KCHARTPIEDIAGRAM_H
#define KCHARTPIEDIAGRAM_H
#include "KChartAbstractPieDiagram.h"
namespace KChart {
class LabelPaintCache;
/**
* @brief PieDiagram defines a common pie diagram
*/
class KCHART_EXPORT PieDiagram : public AbstractPieDiagram
{
Q_OBJECT
Q_DISABLE_COPY( PieDiagram )
KCHART_DECLARE_DERIVED_DIAGRAM( PieDiagram, PolarCoordinatePlane )
public:
explicit PieDiagram(
QWidget* parent = nullptr, PolarCoordinatePlane* plane = nullptr );
virtual ~PieDiagram();
protected:
// Implement AbstractDiagram
/** \reimpl */
- void paint( PaintContext* paintContext ) Q_DECL_OVERRIDE;
+ void paint( PaintContext* paintContext ) override;
public:
/**
* Describes which decorations are painted around data labels.
*/
enum LabelDecoration {
NoDecoration = 0, ///< No decoration
FrameDecoration = 1, ///< A rectangular frame is painted around the label text
LineFromSliceDecoration = 2 ///< A line is drawn from the pie slice to its label
};
Q_DECLARE_FLAGS( LabelDecorations, LabelDecoration )
/// Set the decorations to be painted around data labels according to @p decorations.
void setLabelDecorations( LabelDecorations decorations );
/// Return the decorations to be painted around data labels.
LabelDecorations labelDecorations() const;
/// If @p enabled is set to true, labels that would overlap will be shuffled to avoid overlap.
/// \note Collision avoidance may allow labels to be closer than AbstractDiagram with
/// allowOverlappingDataValueTexts() == false, so you should usually also call
/// setAllowOverlappingDataValueTexts( true ) if you enable this feature.
void setLabelCollisionAvoidanceEnabled( bool enabled );
/// Return whether overlapping labels will be moved to until they don't overlap anymore.
bool isLabelCollisionAvoidanceEnabled() const;
/** \reimpl */
- void resize ( const QSizeF& area ) Q_DECL_OVERRIDE;
+ void resize ( const QSizeF& area ) override;
// Implement AbstractPolarDiagram
/** \reimpl */
- qreal valueTotals () const Q_DECL_OVERRIDE;
+ qreal valueTotals () const override;
/** \reimpl */
- qreal numberOfValuesPerDataset() const Q_DECL_OVERRIDE;
+ qreal numberOfValuesPerDataset() const override;
/** \reimpl */
- qreal numberOfGridRings() const Q_DECL_OVERRIDE;
+ qreal numberOfGridRings() const override;
virtual PieDiagram * clone() const;
protected:
/** \reimpl */
- const QPair calculateDataBoundaries() const Q_DECL_OVERRIDE;
- void paintEvent( QPaintEvent* ) Q_DECL_OVERRIDE;
- void resizeEvent( QResizeEvent* ) Q_DECL_OVERRIDE;
+ const QPair calculateDataBoundaries() const override;
+ void paintEvent( QPaintEvent* ) override;
+ void resizeEvent( QResizeEvent* ) override;
private:
// ### move to private class?
void placeLabels( PaintContext* paintContext );
// Solve problems with label overlap by changing label positions inside d->labelPaintCache.
void shuffleLabels( QRectF* textBoundingRect );
void paintInternal( PaintContext* paintContext );
void drawSlice( QPainter* painter, const QRectF& drawPosition, uint slice );
void drawSliceSurface( QPainter* painter, const QRectF& drawPosition, uint slice );
void addSliceLabel( LabelPaintCache* lpc, const QRectF& drawPosition, uint slice );
void draw3DEffect( QPainter* painter, const QRectF& drawPosition, uint slice );
void draw3dCutSurface( QPainter* painter,
const QRectF& rect,
qreal threeDHeight,
qreal angle );
void draw3dOuterRim( QPainter* painter,
const QRectF& rect,
qreal threeDHeight,
qreal startAngle,
qreal endAngle );
void calcSliceAngles();
void calcPieSize( const QRectF &contentsRect );
QRectF twoDPieRect( const QRectF &contentsRect, const ThreeDPieAttributes& threeDAttrs ) const;
QRectF explodedDrawPosition( const QRectF& drawPosition, uint slice ) const;
uint findSliceAt( qreal angle, int columnCount );
uint findLeftSlice( uint slice, int columnCount );
uint findRightSlice( uint slice, int columnCount );
QPointF pointOnEllipse( const QRectF& boundingBox, qreal angle );
}; // End of class KChartPieDiagram
Q_DECLARE_OPERATORS_FOR_FLAGS( PieDiagram::LabelDecorations )
}
#endif // KCHARTPIEDIAGRAM_H
diff --git a/src/KChart/Polar/KChartPolarCoordinatePlane.h b/src/KChart/Polar/KChartPolarCoordinatePlane.h
index 922344e..2a14243 100644
--- a/src/KChart/Polar/KChartPolarCoordinatePlane.h
+++ b/src/KChart/Polar/KChartPolarCoordinatePlane.h
@@ -1,164 +1,164 @@
/*
* Copyright (C) 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
*
* This file is part of the KD Chart library.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef KCHART_POLAR_COORDINATEPLANE_H
#define KCHART_POLAR_COORDINATEPLANE_H
#include "KChartAbstractCoordinatePlane.h"
namespace KChart {
class Chart;
class PaintContext;
/**
* @brief Polar coordinate plane
*/
class KCHART_EXPORT PolarCoordinatePlane : public AbstractCoordinatePlane
{
Q_OBJECT
Q_DISABLE_COPY( PolarCoordinatePlane )
KCHART_DECLARE_PRIVATE_DERIVED_PARENT( PolarCoordinatePlane, Chart* )
public:
struct CoordinateTransformation;
typedef QList CoordinateTransformationList;
explicit PolarCoordinatePlane ( Chart* parent = nullptr );
~PolarCoordinatePlane();
- void addDiagram ( AbstractDiagram* diagram ) Q_DECL_OVERRIDE;
+ void addDiagram ( AbstractDiagram* diagram ) override;
- const QPointF translate ( const QPointF& diagramPoint ) const Q_DECL_OVERRIDE;
+ const QPointF translate ( const QPointF& diagramPoint ) const override;
const QPointF translatePolar ( const QPointF& diagramPoint ) const;
/** \brief 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:
*
* \image html polar-plane-start-position.png "Illustration of \"start position\" property"
*
* \sa startPosition
*/
void setStartPosition( qreal degrees );
/** Retrieve the rotation of the coordinate plane.
* \sa setStartPosition
*/
qreal startPosition() const;
- qreal zoomFactorX() const Q_DECL_OVERRIDE;
- qreal zoomFactorY() const Q_DECL_OVERRIDE;
+ qreal zoomFactorX() const override;
+ qreal zoomFactorY() const override;
- void setZoomFactors( qreal factorX, qreal factorY ) Q_DECL_OVERRIDE;
- void setZoomFactorX( qreal factor ) Q_DECL_OVERRIDE;
- void setZoomFactorY( qreal factor ) Q_DECL_OVERRIDE;
+ void setZoomFactors( qreal factorX, qreal factorY ) override;
+ void setZoomFactorX( qreal factor ) override;
+ void setZoomFactorY( qreal factor ) override;
- QPointF zoomCenter() const Q_DECL_OVERRIDE;
+ QPointF zoomCenter() const override;
- void setZoomCenter( const QPointF& center ) Q_DECL_OVERRIDE;
+ void setZoomCenter( const QPointF& center ) override;
/**
* 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:
* \code
* GridAttributes ga = plane->gridAttributes( bool );
* ga.setGridVisible( false );
* plane-setGridAttributes( bool, ga );
* \endcode
*
* \note setGridAttributes overwrites the global attributes that
* were set by AbstractCoordinatePlane::setGlobalGridAttributes.
* To re-activate these global attributes you can call
* resetGridAttributes.
*
* \sa resetGridAttributes, gridAttributes
* \sa AbstractCoordinatePlane::setGlobalGridAttributes
* \sa hasOwnGridAttributes
*/
void setGridAttributes( bool circular, const GridAttributes & );
/**
* 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.
*
* \sa setGridAttributes, gridAttributes
* \sa AbstractCoordinatePlane::globalGridAttributes
* \sa hasOwnGridAttributes
*/
void resetGridAttributes( bool circular );
/**
* \return 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.
*
* \sa setGridAttributes
* \sa resetGridAttributes
* \sa AbstractCoordinatePlane::globalGridAttributes
* \sa hasOwnGridAttributes
*/
const GridAttributes gridAttributes( bool circular ) const;
/**
* \return 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.)
*
* \sa setGridAttributes
* \sa resetGridAttributes
* \sa AbstractCoordinatePlane::globalGridAttributes
*/
bool hasOwnGridAttributes( bool circular ) const;
qreal angleUnit() const;
qreal radiusUnit() const;
/** reimpl */
- void paint( QPainter* ) Q_DECL_OVERRIDE;
+ void paint( QPainter* ) override;
protected:
- DataDimensionsList getDataDimensionsList() const Q_DECL_OVERRIDE;
+ DataDimensionsList getDataDimensionsList() const override;
void paintEvent ( QPaintEvent* );
void resizeEvent ( QResizeEvent* );
- void layoutDiagrams() Q_DECL_OVERRIDE;
+ void layoutDiagrams() override;
protected Q_SLOTS:
void slotLayoutChanged( AbstractDiagram* diagram );
void adjustZoomAndRepaint();
private:
void setHasOwnGridAttributes( bool circular, bool on );
};
}
#endif
diff --git a/src/KChart/Polar/KChartPolarCoordinatePlane_p.h b/src/KChart/Polar/KChartPolarCoordinatePlane_p.h
index fdb8fac..90aa78f 100644
--- a/src/KChart/Polar/KChartPolarCoordinatePlane_p.h
+++ b/src/KChart/Polar/KChartPolarCoordinatePlane_p.h
@@ -1,138 +1,138 @@
/*
* Copyright (C) 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
*
* This file is part of the KD Chart library.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef KCHARTPOLARCOORDINATEPLANE_P_H
#define KCHARTPOLARCOORDINATEPLANE_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the KD Chart API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "KChartAbstractCoordinatePlane_p.h"
#include "KChartZoomParameters.h"
#include "KChartPolarGrid.h"
#include "KChartMath_p.h"
namespace KChart {
/**
* \internal
*/
struct PolarCoordinatePlane::CoordinateTransformation
{
// represents the distance of the diagram coordinate origin to the
// origin of the coordinate plane space:
QPointF originTranslation;
qreal radiusUnit;
qreal angleUnit;
qreal minValue;
qreal startPosition;
ZoomParameters zoom;
static QPointF polarToCartesian( qreal R, qreal theta )
{
// de-inline me
return QPointF( R * cos( DEGTORAD( theta ) ), R * sin( DEGTORAD( theta ) ) );
}
inline const QPointF translate( const QPointF& diagramPoint ) const
{
// ### de-inline me
// calculate the polar coordinates
const qreal x = (diagramPoint.x() * radiusUnit) - (minValue * radiusUnit);
//qDebug() << x << "=" << diagramPoint.x() << "*" << radiusUnit << " startPosition: " << startPosition;
const qreal y = ( diagramPoint.y() * -angleUnit) - 90.0 - startPosition;
// convert to cartesian coordinates
QPointF cartesianPoint = polarToCartesian( x, y );
cartesianPoint.setX( cartesianPoint.x() * zoom.xFactor );
cartesianPoint.setY( cartesianPoint.y() * zoom.yFactor );
QPointF newOrigin = originTranslation;
qreal minOrigin = qMin( newOrigin.x(), newOrigin.y() );
newOrigin.setX( newOrigin.x() + minOrigin * ( 1 - zoom.xCenter * 2 ) * zoom.xFactor );
newOrigin.setY( newOrigin.y() + minOrigin * ( 1 - zoom.yCenter * 2 ) * zoom.yFactor );
return newOrigin + cartesianPoint;
}
inline const QPointF translatePolar( const QPointF& diagramPoint ) const
{
// ### de-inline me
return QPointF( diagramPoint.x() * angleUnit, diagramPoint.y() * radiusUnit );
}
};
class Q_DECL_HIDDEN PolarCoordinatePlane::Private : public AbstractCoordinatePlane::Private
{
friend class PolarCoordinatePlane;
public:
explicit Private()
: currentTransformation(nullptr)
, initialResizeEventReceived(false )
, hasOwnGridAttributesCircular ( false )
, hasOwnGridAttributesSagittal ( false )
{}
virtual ~Private() { }
- void initialize() Q_DECL_OVERRIDE
+ void initialize() override
{
grid = new PolarGrid();
}
static QRectF contentsRect( const PolarCoordinatePlane* plane );
// the coordinate plane will calculate coordinate transformations for all
// diagrams and store them here:
CoordinateTransformationList coordinateTransformations;
// when painting, this pointer selects the coordinate transformation for
// the current diagram:
CoordinateTransformation* currentTransformation;
// the reactangle occupied by the diagrams, in plane coordinates
QRectF contentRect;
// true after the first resize event came in
bool initialResizeEventReceived;
// true after setGridAttributes( Qt::Orientation ) was used,
// false if resetGridAttributes( Qt::Orientation ) was called
bool hasOwnGridAttributesCircular;
bool hasOwnGridAttributesSagittal;
GridAttributes gridAttributesCircular;
GridAttributes gridAttributesSagittal;
qreal newZoomX, newZoomY;
};
KCHART_IMPL_DERIVED_PLANE(PolarCoordinatePlane, AbstractCoordinatePlane)
}
#endif /* KCHARTBARDIAGRAM_P_H */
diff --git a/src/KChart/Polar/KChartPolarDiagram.h b/src/KChart/Polar/KChartPolarDiagram.h
index ab04201..cdc9e61 100644
--- a/src/KChart/Polar/KChartPolarDiagram.h
+++ b/src/KChart/Polar/KChartPolarDiagram.h
@@ -1,106 +1,106 @@
/*
* Copyright (C) 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
*
* This file is part of the KD Chart library.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef KCHARTPOLARDIAGRAM_H
#define KCHARTPOLARDIAGRAM_H
#include "KChartPosition.h"
#include "KChartAbstractPolarDiagram.h"
QT_BEGIN_NAMESPACE
class QPolygonF;
QT_END_NAMESPACE
namespace KChart {
/**
* @brief PolarDiagram defines a common polar diagram
*/
class KCHART_EXPORT PolarDiagram : public AbstractPolarDiagram
{
Q_OBJECT
Q_DISABLE_COPY( PolarDiagram )
KCHART_DECLARE_DERIVED_DIAGRAM( PolarDiagram, PolarCoordinatePlane )
public:
explicit PolarDiagram(
QWidget* parent = nullptr, PolarCoordinatePlane* plane = nullptr );
virtual ~PolarDiagram();
protected:
// Implement AbstractDiagram
/** \reimpl */
- void paint ( PaintContext* paintContext ) Q_DECL_OVERRIDE;
+ void paint ( PaintContext* paintContext ) override;
public:
/** \reimpl */
- void resize ( const QSizeF& area ) Q_DECL_OVERRIDE;
+ void resize ( const QSizeF& area ) override;
// Implement AbstractPolarDiagram
/** \reimpl */
- qreal valueTotals () const Q_DECL_OVERRIDE;
+ qreal valueTotals () const override;
/** \reimpl */
- qreal numberOfValuesPerDataset() const Q_DECL_OVERRIDE;
+ qreal numberOfValuesPerDataset() const override;
/** \reimpl */
- qreal numberOfGridRings() const Q_DECL_OVERRIDE;
+ qreal numberOfGridRings() const override;
virtual PolarDiagram * clone() const;
/** \deprecated Use PolarCoordinatePlane::setStartPosition( qreal degrees ) instead. */
void setZeroDegreePosition( int degrees );
/** \deprecated Use qreal PolarCoordinatePlane::startPosition instead. */
int zeroDegreePosition() const;
void setRotateCircularLabels( bool rotateCircularLabels );
bool rotateCircularLabels() const;
/** Close each of the data series by connecting the last point to its
* respective start point
*/
void setCloseDatasets( bool closeDatasets );
bool closeDatasets() const;
void setShowDelimitersAtPosition( Position position,
bool showDelimiters );
void setShowLabelsAtPosition( Position position,
bool showLabels );
bool showDelimitersAtPosition( Position position ) const;
bool showLabelsAtPosition( Position position ) const;
virtual void paint ( PaintContext* paintContext,
bool calculateListAndReturnScale,
qreal& newZoomX, qreal& newZoomY ); // KChart 3: references -> pointers
protected:
/** \reimpl */
- const QPair calculateDataBoundaries() const Q_DECL_OVERRIDE;
- void paintEvent ( QPaintEvent* ) Q_DECL_OVERRIDE;
- void resizeEvent ( QResizeEvent* ) Q_DECL_OVERRIDE;
+ const QPair calculateDataBoundaries() const override;
+ void paintEvent ( QPaintEvent* ) override;
+ void resizeEvent ( QResizeEvent* ) override;
virtual void paintPolarMarkers( PaintContext* ctx, const QPolygonF& polygon );
}; // End of class PolarDiagram
}
#endif // KCHARTPOLARDIAGRAM_H
diff --git a/src/KChart/Polar/KChartPolarGrid.h b/src/KChart/Polar/KChartPolarGrid.h
index 5afe783..5b5bba7 100644
--- a/src/KChart/Polar/KChartPolarGrid.h
+++ b/src/KChart/Polar/KChartPolarGrid.h
@@ -1,56 +1,56 @@
/*
* Copyright (C) 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
*
* This file is part of the KD Chart library.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef KCHARTPOLARGrid_H
#define KCHARTPOLARGrid_H
#include "KChartPolarCoordinatePlane.h"
#include "KChartAbstractGrid.h"
namespace KChart {
class PaintContext;
class PolarCoordinatePlane;
/**
* \internal
*
* \brief Class for the grid in a polar plane.
*
* The PolarGrid interface is used
* for calculating and for drawing
* the sagittal grid lines, and the circular grid lines
* of a polar coordinate plane.
*/
class PolarGrid : public AbstractGrid
{
public:
PolarGrid() : AbstractGrid() {}
virtual ~PolarGrid() {}
- void drawGrid( PaintContext* context ) Q_DECL_OVERRIDE;
+ void drawGrid( PaintContext* context ) override;
private:
DataDimensionsList calculateGrid(
- const DataDimensionsList& rawDataDimensions ) const Q_DECL_OVERRIDE;
+ const DataDimensionsList& rawDataDimensions ) const override;
};
}
#endif
diff --git a/src/KChart/Polar/KChartRadarCoordinatePlane_p.h b/src/KChart/Polar/KChartRadarCoordinatePlane_p.h
index 73a861e..2c95854 100644
--- a/src/KChart/Polar/KChartRadarCoordinatePlane_p.h
+++ b/src/KChart/Polar/KChartRadarCoordinatePlane_p.h
@@ -1,61 +1,61 @@
/*
* Copyright (C) 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
*
* This file is part of the KD Chart library.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef KCHARTRADARCOORDINATEPLANE_P_H
#define KCHARTRADARCOORDINATEPLANE_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the KD Chart API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "KChartPolarCoordinatePlane_p.h"
#include "KChartRadarCoordinatePlane.h"
#include "KChartRadarGrid.h"
namespace KChart {
class Q_DECL_HIDDEN RadarCoordinatePlane::Private : public PolarCoordinatePlane::Private
{
friend class RadarCoordinatePlane;
public:
explicit Private() { }
virtual ~Private() { }
TextAttributes textAttributes;
- void initialize() Q_DECL_OVERRIDE
+ void initialize() override
{
grid = new RadarGrid();
}
};
KCHART_IMPL_DERIVED_PLANE(RadarCoordinatePlane, PolarCoordinatePlane)
}
#endif /* KCHARTBARDIAGRAM_P_H */
diff --git a/src/KChart/Polar/KChartRadarDiagram.h b/src/KChart/Polar/KChartRadarDiagram.h
index 5203683..ba4b4ff 100644
--- a/src/KChart/Polar/KChartRadarDiagram.h
+++ b/src/KChart/Polar/KChartRadarDiagram.h
@@ -1,98 +1,98 @@
/*
* Copyright (C) 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
*
* This file is part of the KD Chart library.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef KCHARTRADARDIAGRAM_H
#define KCHARTRADARDIAGRAM_H
#include "KChartPosition.h"
#include "KChartPolarDiagram.h"
#include "KChartRadarCoordinatePlane.h"
QT_BEGIN_NAMESPACE
class QPolygonF;
QT_END_NAMESPACE
namespace KChart {
/**
* @brief RadarDiagram defines a common radar diagram
*/
class KCHART_EXPORT RadarDiagram : public AbstractPolarDiagram
{
Q_OBJECT
Q_DISABLE_COPY( RadarDiagram )
KCHART_DECLARE_DERIVED_DIAGRAM( RadarDiagram, RadarCoordinatePlane )
public:
explicit RadarDiagram(
QWidget* parent = nullptr, RadarCoordinatePlane* plane = nullptr );
virtual ~RadarDiagram();
virtual void paint ( PaintContext* paintContext,
bool calculateListAndReturnScale,
qreal& newZoomX, qreal& newZoomY );
/** \reimpl */
- void resize ( const QSizeF& area ) Q_DECL_OVERRIDE;
+ void resize ( const QSizeF& area ) override;
/** \reimpl */
- qreal valueTotals () const Q_DECL_OVERRIDE;
+ qreal valueTotals () const override;
/** \reimpl */
- qreal numberOfValuesPerDataset() const Q_DECL_OVERRIDE;
+ qreal numberOfValuesPerDataset() const override;
/** \reimpl */
- qreal numberOfGridRings() const Q_DECL_OVERRIDE;
+ qreal numberOfGridRings() const override;
/**
* if val is true the diagram will mirror the diagram datapoints
*/
void setReverseData( bool val );
bool reverseData();
virtual RadarDiagram * clone() const;
/**
* Close each of the data series by connecting the last point to its
* respective start point
*/
void setCloseDatasets( bool closeDatasets );
bool closeDatasets() const;
/**
* Fill the areas of the radar chart with there respective color defined
* via KChart::DatasetBrushRole. The value defines the alpha of the
* color to use. If set to 0.0 (the default) then the radar areas will
* not be filled with any color. If set to 1.0 then the areas will be
* solid filled and are not transparent.
*/
qreal fillAlpha() const;
void setFillAlpha(qreal alphaF);
protected:
/** \reimpl */
- const QPair calculateDataBoundaries() const Q_DECL_OVERRIDE;
- void paintEvent ( QPaintEvent* ) Q_DECL_OVERRIDE;
- void resizeEvent ( QResizeEvent* ) Q_DECL_OVERRIDE;
- void paint ( PaintContext* paintContext ) Q_DECL_OVERRIDE;
+ const QPair calculateDataBoundaries() const override;
+ void paintEvent ( QPaintEvent* ) override;
+ void resizeEvent ( QResizeEvent* ) override;
+ void paint ( PaintContext* paintContext ) override;
}; // End of class RadarDiagram
}
#endif // KCHARTRADARDIAGRAM_H
diff --git a/src/KChart/Polar/KChartRadarGrid.h b/src/KChart/Polar/KChartRadarGrid.h
index 380880a..03ec6aa 100644
--- a/src/KChart/Polar/KChartRadarGrid.h
+++ b/src/KChart/Polar/KChartRadarGrid.h
@@ -1,56 +1,56 @@
/*
* Copyright (C) 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
*
* This file is part of the KD Chart library.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef KCHARTRADARGrid_H
#define KCHARTRADARGrid_H
//#include "KChartRadarCoordinatePlane.h"
#include "KChartAbstractGrid.h"
namespace KChart {
class PaintContext;
class RadarCoordinatePlane;
/**
* \internal
*
* \brief Class for the grid in a radar plane.
*
* The RadarGrid interface is used
* for calculating and for drawing
* the grid lines of a radar charts including "axis"
* labels.
*/
class RadarGrid : public AbstractGrid
{
public:
RadarGrid() : AbstractGrid() {}
virtual ~RadarGrid() {}
- void drawGrid( PaintContext* context ) Q_DECL_OVERRIDE;
+ void drawGrid( PaintContext* context ) override;
private:
DataDimensionsList calculateGrid(
- const DataDimensionsList& rawDataDimensions ) const Q_DECL_OVERRIDE;
+ const DataDimensionsList& rawDataDimensions ) const override;
};
}
#endif
diff --git a/src/KChart/Polar/KChartRingDiagram.h b/src/KChart/Polar/KChartRingDiagram.h
index 84acf7d..8f6fbfd 100644
--- a/src/KChart/Polar/KChartRingDiagram.h
+++ b/src/KChart/Polar/KChartRingDiagram.h
@@ -1,89 +1,89 @@
/*
* Copyright (C) 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
*
* This file is part of the KD Chart library.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef KCHARTRINGDIAGRAM_H
#define KCHARTRINGDIAGRAM_H
#include "KChartAbstractPieDiagram.h"
namespace KChart {
/**
* @brief RingDiagram defines a common ring diagram
*/
class KCHART_EXPORT RingDiagram : public AbstractPieDiagram
{
Q_OBJECT
Q_DISABLE_COPY( RingDiagram )
KCHART_DECLARE_DERIVED_DIAGRAM( RingDiagram, PolarCoordinatePlane )
public:
explicit RingDiagram(
QWidget* parent = nullptr, PolarCoordinatePlane* plane = nullptr );
virtual ~RingDiagram();
protected:
// Implement AbstractDiagram
/** \reimpl */
- void paint( PaintContext* paintContext ) Q_DECL_OVERRIDE;
+ void paint( PaintContext* paintContext ) override;
public:
/** \reimpl */
- void resize( const QSizeF& area ) Q_DECL_OVERRIDE;
+ void resize( const QSizeF& area ) override;
// Implement AbstractPolarDiagram
/** \reimpl */
- qreal valueTotals() const Q_DECL_OVERRIDE;
+ qreal valueTotals() const override;
/** \reimpl */
- qreal numberOfValuesPerDataset() const Q_DECL_OVERRIDE;
- qreal numberOfDatasets() const Q_DECL_OVERRIDE;
+ qreal numberOfValuesPerDataset() const override;
+ qreal numberOfDatasets() const override;
/** \reimpl */
- qreal numberOfGridRings() const Q_DECL_OVERRIDE;
+ qreal numberOfGridRings() const override;
qreal valueTotals( int dataset ) const;
virtual RingDiagram * clone() const;
/**
* Returns true if both diagrams have the same settings.
*/
bool compare( const RingDiagram* other ) const;
void setRelativeThickness( bool relativeThickness );
bool relativeThickness() const;
virtual void setExpandWhenExploded( bool expand );
virtual bool expandWhenExploded() const;
protected:
/** \reimpl */
- const QPair calculateDataBoundaries() const Q_DECL_OVERRIDE;
- void paintEvent( QPaintEvent* ) Q_DECL_OVERRIDE;
- void resizeEvent( QResizeEvent* ) Q_DECL_OVERRIDE;
+ const QPair calculateDataBoundaries() const override;
+ void paintEvent( QPaintEvent* ) override;
+ void resizeEvent( QResizeEvent* ) override;
private:
void drawOneSlice( QPainter* painter, uint dataset, uint slice, qreal granularity );
void drawPieSurface( QPainter* painter, uint dataset, uint slice, qreal granularity );
QPointF pointOnEllipse( const QRectF& rect, int dataset, int slice, bool outer, qreal angle,
qreal totalGapFactor, qreal totalExplodeFactor );
}; // End of class RingDiagram
}
#endif // KCHARTRINGDIAGRAM_H
diff --git a/src/KChart/Ternary/KChartAbstractTernaryDiagram.h b/src/KChart/Ternary/KChartAbstractTernaryDiagram.h
index 9a18685..cdb1688 100644
--- a/src/KChart/Ternary/KChartAbstractTernaryDiagram.h
+++ b/src/KChart/Ternary/KChartAbstractTernaryDiagram.h
@@ -1,59 +1,59 @@
/*
* Copyright (C) 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
*
* This file is part of the KD Chart library.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef KCHARTABSTRACTTERNARYDIAGRAM_H
#define KCHARTABSTRACTTERNARYDIAGRAM_H
#include "KChartAbstractDiagram.h"
#include "KChartTernaryAxis.h"
namespace KChart {
class TernaryCoordinatePlane;
class TernaryAxis;
/**
* @brief Base class for diagrams based on a ternary coordinate plane.
*/
class KCHART_EXPORT AbstractTernaryDiagram : public AbstractDiagram
{
Q_OBJECT
Q_DISABLE_COPY( AbstractTernaryDiagram )
KCHART_DECLARE_DERIVED_DIAGRAM( AbstractTernaryDiagram,
TernaryCoordinatePlane )
public:
explicit AbstractTernaryDiagram ( QWidget* parent = nullptr,
TernaryCoordinatePlane* plane = nullptr );
virtual ~AbstractTernaryDiagram();
- void paint (PaintContext *paintContext) Q_DECL_OVERRIDE;
+ void paint (PaintContext *paintContext) override;
virtual void addAxis( TernaryAxis* axis );
virtual void takeAxis( TernaryAxis* axis );
virtual TernaryAxisList axes () const;
protected:
- const QPair< QPointF, QPointF > calculateDataBoundaries () const Q_DECL_OVERRIDE = 0;
+ const QPair< QPointF, QPointF > calculateDataBoundaries () const override = 0;
};
}
#endif
diff --git a/src/KChart/Ternary/KChartTernaryAxis.h b/src/KChart/Ternary/KChartTernaryAxis.h
index b509031..e1dfd3e 100644
--- a/src/KChart/Ternary/KChartTernaryAxis.h
+++ b/src/KChart/Ternary/KChartTernaryAxis.h
@@ -1,93 +1,93 @@
/*
* Copyright (C) 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
*
* This file is part of the KD Chart library.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef KCHARTTERNARYAXIS_H
#define KCHARTTERNARYAXIS_H
#include
#include
#include
class PrerenderedLabel;
namespace KChart {
class AbstractTernaryDiagram;
/**
* The class for ternary axes
*/
class KCHART_EXPORT TernaryAxis : public AbstractAxis
{
Q_OBJECT
Q_DISABLE_COPY( TernaryAxis )
KCHART_DECLARE_PRIVATE_DERIVED_PARENT( TernaryAxis, AbstractDiagram* )
public:
explicit TernaryAxis ( AbstractTernaryDiagram* diagram = nullptr );
~TernaryAxis();
- void paintAll( QPainter &) Q_DECL_OVERRIDE;
- void paint (QPainter *) Q_DECL_OVERRIDE;
- void paintCtx (PaintContext *) Q_DECL_OVERRIDE;
-
- QRect geometry () const Q_DECL_OVERRIDE;
- void setGeometry (const QRect &rect) Q_DECL_OVERRIDE;
-
- bool isEmpty () const Q_DECL_OVERRIDE;
- QSize minimumSize () const Q_DECL_OVERRIDE;
- QSize maximumSize () const Q_DECL_OVERRIDE;
- QSize sizeHint () const Q_DECL_OVERRIDE;
- Qt::Orientations expandingDirections () const Q_DECL_OVERRIDE;
+ void paintAll( QPainter &) override;
+ void paint (QPainter *) override;
+ void paintCtx (PaintContext *) override;
+
+ QRect geometry () const override;
+ void setGeometry (const QRect &rect) override;
+
+ bool isEmpty () const override;
+ QSize minimumSize () const override;
+ QSize maximumSize () const override;
+ QSize sizeHint () const override;
+ Qt::Orientations expandingDirections () const override;
virtual const Position position () const;
virtual void setPosition (Position p);
void setTitleText( const QString& text );
QString titleText() const;
void setTitleTextAttributes( const TextAttributes &a );
TextAttributes titleTextAttributes() const;
void resetTitleTextAttributes();
bool hasDefaultTitleTextAttributes() const;
QPair requiredMargins() const;
private:
void updatePrerenderedLabels();
// TODO, move class variables to private class
QRect m_geometry;
Position m_position;
QString m_title;
TextAttributes m_titleAttributes;
// FIXME (Mirko): Move axis labels from grid to here, do not
// expose them, just paint them. Use title text for text. Make
// a function to allow the coordinate plane to calculate the
// necessary margins, like this:
PrerenderedLabel* m_label;
PrerenderedLabel* m_fifty;
};
typedef QList TernaryAxisList;
}
#endif
diff --git a/src/KChart/Ternary/KChartTernaryCoordinatePlane.h b/src/KChart/Ternary/KChartTernaryCoordinatePlane.h
index 08e1da2..6956e32 100644
--- a/src/KChart/Ternary/KChartTernaryCoordinatePlane.h
+++ b/src/KChart/Ternary/KChartTernaryCoordinatePlane.h
@@ -1,63 +1,63 @@
/*
* Copyright (C) 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
*
* This file is part of the KD Chart library.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef KCHARTTERNARYCOORDINATEPLANE_H
#define KCHARTTERNARYCOORDINATEPLANE_H
#include "KChartAbstractCoordinatePlane.h"
namespace KChart {
class TernaryGrid;
/**
* @brief Ternary coordinate plane
*/
class KCHART_EXPORT TernaryCoordinatePlane
: public AbstractCoordinatePlane
{
Q_OBJECT
Q_DISABLE_COPY( TernaryCoordinatePlane )
KCHART_DECLARE_PRIVATE_DERIVED_PARENT( TernaryCoordinatePlane, Chart* )
public:
explicit TernaryCoordinatePlane( Chart* parent = nullptr );
~TernaryCoordinatePlane();
- void addDiagram( AbstractDiagram* diagram ) Q_DECL_OVERRIDE;
+ void addDiagram( AbstractDiagram* diagram ) override;
- void layoutDiagrams() Q_DECL_OVERRIDE;
+ void layoutDiagrams() override;
- const QPointF translate ( const QPointF& diagramPoint ) const Q_DECL_OVERRIDE;
+ const QPointF translate ( const QPointF& diagramPoint ) const override;
- void paint( QPainter* ) Q_DECL_OVERRIDE;
- DataDimensionsList getDataDimensionsList() const Q_DECL_OVERRIDE;
+ void paint( QPainter* ) override;
+ DataDimensionsList getDataDimensionsList() const override;
/** \reimpl */
QSize minimumSizeHint() const;
/** \reimpl */
QSizePolicy sizePolicy() const;
private:
TernaryGrid* grid() const;
};
}
#endif
diff --git a/src/KChart/Ternary/KChartTernaryCoordinatePlane_p.h b/src/KChart/Ternary/KChartTernaryCoordinatePlane_p.h
index afb3364..f0ce79f 100644
--- a/src/KChart/Ternary/KChartTernaryCoordinatePlane_p.h
+++ b/src/KChart/Ternary/KChartTernaryCoordinatePlane_p.h
@@ -1,87 +1,87 @@
/*
* Copyright (C) 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
*
* This file is part of the KD Chart library.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef KCHARTTERNARYCOORDINATEPLANE_P_H
#define KCHARTTERNARYCOORDINATEPLANE_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the KD Chart API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "KChartTernaryCoordinatePlane.h"
#include "KChartTernaryGrid.h"
#include "KChartAbstractCoordinatePlane_p.h"
#include "KChartMath_p.h"
#include
namespace KChart {
class TernaryAxis;
/**
* \internal
*/
class Q_DECL_HIDDEN TernaryCoordinatePlane::Private : public AbstractCoordinatePlane::Private
{
friend class TernaryCoordinatePlane;
public:
explicit Private();
virtual ~Private() {
// grid is delete in base class dtor
}
- void initialize() Q_DECL_OVERRIDE
+ void initialize() override
{
grid = new TernaryGrid();
xUnit = 0.0;
yUnit = 0.0;
}
QList axes;
TextAttributes labelAttributes;
// the diagram is drawn within this rectangle, which is within
// this widget:
QRectF diagramRectContainer;
// this is the "frame" of the plot area
QRectF diagramRect;
// multiply m_xUnit with a [0..1] value to get an isometric
// widget coordinate
qreal xUnit;
// same for y:
qreal yUnit;
};
KCHART_IMPL_DERIVED_PLANE(TernaryCoordinatePlane, AbstractCoordinatePlane)
}
#endif /* KCHARTTERNARYCOORDINATEPLANE_P_H */
diff --git a/src/KChart/Ternary/KChartTernaryGrid.h b/src/KChart/Ternary/KChartTernaryGrid.h
index 391c145..2cc2498 100644
--- a/src/KChart/Ternary/KChartTernaryGrid.h
+++ b/src/KChart/Ternary/KChartTernaryGrid.h
@@ -1,73 +1,73 @@
/*
* Copyright (C) 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
*
* This file is part of the KD Chart library.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef KCHARTTERNARYGRID_H
#define KCHARTTERNARYGRID_H
#include
#include "KChartAbstractGrid.h"
#include "KChartTextLabelCache.h"
namespace KChart {
struct TickInfo {
TickInfo( qreal percentage = 0, int depth = 0 );
qreal percentage;
int depth;
};
bool operator==(const TickInfo&, const TickInfo& );
class PaintContext;
// VERIFY: Grids are not public API, are they?
class TernaryGrid : public AbstractGrid
{
public:
TernaryGrid();
virtual ~TernaryGrid();
- void drawGrid( PaintContext* context ) Q_DECL_OVERRIDE;
- DataDimensionsList calculateGrid( const DataDimensionsList& rawDataDimensions ) const Q_DECL_OVERRIDE;
+ void drawGrid( PaintContext* context ) override;
+ DataDimensionsList calculateGrid( const DataDimensionsList& rawDataDimensions ) const override;
/** Returns two QSizeF objects specifying the dimension of the
margins needed between each corner of the diagram and the
border of the drawing area. Margins are required because
the tick marks are placed outside of the trianges
containing rectangle.
The margins are returned in diagram coordinates,
since the grid does not know about widget coordinates.
*/
QPair requiredMargins() const;
/** Return the locations of the grid lines, so that axes can
draw axis rulers at the correct positions.
This information is valid after the grid has been
painted (that is, the axes need to be painted after the
grid. */
const QVector& tickInfo() const;
private:
QVector m_tickInfo;
// QList m_labels;
};
}
#endif
diff --git a/src/KChart/Ternary/KChartTernaryLineDiagram.h b/src/KChart/Ternary/KChartTernaryLineDiagram.h
index 3eb7db3..65b2a4f 100644
--- a/src/KChart/Ternary/KChartTernaryLineDiagram.h
+++ b/src/KChart/Ternary/KChartTernaryLineDiagram.h
@@ -1,51 +1,51 @@
/*
* Copyright (C) 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
*
* This file is part of the KD Chart library.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef KCHARTTERNARYLINEDIAGRAM_H
#define KCHARTTERNARYLINEDIAGRAM_H
#include "KChartTernaryCoordinatePlane.h"
#include "KChartAbstractTernaryDiagram.h"
namespace KChart {
/**
* @brief A TernaryLineDiagram is a line diagram with a ternary coordinate plane
*/
class KCHART_EXPORT TernaryLineDiagram : public AbstractTernaryDiagram
{
Q_OBJECT
Q_DISABLE_COPY( TernaryLineDiagram )
KCHART_DECLARE_DERIVED_DIAGRAM( TernaryLineDiagram, TernaryCoordinatePlane )
public:
explicit TernaryLineDiagram ( QWidget* parent = nullptr, TernaryCoordinatePlane* plane = nullptr );
virtual ~TernaryLineDiagram();
- void resize (const QSizeF &area) Q_DECL_OVERRIDE;
- void paint (PaintContext *paintContext) Q_DECL_OVERRIDE;
+ void resize (const QSizeF &area) override;
+ void paint (PaintContext *paintContext) override;
protected:
- const QPair< QPointF, QPointF > calculateDataBoundaries () const Q_DECL_OVERRIDE;
+ const QPair< QPointF, QPointF > calculateDataBoundaries () const override;
};
}
#endif
diff --git a/src/KChart/Ternary/KChartTernaryPointDiagram.h b/src/KChart/Ternary/KChartTernaryPointDiagram.h
index 95e5872..3f98732 100644
--- a/src/KChart/Ternary/KChartTernaryPointDiagram.h
+++ b/src/KChart/Ternary/KChartTernaryPointDiagram.h
@@ -1,50 +1,50 @@
/*
* Copyright (C) 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
*
* This file is part of the KD Chart library.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef KCHARTTERNARYPOINTDIAGRAM_H
#define KCHARTTERNARYPOINTDIAGRAM_H
#include "KChartTernaryCoordinatePlane.h"
#include "KChartAbstractTernaryDiagram.h"
namespace KChart {
/**
* @brief A TernaryPointDiagram is a point diagram within a ternary coordinate plane
*/
class KCHART_EXPORT TernaryPointDiagram : public AbstractTernaryDiagram
{
Q_OBJECT
Q_DISABLE_COPY( TernaryPointDiagram )
KCHART_DECLARE_DERIVED_DIAGRAM( TernaryPointDiagram, TernaryCoordinatePlane )
public:
explicit TernaryPointDiagram ( QWidget* parent = nullptr, TernaryCoordinatePlane* plane = nullptr );
virtual ~TernaryPointDiagram();
- void resize (const QSizeF &area) Q_DECL_OVERRIDE;
- void paint (PaintContext *paintContext) Q_DECL_OVERRIDE;
+ void resize (const QSizeF &area) override;
+ void paint (PaintContext *paintContext) override;
protected:
- const QPair< QPointF, QPointF > calculateDataBoundaries () const Q_DECL_OVERRIDE;
+ const QPair< QPointF, QPointF > calculateDataBoundaries () const override;
};
}
#endif
diff --git a/src/KGantt/kganttconstraintgraphicsitem.h b/src/KGantt/kganttconstraintgraphicsitem.h
index 6b7ad05..9685f71 100644
--- a/src/KGantt/kganttconstraintgraphicsitem.h
+++ b/src/KGantt/kganttconstraintgraphicsitem.h
@@ -1,64 +1,64 @@
/*
* Copyright (C) 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
*
* This file is part of the KGantt library.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#ifndef KGANTTCONSTRAINTGRAPHICSITEM_H
#define KGANTTCONSTRAINTGRAPHICSITEM_H
#include
#include "kganttconstraint.h"
namespace KGantt {
class GraphicsScene;
class KGANTT_EXPORT ConstraintGraphicsItem : public QGraphicsItem {
public:
enum { Type = UserType + 43 };
explicit ConstraintGraphicsItem( const Constraint& c,
QGraphicsItem* parent = nullptr, GraphicsScene* scene = nullptr );
virtual ~ConstraintGraphicsItem();
- /*reimp*/ int type() const Q_DECL_OVERRIDE;
+ /*reimp*/ int type() const override;
/*reimp (non virtual)*/GraphicsScene* scene() const;
/*reimp*/ QString ganttToolTip() const;
- /*reimp*/ QRectF boundingRect() const Q_DECL_OVERRIDE;
+ /*reimp*/ QRectF boundingRect() const override;
/*reimp*/ void paint( QPainter* painter, const QStyleOptionGraphicsItem* option,
- QWidget* widget = nullptr ) Q_DECL_OVERRIDE;
+ QWidget* widget = nullptr ) override;
inline const Constraint& constraint() const { return m_constraint; }
Constraint proxyConstraint() const;
void setStart( const QPointF& start );
inline QPointF start() const { return m_start; }
void setEnd( const QPointF& end );
inline QPointF end() const { return m_end; }
void updateItem( const QPointF& start,const QPointF& end );
private:
Constraint m_constraint;
QPointF m_start;
QPointF m_end;
};
}
#endif /* KGANTTCONSTRAINTGRAPHICSITEM_H */
diff --git a/src/KGantt/kganttdatetimegrid.cpp b/src/KGantt/kganttdatetimegrid.cpp
index 46c48ab..8ce6ffc 100644
--- a/src/KGantt/kganttdatetimegrid.cpp
+++ b/src/KGantt/kganttdatetimegrid.cpp
@@ -1,1396 +1,1396 @@
/*
* Copyright (C) 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
*
* This file is part of the KGantt library.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#include "kganttdatetimegrid.h"
#include "kganttdatetimegrid_p.h"
#include "kganttabstractrowcontroller.h"
#include
#include
#include
#include