Remove libkdchart

This commit is contained in:
Grégory Soutadé 2018-03-16 17:54:44 +01:00
parent 3e666103b8
commit 202d11ba79
275 changed files with 0 additions and 46323 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,24 +0,0 @@
Welcome to KD Chart 2, Klaralvdalens Datakonsult's charting engine for Qt!
Please refer to the license file for conditions of use.
After reading the introductory overview files in doc/
you will find more information at three places:
detailed browsable API reference: doc/refman/index.html
or: http://docs.kdab.com/kdchart/2.4/
programmers manual with examples: doc/manual/kdchart.pdf
our sorted example programs: examples/
In case of additional questions during evaluation or use of
KD Chart please contact our technical support by mail:
kdchart-support@kdab.com
We thank you for your interest in KD Chart and we are here
to assist you if the documentation leaves open questions or
if you just need some help with finding the best way in which
to realize your charting ideas.
The KDAB KD Chart Support Team.

View File

@ -1 +0,0 @@
#include "../src/KDChartAbstractAxis.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartAbstractCartesianDiagram.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartAbstractCoordinatePlane.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartAbstractDiagram.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartAbstractPieDiagram.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartAbstractPolarDiagram.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartAbstractProxyModel.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartAbstractTernaryDiagram.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartAbstractThreeDAttributes.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartAttributesModel.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartBackgroundAttributes.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartBarAttributes.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartBarDiagram.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartCartesianAxis.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartCartesianCoordinatePlane.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartChart.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartDataValueAttributes.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartDatasetProxyModel.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartDatasetSelector.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartDiagramObserver.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartEnums.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartFrameAttributes.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartGlobal.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartGridAttributes.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartHeaderFooter.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartLegend.h"

View File

@ -1 +0,0 @@
#include "../src/LeveyJennings/KDChartLeveyJenningsAxis.h"

View File

@ -1 +0,0 @@
#include "../src/LeveyJennings/KDChartLeveyJenningsCoordinatePlane.h"

View File

@ -1 +0,0 @@
#include "../src/LeveyJennings/KDChartLeveyJenningsDiagram.h"

View File

@ -1 +0,0 @@
#include "../src/LeveyJennings/KDChartLeveyJenningsGrid.h"

View File

@ -1 +0,0 @@
#include "../src/LeveyJennings/KDChartLeveyJenningsGridAttributes.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartLineAttributes.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartLineDiagram.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartMarkerAttributes.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartMeasure.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartPaintContext.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartPalette.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartPieAttributes.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartPieDiagram.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartPlotter.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartPolarCoordinatePlane.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartPolarDiagram.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartPosition.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartRelativePosition.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartRingDiagram.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartRulerAttributes.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartStockBarAttributes.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartStockDiagram.h"

View File

@ -1 +0,0 @@
#include "../src/Ternary/KDChartTernaryAxis.h"

View File

@ -1 +0,0 @@
#include "../src/Ternary/KDChartTernaryCoordinatePlane.h"

View File

@ -1 +0,0 @@
#include "../src/Ternary/KDChartTernaryLineDiagram.h"

View File

@ -1 +0,0 @@
#include "../src/Ternary/KDChartTernaryPointDiagram.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartTextAttributes.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartThreeDBarAttributes.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartThreeDLineAttributes.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartThreeDPieAttributes.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartValueTrackerAttributes.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartWidget.h"

View File

@ -1 +0,0 @@
#include "../src/KDChartZoomParameters.h"

View File

@ -1 +0,0 @@
#include "../src/KDTextDocument.h"

View File

@ -1,181 +0,0 @@
/********************************************************************************
** Form generated from reading UI file 'KDChartDatasetSelector.ui'
**
** Created: Sat Jan 7 12:36:09 2012
** by: Qt User Interface Compiler version 4.7.3
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef KDCHARTDATASETSELECTOR_H
#define KDCHARTDATASETSELECTOR_H
#include <QtCore/QVariant>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QCheckBox>
#include <QtGui/QGridLayout>
#include <QtGui/QGroupBox>
#include <QtGui/QHBoxLayout>
#include <QtGui/QHeaderView>
#include <QtGui/QLabel>
#include <QtGui/QSpacerItem>
#include <QtGui/QSpinBox>
#include <QtGui/QWidget>
QT_BEGIN_NAMESPACE
class Ui_DatasetSelector
{
public:
QHBoxLayout *hboxLayout;
QGroupBox *groupBox;
QGridLayout *gridLayout;
QCheckBox *cbReverseColumns;
QLabel *label_5;
QSpinBox *sbStartColumn;
QLabel *label_2;
QSpinBox *sbColumnCount;
QLabel *label;
QLabel *label_6;
QSpinBox *sbStartRow;
QLabel *label_4;
QCheckBox *cbReverseRows;
QLabel *label_3;
QSpinBox *sbRowCount;
QSpacerItem *spacerItem;
void setupUi(QWidget *DatasetSelector)
{
if (DatasetSelector->objectName().isEmpty())
DatasetSelector->setObjectName(QString::fromUtf8("DatasetSelector"));
DatasetSelector->resize(728, 344);
QSizePolicy sizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3));
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
sizePolicy.setHeightForWidth(DatasetSelector->sizePolicy().hasHeightForWidth());
DatasetSelector->setSizePolicy(sizePolicy);
DatasetSelector->setMinimumSize(QSize(0, 0));
hboxLayout = new QHBoxLayout(DatasetSelector);
#ifndef Q_OS_MAC
hboxLayout->setSpacing(6);
#endif
#ifndef Q_OS_MAC
hboxLayout->setContentsMargins(9, 9, 9, 9);
#endif
hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
groupBox = new QGroupBox(DatasetSelector);
groupBox->setObjectName(QString::fromUtf8("groupBox"));
groupBox->setCheckable(true);
groupBox->setChecked(false);
gridLayout = new QGridLayout(groupBox);
#ifndef Q_OS_MAC
gridLayout->setSpacing(6);
#endif
#ifndef Q_OS_MAC
gridLayout->setContentsMargins(9, 9, 9, 9);
#endif
gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
cbReverseColumns = new QCheckBox(groupBox);
cbReverseColumns->setObjectName(QString::fromUtf8("cbReverseColumns"));
gridLayout->addWidget(cbReverseColumns, 3, 1, 1, 3);
label_5 = new QLabel(groupBox);
label_5->setObjectName(QString::fromUtf8("label_5"));
label_5->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
gridLayout->addWidget(label_5, 3, 0, 1, 1);
sbStartColumn = new QSpinBox(groupBox);
sbStartColumn->setObjectName(QString::fromUtf8("sbStartColumn"));
gridLayout->addWidget(sbStartColumn, 2, 3, 1, 1);
label_2 = new QLabel(groupBox);
label_2->setObjectName(QString::fromUtf8("label_2"));
label_2->setAlignment(Qt::AlignCenter);
gridLayout->addWidget(label_2, 2, 2, 1, 1);
sbColumnCount = new QSpinBox(groupBox);
sbColumnCount->setObjectName(QString::fromUtf8("sbColumnCount"));
gridLayout->addWidget(sbColumnCount, 2, 1, 1, 1);
label = new QLabel(groupBox);
label->setObjectName(QString::fromUtf8("label"));
label->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
gridLayout->addWidget(label, 2, 0, 1, 1);
label_6 = new QLabel(groupBox);
label_6->setObjectName(QString::fromUtf8("label_6"));
label_6->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
gridLayout->addWidget(label_6, 1, 0, 1, 1);
sbStartRow = new QSpinBox(groupBox);
sbStartRow->setObjectName(QString::fromUtf8("sbStartRow"));
gridLayout->addWidget(sbStartRow, 0, 3, 1, 1);
label_4 = new QLabel(groupBox);
label_4->setObjectName(QString::fromUtf8("label_4"));
label_4->setAlignment(Qt::AlignCenter);
gridLayout->addWidget(label_4, 0, 2, 1, 1);
cbReverseRows = new QCheckBox(groupBox);
cbReverseRows->setObjectName(QString::fromUtf8("cbReverseRows"));
gridLayout->addWidget(cbReverseRows, 1, 1, 1, 3);
label_3 = new QLabel(groupBox);
label_3->setObjectName(QString::fromUtf8("label_3"));
label_3->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
gridLayout->addWidget(label_3, 0, 0, 1, 1);
sbRowCount = new QSpinBox(groupBox);
sbRowCount->setObjectName(QString::fromUtf8("sbRowCount"));
gridLayout->addWidget(sbRowCount, 0, 1, 1, 1);
spacerItem = new QSpacerItem(169, 31, QSizePolicy::Minimum, QSizePolicy::Expanding);
gridLayout->addItem(spacerItem, 4, 2, 1, 1);
hboxLayout->addWidget(groupBox);
retranslateUi(DatasetSelector);
QMetaObject::connectSlotsByName(DatasetSelector);
} // setupUi
void retranslateUi(QWidget *DatasetSelector)
{
DatasetSelector->setWindowTitle(QApplication::translate("DatasetSelector", "Data Selector", 0, QApplication::UnicodeUTF8));
groupBox->setTitle(QApplication::translate("DatasetSelector", "Only display a subset of the model in the chart:", 0, QApplication::UnicodeUTF8));
cbReverseColumns->setText(QApplication::translate("DatasetSelector", "in reverse order.", 0, QApplication::UnicodeUTF8));
label_5->setText(QApplication::translate("DatasetSelector", "...", 0, QApplication::UnicodeUTF8));
label_2->setText(QApplication::translate("DatasetSelector", "columns starting at column", 0, QApplication::UnicodeUTF8));
label->setText(QApplication::translate("DatasetSelector", "Display", 0, QApplication::UnicodeUTF8));
label_6->setText(QApplication::translate("DatasetSelector", "...", 0, QApplication::UnicodeUTF8));
label_4->setText(QApplication::translate("DatasetSelector", "rows starting at row", 0, QApplication::UnicodeUTF8));
cbReverseRows->setText(QApplication::translate("DatasetSelector", "in reverse order.", 0, QApplication::UnicodeUTF8));
label_3->setText(QApplication::translate("DatasetSelector", "Display", 0, QApplication::UnicodeUTF8));
} // retranslateUi
};
namespace Ui {
class DatasetSelector: public Ui_DatasetSelector {};
} // namespace Ui
QT_END_NAMESPACE
#endif // KDCHARTDATASETSELECTOR_H

View File

@ -1 +0,0 @@
#include "../src/KDABLibFakes.h"

View File

@ -1,80 +0,0 @@
/****************************************************************************
** Copyright (C) 2001-2011 Klaralvdalens Datakonsult AB. All rights reserved.
**
** This file is part of the KD Chart library.
**
** Licensees holding valid commercial KD Chart licenses may use this file in
** accordance with the KD Chart Commercial License Agreement provided with
** the Software.
**
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 and version 3 as published by the
** Free Software Foundation and appearing in the file LICENSE.GPL.txt included.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** Contact info@kdab.com if any conditions of this licensing are not
** clear to you.
**
**********************************************************************/
#ifndef KDAB_LIB_FAKES_H
#define KDAB_LIB_FAKES_H
#if defined Q_OS_DARWIN
/* On Mac OS X, ensure that <cmath> will define std::isnan */
#define _GLIBCPP_USE_C99 1
#endif
#include <cmath>
#ifdef Q_OS_SOLARIS
#include <sunmath.h>
#include <math.h>
#endif
#include <qglobal.h>
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#define DEGTORAD(d) (d)*M_PI/180
// Smybian's math.h doesn't define a trunc function
#if defined(Q_OS_SYMBIAN) || defined(QT_SIMULATOR)
#define trunc(x) (double) ((int) (x + (x >= 0.0 ? -0.5 : 0.5)))
#endif
// We use our own ISNAN / ISINF in the code to detect
// that we defined them.
// reason: Windows / MacOS do not have isnan() / isinf()
#if defined (Q_OS_WIN) && defined(_MSC_VER)
#include <float.h>
#define ISNAN(x ) _isnan(x )
#define ISINF(x ) (!(_finite(x ) + _isnan(x ) ) )
#elif defined (Q_OS_DARWIN) || defined (Q_OS_CYGWIN)
#define ISNAN(x) std::isnan(x)
#define ISINF(x) std::isinf(x)
#else
#define ISNAN(x) isnan(x)
#define ISINF(x) isinf(x)
#endif
// We wrap every for() by extra { } to work around
// the scope bug for loop counters in MS Visual C++ v6
#if defined(Q_CC_MSVC) && !defined(Q_CC_MSVC_NET)
/* This is done in Qt41 qglobal.h but not Qt42*/
#if QT_VERSION < 0x040200
#define for if (0) {} else for
#endif
#define KDAB_FOREACH( v, c ) if (0) {} else Q_FOREACH( v, c )
#else
#define KDAB_FOREACH( v, c ) Q_FOREACH( v, c )
#endif
#endif

View File

@ -1,182 +0,0 @@
/****************************************************************************
** Copyright (C) 2001-2011 Klaralvdalens Datakonsult AB. All rights reserved.
**
** This file is part of the KD Chart library.
**
** Licensees holding valid commercial KD Chart licenses may use this file in
** accordance with the KD Chart Commercial License Agreement provided with
** the Software.
**
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 and version 3 as published by the
** Free Software Foundation and appearing in the file LICENSE.GPL.txt included.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** Contact info@kdab.com if any conditions of this licensing are not
** clear to you.
**
**********************************************************************/
#ifndef CARTESIANCOORDINATETRANSFORMATION_H
#define CARTESIANCOORDINATETRANSFORMATION_H
#include <QList>
#include <QRectF>
#include <QPointF>
#include "KDChartZoomParameters.h"
#include <cmath>
#include <limits>
namespace KDChart {
// FIXME: if this struct is used more often, we need to make it a class
// with proper accessor methods:
/**
* \internal
*/
struct CoordinateTransformation {
QRectF diagramRect;
// represents the distance of the diagram coordinate origin to the
// origin of the coordinate plane space:
QPointF originTranslation;
// make a vector base for R2:
double unitVectorX;
double unitVectorY;
// implement isometric scaling:
double isoScaleX;
double isoScaleY;
CartesianCoordinatePlane::AxesCalcMode axesCalcModeY;
CartesianCoordinatePlane::AxesCalcMode axesCalcModeX;
ZoomParameters zoom;
typedef QPair< qreal, qreal > qrealPair;
inline qreal makeLogarithmic( qrealPair reference, qreal value ) const
{
qreal result = value;
qreal relation;
if( reference.second == -1.0 )
relation = 1.0;
else if( reference.second == 1.0 )
relation = 1.0;
else if( reference.second > 0.0 )
relation = reference.second / log10( reference.second );
else if( result < 0.0 )
relation = reference.second / log10( -reference.second );
else
relation = 10.0;
if( value == 0.0 )
result = 0.0;//std::numeric_limits< qreal >::quiet_NaN();
else if( value > 0.0 )
result = log10( result ) * relation;
else if( value < 0.0 )
result = -log10( -result ) * relation;
if( value == 0.0 )
return result;
result -= log10( qAbs( reference.first ) ) * relation;
result *= ( reference.second - reference.first ) / relation / (log10(qAbs(reference.second))-log10(qAbs(reference.first)));
result += reference.first;
if( reference.first < 0.0 )
{
result += reference.first;
result -= reference.second;
result = reference.first - result + reference.second;
}
return result;
}
inline QPointF translate( const QPointF& diagramPoint ) const
{
// ### de-inline me
QPointF result = originTranslation;
QPointF tempPoint = diagramPoint;
const QRectF& diagRect = diagramRect;
if( axesCalcModeY == CartesianCoordinatePlane::Logarithmic )
{
tempPoint.setY( makeLogarithmic( qrealPair( diagRect.bottom(), diagRect.y() ), tempPoint.y() ) );
}
if( axesCalcModeX == CartesianCoordinatePlane::Logarithmic )
{
tempPoint.setX( makeLogarithmic( qrealPair( diagRect.x(), diagRect.right() ), tempPoint.x() ) );
}
tempPoint.rx() += diagRect.width() / (2.0 * zoom.xFactor);
tempPoint.ry() += diagRect.height() / (2.0 * zoom.yFactor);
tempPoint.rx() -= diagRect.width() * zoom.xCenter;
tempPoint.ry() -= diagRect.height() * zoom.yCenter;
// translate: xNew = (xOld - diaX) * zoomX + diaX
tempPoint.setX( ( tempPoint.x() - diagRect.x() ) * zoom.xFactor + diagRect.x() );
tempPoint.setY( ( tempPoint.y() - diagRect.y() ) * zoom.yFactor + diagRect.y() );
result.rx() += isoScaleX * unitVectorX * tempPoint.x();
result.ry() += isoScaleY * unitVectorY * tempPoint.y();
return result;
}
// convert screen points to value space points
inline const QPointF translateBack( const QPointF& screenPoint ) const
{
qreal x, y;
x = screenPoint.x() - originTranslation.x();
y = screenPoint.y() - originTranslation.y();
x /= isoScaleX * unitVectorX;
y /= isoScaleY * unitVectorY;
// translate back: xOld = DiaX + (xNew - DiaX) / zoomX
x = diagramRect.x() + (x - diagramRect.x()) / zoom.xFactor;
y = diagramRect.y() + (y - diagramRect.y()) / zoom.yFactor;
x += diagramRect.width() * zoom.xCenter;
y += diagramRect.height() * zoom.yCenter;
x -= diagramRect.width() / (2.0 * zoom.xFactor);
y -= diagramRect.height() / (2.0 * zoom.yFactor);
/*
if ( axesCalcModeY == CartesianCoordinatePlane::Logarithmic ){
tempPoint.setY( makeLogarithmic( diagramRect.y(), tempPoint.y() ) );
//qDebug() << "Y: " << tempPoint.y();
}
if ( axesCalcModeX == CartesianCoordinatePlane::Logarithmic ){
//qDebug() << "X diagramRect.x(): " << diagramRect.x();
//qDebug() << "X tempPoint old: " << tempPoint;
tempPoint.setX( makeLogarithmic( diagramRect.width(), tempPoint.x() ) );
//qDebug() << "X tempPoint new: " << tempPoint;
}
// qDebug() << "CoordinateTransformation::translate() using diagramRect: "
// << diagramRect.x() << diagramRect.y() << diagramRect.width() << diagramRect.height();
*/
return QPointF(x, y);
}
};
typedef QList<CoordinateTransformation> CoordinateTransformationList;
}
#endif

View File

@ -1,156 +0,0 @@
/****************************************************************************
** Copyright (C) 2001-2011 Klaralvdalens Datakonsult AB. All rights reserved.
**
** This file is part of the KD Chart library.
**
** Licensees holding valid commercial KD Chart licenses may use this file in
** accordance with the KD Chart Commercial License Agreement provided with
** the Software.
**
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 and version 3 as published by the
** Free Software Foundation and appearing in the file LICENSE.GPL.txt included.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** Contact info@kdab.com if any conditions of this licensing are not
** clear to you.
**
**********************************************************************/
#include "KDChartAbstractArea.h"
#include "KDChartAbstractArea_p.h"
#include <qglobal.h>
#include <QPainter>
#include <QRect>
#include <KDABLibFakes>
using namespace KDChart;
#define d (d_func())
AbstractArea::Private::Private() :
AbstractAreaBase::Private()
{
// this bloc left empty intentionally
}
AbstractArea::Private::~Private()
{
// this bloc left empty intentionally
}
AbstractArea::AbstractArea()
: QObject()
, KDChart::AbstractAreaBase()
, KDChart::AbstractLayoutItem()
{
init();
}
AbstractArea::~AbstractArea()
{
// this bloc left empty intentionally
}
void AbstractArea::init()
{
d->amountOfLeftOverlap = 0;
d->amountOfRightOverlap = 0;
d->amountOfTopOverlap = 0;
d->amountOfBottomOverlap = 0;
}
int AbstractArea::leftOverlap( bool doNotRecalculate ) const
{
// Re-calculate the sizes,
// so we also get the amountOf..Overlap members set newly:
if( ! doNotRecalculate )
sizeHint();
return d->amountOfLeftOverlap;
}
int AbstractArea::rightOverlap( bool doNotRecalculate ) const
{
// Re-calculate the sizes,
// so we also get the amountOf..Overlap members set newly:
if( ! doNotRecalculate )
sizeHint();
return d->amountOfRightOverlap;
}
int AbstractArea::topOverlap( bool doNotRecalculate ) const
{
// Re-calculate the sizes,
// so we also get the amountOf..Overlap members set newly:
if( ! doNotRecalculate )
sizeHint();
return d->amountOfTopOverlap;
}
int AbstractArea::bottomOverlap( bool doNotRecalculate ) const
{
// Re-calculate the sizes,
// so we also get the amountOf..Overlap members set newly:
if( ! doNotRecalculate )
sizeHint();
return d->amountOfBottomOverlap;
}
void AbstractArea::paintIntoRect( QPainter& painter, const QRect& rect )
{
const QRect oldGeometry( geometry() );
if( oldGeometry != rect )
setGeometry( rect );
painter.translate( rect.left(), rect.top() );
paintAll( painter );
painter.translate( -rect.left(), -rect.top() );
if( oldGeometry != rect )
setGeometry( oldGeometry );
}
void AbstractArea::paintAll( QPainter& painter )
{
// Paint the background and frame
const QRect overlappingArea( geometry().adjusted(
-d->amountOfLeftOverlap,
-d->amountOfTopOverlap,
d->amountOfRightOverlap,
d->amountOfBottomOverlap ) );
paintBackground( painter, overlappingArea );
paintFrame( painter, overlappingArea );
// temporarily adjust the widget size, to be sure all content gets calculated
// to fit into the inner rectangle
const QRect oldGeometry( areaGeometry() );
QRect inner( innerRect() );
inner.moveTo(
oldGeometry.left() + inner.left(),
oldGeometry.top() + inner.top() );
const bool needAdjustGeometry = oldGeometry != inner;
if( needAdjustGeometry )
setGeometry( inner );
paint( &painter );
if( needAdjustGeometry )
setGeometry( oldGeometry );
//qDebug() << "AbstractAreaWidget::paintAll() done.";
}
QRect AbstractArea::areaGeometry() const
{
return geometry();
}
void AbstractArea::positionHasChanged()
{
emit positionChanged( this );
}

View File

@ -1,140 +0,0 @@
/****************************************************************************
** Copyright (C) 2001-2011 Klaralvdalens Datakonsult AB. All rights reserved.
**
** This file is part of the KD Chart library.
**
** Licensees holding valid commercial KD Chart licenses may use this file in
** accordance with the KD Chart Commercial License Agreement provided with
** the Software.
**
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 and version 3 as published by the
** Free Software Foundation and appearing in the file LICENSE.GPL.txt included.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** Contact info@kdab.com if any conditions of this licensing are not
** clear to you.
**
**********************************************************************/
#ifndef KDCHARTABSTRACTAREA_H
#define KDCHARTABSTRACTAREA_H
#include <QObject>
#include "KDChartGlobal.h"
#include "KDChartAbstractAreaBase.h"
#include "KDChartLayoutItems.h"
namespace KDChart {
/**
* @class AbstractArea KDChartAbstractArea.h
* @brief An area in the chart with a background, a frame, etc.
*
* AbstractArea is the base class for all non-widget chart elements that have
* a set of background attributes and frame attributes, such as
* coordinate planes or axes.
*
* @note This class inherits from AbstractAreaBase, AbstractLayoutItem, QObject.
* The reason for this tripple inheritance is that neither AbstractAreaBase nor
* AbstractLayoutItem are QObject.
*/
class KDCHART_EXPORT AbstractArea : public QObject,
public AbstractAreaBase,
public AbstractLayoutItem
{
Q_OBJECT
Q_DISABLE_COPY( AbstractArea )
KDCHART_DECLARE_PRIVATE_DERIVED( AbstractArea )
public:
virtual ~AbstractArea() ;
// virtual AbstractArea * clone() const = 0;
/**
* @brief 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.
*/
virtual void paintIntoRect( QPainter& painter, const QRect& rect );
/**
* Call paintAll, if you want the background and the frame to be drawn
* before the normal paint() is invoked automatically.
*/
virtual void paintAll( QPainter& painter );
/**
* 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.
*/
virtual int leftOverlap( bool doNotRecalculate=false ) const;
/**
* 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.
*/
virtual int rightOverlap( bool doNotRecalculate=false ) const;
/**
* 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.
*/
virtual int topOverlap( bool doNotRecalculate=false ) const;
/**
* 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.
*/
virtual int bottomOverlap( bool doNotRecalculate=false ) const;
protected:
AbstractArea();
virtual QRect areaGeometry() const;
virtual void positionHasChanged();
Q_SIGNALS:
void positionChanged( AbstractArea * );
//KDCHART_DECLARE_PRIVATE_DERIVED(AbstractArea)
}; // End of class AbstractArea
}
#endif // KDCHARTABSTRACTAREA_H

View File

@ -1,242 +0,0 @@
/****************************************************************************
** Copyright (C) 2001-2011 Klaralvdalens Datakonsult AB. All rights reserved.
**
** This file is part of the KD Chart library.
**
** Licensees holding valid commercial KD Chart licenses may use this file in
** accordance with the KD Chart Commercial License Agreement provided with
** the Software.
**
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 and version 3 as published by the
** Free Software Foundation and appearing in the file LICENSE.GPL.txt included.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** Contact info@kdab.com if any conditions of this licensing are not
** clear to you.
**
**********************************************************************/
#include "KDChartAbstractAreaBase.h"
#include "KDChartAbstractAreaBase_p.h"
#include <KDChartBackgroundAttributes.h>
#include <KDChartFrameAttributes.h>
#include <KDChartTextAttributes.h>
#include "KDChartPainterSaver_p.h"
#include "KDChartPrintingParameters.h"
#include <QPainter>
#include <KDABLibFakes>
using namespace KDChart;
AbstractAreaBase::Private::Private() :
visible( true )
// PENDING(khz) dockingPointToPadding?, alignToDockingPoint?
{
init();
}
AbstractAreaBase::Private::~Private() {}
void AbstractAreaBase::Private::init()
{
}
AbstractAreaBase::AbstractAreaBase() :
_d( new Private() )
{
}
AbstractAreaBase::~AbstractAreaBase()
{
delete _d; _d = 0;
}
void AbstractAreaBase::init()
{
}
#define d d_func()
bool AbstractAreaBase::compare( const AbstractAreaBase* other )const
{
if( other == this ) return true;
if( ! other ){
//qDebug() << "CartesianAxis::compare() cannot compare to Null pointer";
return false;
}
/*
qDebug() << "AbstractAreaBase:" << (frameAttributes() == other->frameAttributes())
<< (backgroundAttributes() == other->backgroundAttributes()) << "\n";
*/
return (frameAttributes() == other->frameAttributes()) &&
(backgroundAttributes() == other->backgroundAttributes());
}
void AbstractAreaBase::alignToReferencePoint( const RelativePosition& position )
{
Q_UNUSED( position );
// PENDING(kalle) FIXME
qWarning( "Sorry, not implemented: void AbstractAreaBase::alignToReferencePoint( const RelativePosition& position )" );
}
void AbstractAreaBase::setFrameAttributes( const FrameAttributes &a )
{
if( d->frameAttributes == a )
return;
d->frameAttributes = a;
positionHasChanged();
}
FrameAttributes AbstractAreaBase::frameAttributes() const
{
return d->frameAttributes;
}
void AbstractAreaBase::setBackgroundAttributes( const BackgroundAttributes &a )
{
if( d->backgroundAttributes == a )
return;
d->backgroundAttributes = a;
positionHasChanged();
}
BackgroundAttributes AbstractAreaBase::backgroundAttributes() const
{
return d->backgroundAttributes;
}
/* static */
void AbstractAreaBase::paintBackgroundAttributes( QPainter& painter, const QRect& rect,
const KDChart::BackgroundAttributes& attributes )
{
if( !attributes.isVisible() ) return;
/* first draw the brush (may contain a pixmap)*/
if( Qt::NoBrush != attributes.brush().style() ) {
KDChart::PainterSaver painterSaver( &painter );
painter.setPen( Qt::NoPen );
const QPointF newTopLeft( painter.deviceMatrix().map( rect.topLeft() ) );
painter.setBrushOrigin( newTopLeft );
painter.setBrush( attributes.brush() );
painter.drawRect( rect.adjusted( 0, 0, -1, -1 ) );
}
/* next draw the backPixmap over the brush */
if( !attributes.pixmap().isNull() &&
attributes.pixmapMode() != BackgroundAttributes::BackgroundPixmapModeNone ) {
QPointF ol = rect.topLeft();
if( BackgroundAttributes::BackgroundPixmapModeCentered == attributes.pixmapMode() )
{
ol.setX( rect.center().x() - attributes.pixmap().width() / 2 );
ol.setY( rect.center().y() - attributes.pixmap().height()/ 2 );
painter.drawPixmap( ol, attributes.pixmap() );
} else {
QMatrix m;
double zW = (double)rect.width() / (double)attributes.pixmap().width();
double zH = (double)rect.height() / (double)attributes.pixmap().height();
switch( attributes.pixmapMode() ) {
case BackgroundAttributes::BackgroundPixmapModeScaled:
{
double z;
z = qMin( zW, zH );
m.scale( z, z );
}
break;
case BackgroundAttributes::BackgroundPixmapModeStretched:
m.scale( zW, zH );
break;
default:
; // Cannot happen, previously checked
}
QPixmap pm = attributes.pixmap().transformed( m );
ol.setX( rect.center().x() - pm.width() / 2 );
ol.setY( rect.center().y() - pm.height()/ 2 );
painter.drawPixmap( ol, pm );
}
}
}
/* static */
void AbstractAreaBase::paintFrameAttributes( QPainter& painter, const QRect& rect,
const KDChart::FrameAttributes& attributes )
{
if( !attributes.isVisible() ) return;
// Note: We set the brush to NoBrush explicitly here.
// Otherwise we might get a filled rectangle, so any
// previously drawn background would be overwritten by that area.
const QPen oldPen( painter.pen() );
const QBrush oldBrush( painter.brush() );
painter.setPen( PrintingParameters::scalePen( attributes.pen() ) );
painter.setBrush( Qt::NoBrush );
painter.drawRect( rect.adjusted( 0, 0, -1, -1 ) );
painter.setBrush( oldBrush );
painter.setPen( oldPen );
}
void AbstractAreaBase::paintBackground( QPainter& painter, const QRect& rect )
{
Q_ASSERT_X ( d != 0, "AbstractAreaBase::paintBackground()",
"Private class was not initialized!" );
paintBackgroundAttributes( painter, rect, d->backgroundAttributes );
}
void AbstractAreaBase::paintFrame( QPainter& painter, const QRect& rect )
{
Q_ASSERT_X ( d != 0, "AbstractAreaBase::paintFrame()",
"Private class was not initialized!" );
paintFrameAttributes( painter, rect, d->frameAttributes );
}
void AbstractAreaBase::getFrameLeadings(int& left, int& top, int& right, int& bottom ) const
{
if( d && d->frameAttributes.isVisible() ){
const int padding = qMax( d->frameAttributes.padding(), 0 );
left = padding;
top = padding;
right = padding;
bottom = padding;
}else{
left = 0;
top = 0;
right = 0;
bottom = 0;
}
}
QRect AbstractAreaBase::innerRect() const
{
int left;
int top;
int right;
int bottom;
getFrameLeadings( left, top, right, bottom );
return
QRect( QPoint(0,0), areaGeometry().size() )
.adjusted( left, top, -right, -bottom );
}
void AbstractAreaBase::positionHasChanged()
{
// this bloc left empty intentionally
}

View File

@ -1,129 +0,0 @@
/****************************************************************************
** Copyright (C) 2001-2011 Klaralvdalens Datakonsult AB. All rights reserved.
**
** This file is part of the KD Chart library.
**
** Licensees holding valid commercial KD Chart licenses may use this file in
** accordance with the KD Chart Commercial License Agreement provided with
** the Software.
**
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 and version 3 as published by the
** Free Software Foundation and appearing in the file LICENSE.GPL.txt included.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** Contact info@kdab.com if any conditions of this licensing are not
** clear to you.
**
**********************************************************************/
#ifndef KDCHARTABSTRACTAREABASE_H
#define KDCHARTABSTRACTAREABASE_H
#include <QPointF>