##// END OF EJS Templates
Refactors internals...
Refactors internals * rewrite axisUpdated signal handling * create handlers for each property of axis * decouple chartdataset, presenter, theme * adds theme manager * adds axis add/remove/attach/detach handling * refactors createGraphics * add initializers (graphics,domain,theme,animations) * refactor the way the charts are constructed (decouple form presenter) * fix initialization issues with qchart * refactor domain logic to handle also geometry size for charts * delegate xyseries geometry calculation to domian * fix lazy initialization of animations * remove hadnleGeomoetryChanged * add shared pointers to handle reference count for domain * moves nice number algorithm to domain * adds applyNiceNumbers(), depreciate setNiceNumbers * refactor multiple charts handling * domain is shared object * each domain can have multiple axis for controlling * multiple charts share now the same domain

File last commit:

r2273:1c49aa901cb2
r2273:1c49aa901cb2
Show More
qabstractaxis.h
191 lines | 7.0 KiB | text/x-c | CLexer
/ src / axis / qabstractaxis.h
Michal Klocek
Adds new API classes...
r1540 /****************************************************************************
**
** Copyright (C) 2012 Digia Plc
** All rights reserved.
** For any questions to Digia, please use contact form at http://qt.digia.com
**
** This file is part of the Qt Commercial Charts Add-on.
**
** $QT_BEGIN_LICENSE$
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia.
**
** If you have questions regarding the use of this file, please use
** contact form at http://qt.digia.com
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QABSTRACTAXIS_H
#define QABSTRACTAXIS_H
#include <qchartglobal.h>
#include <QPen>
#include <QFont>
Michal Klocek
Refactors QAxis to QAbstractAxis...
r1541 #include <QVariant>
Michal Klocek
Adds new API classes...
r1540
QTCOMMERCIALCHART_BEGIN_NAMESPACE
class QAbstractAxisPrivate;
class QTCOMMERCIALCHART_EXPORT QAbstractAxis : public QObject
{
Marek Rosa
Multiaxis support...
r2093 Q_OBJECT
Michal Klocek
Refactors internals...
r2273 //visibility
Marek Rosa
Multiaxis support...
r2093 Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged)
Michal Klocek
Refactors internals...
r2273 //arrow
Marek Rosa
QAbstractAxis: fixed tests after renaming
r1845 Q_PROPERTY(bool lineVisible READ isLineVisible WRITE setLineVisible NOTIFY lineVisibleChanged)
Michal Klocek
Refactors internals...
r2273 Q_PROPERTY(QPen linePen READ linePen WRITE setLinePen NOTIFY linePenChanged)
//TODO: make wrapping of color for qml
Marek Rosa
QAbstractAxis: renamed Arrow and Axis to line in methods names
r1844 Q_PROPERTY(QColor color READ linePenColor WRITE setLinePenColor NOTIFY colorChanged)
Michal Klocek
Refactors internals...
r2273 //labels
Michal Klocek
Adds new API classes...
r1540 Q_PROPERTY(bool labelsVisible READ labelsVisible WRITE setLabelsVisible NOTIFY labelsVisibleChanged)
Michal Klocek
Refactors internals...
r2273 Q_PROPERTY(QPen lablesPen READ labelsPen WRITE setLabelsPen NOTIFY labelsPenChanged)
Q_PROPERTY(QBrush lablesBrush READ labelsBrush WRITE setLabelsBrush NOTIFY labelsBrushChanged)
//TODO: fix labels angles to work with layout
Q_PROPERTY(int labelsAngle READ labelsAngle WRITE setLabelsAngle NOTIFY labelsAngleChanged)
Q_PROPERTY(QFont labelsFont READ labelsFont WRITE setLabelsFont NOTIFY labelsFontChanged)
//TODO: make wrapping of color for qml
Michal Klocek
Adds new API classes...
r1540 Q_PROPERTY(QColor labelsColor READ labelsColor WRITE setLabelsColor NOTIFY labelsColorChanged)
Michal Klocek
Refactors internals...
r2273 //grid
Q_PROPERTY(bool gridVisible READ isGridLineVisible WRITE setGridLineVisible NOTIFY gridLineVisibleChanged)
Q_PROPERTY(QPen girdLinePen READ gridLinePen WRITE setGridLinePen NOTIFY gridLinePenChanged)
//shades
Michal Klocek
Adds new API classes...
r1540 Q_PROPERTY(bool shadesVisible READ shadesVisible WRITE setShadesVisible NOTIFY shadesVisibleChanged)
Michal Klocek
Refactors internals...
r2273 //TODO: make wrapping of color for qml
Michal Klocek
Adds new API classes...
r1540 Q_PROPERTY(QColor shadesColor READ shadesColor WRITE setShadesColor NOTIFY shadesColorChanged)
Michal Klocek
Refactors internals...
r2273 //TODO: make wrapping of border for qml
Michal Klocek
Adds new API classes...
r1540 Q_PROPERTY(QColor shadesBorderColor READ shadesBorderColor WRITE setShadesBorderColor NOTIFY shadesBorderColorChanged)
Michal Klocek
Refactors internals...
r2273 Q_PROPERTY(QPen shadesPen READ shadesPen WRITE setShadesPen NOTIFY shadesPenChanged)
Q_PROPERTY(QBrush shadesBrush READ shadesBrush WRITE setShadesBrush NOTIFY shadesBrushChanged)
//title
Q_PROPERTY(QString titleText READ titleText WRITE setTitleText NOTIFY titleTextChanged)
Q_PROPERTY(QPen titlePen READ titlePen WRITE setTitlePen NOTIFY titlePenChanged)
Q_PROPERTY(QBrush titleBrush READ titleBrush WRITE setTitleBrush NOTIFY titleBrushChanged)
Marek Rosa
Added few properties to QAbstractAxis. Some are still missing. Its needs to be decided how the Brush and Pen should be supported
r2203 Q_PROPERTY(bool titleVisible READ titleVisible WRITE setTitleVisible)
Q_PROPERTY(QFont titleFont READ titleFont WRITE setTitleFont)
Michal Klocek
Adds new API classes...
r1540
public:
enum AxisType {
Michal Klocek
Adds createDefaultAxes logic
r1588 AxisTypeNoAxis = 0x0,
Marek Rosa
updated AxisType names
r1818 AxisTypeValue = 0x1,
AxisTypeBarCategory = 0x2,
AxisTypeCategory = 0x3,
Marek Rosa
Added QDateTimeAxis
r1717 AxisTypeDateTime = 0x4
Michal Klocek
Adds new API classes...
r1540 };
Michal Klocek
Adds createDefaultAxes logic
r1588 Q_DECLARE_FLAGS(AxisTypes, AxisType)
Michal Klocek
Adds new API classes...
r1540 protected:
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 explicit QAbstractAxis(QAbstractAxisPrivate &d, QObject *parent = 0);
Michal Klocek
Adds new API classes...
r1540
public:
~QAbstractAxis();
virtual AxisType type() const = 0;
Michal Klocek
Refactors internals...
r2273 //visibility handling
Michal Klocek
Adds visibity paramter to axis
r1617 bool isVisible() const;
void setVisible(bool visible = true);
Michal Klocek
Refactors internals...
r2273 void show();
void hide();
Michal Klocek
Adds visibity paramter to axis
r1617
Michal Klocek
Refactors internals...
r2273 //arrow handling
Marek Rosa
QAbstractAxis: renamed Arrow and Axis to line in methods names
r1844 bool isLineVisible() const;
void setLineVisible(bool visible = true);
void setLinePen(const QPen &pen);
QPen linePen() const;
void setLinePenColor(QColor color);
QColor linePenColor() const;
Michal Klocek
Adds new API classes...
r1540
//grid handling
bool isGridLineVisible() const;
void setGridLineVisible(bool visible = true);
void setGridLinePen(const QPen &pen);
QPen gridLinePen() const;
//labels handling
bool labelsVisible() const;
void setLabelsVisible(bool visible = true);
void setLabelsPen(const QPen &pen);
QPen labelsPen() const;
void setLabelsBrush(const QBrush &brush);
QBrush labelsBrush() const;
void setLabelsFont(const QFont &font);
QFont labelsFont() const;
void setLabelsAngle(int angle);
int labelsAngle() const;
void setLabelsColor(QColor color);
QColor labelsColor() const;
Michal Klocek
Refactors layout...
r1965 //title handling
bool titleVisible() const;
void setTitleVisible(bool visible = true);
void setTitlePen(const QPen &pen);
QPen titlePen() const;
void setTitleBrush(const QBrush &brush);
QBrush titleBrush() const;
void setTitleFont(const QFont &font);
QFont titleFont() const;
Michal Klocek
Refactors internals...
r2273 void setTitleText(const QString &title);
QString titleText() const;
Michal Klocek
Refactors layout...
r1965
Michal Klocek
Adds new API classes...
r1540 //shades handling
bool shadesVisible() const;
void setShadesVisible(bool visible = true);
void setShadesPen(const QPen &pen);
QPen shadesPen() const;
void setShadesBrush(const QBrush &brush);
QBrush shadesBrush() const;
void setShadesColor(QColor color);
QColor shadesColor() const;
void setShadesBorderColor(QColor color);
QColor shadesBorderColor() const;
Michal Klocek
Refactors internals...
r2273 Qt::Orientation orientation(); //TODO: missing const <- BC
Michal Klocek
Refactors layout:...
r2105 Qt::Alignment alignment() const;
Michal Klocek
Adds axis domain intialization
r1695
Michal Klocek
Refactors QAxis to QAbstractAxis...
r1541 //range handling
sauimone
QAbstractAxis: variants strike back.
r1578 void setMin(const QVariant &min);
void setMax(const QVariant &max);
void setRange(const QVariant &min, const QVariant &max);
Michal Klocek
Adds new API classes...
r1540
Q_SIGNALS:
void visibleChanged(bool visible);
Michal Klocek
Refactors internals...
r2273 void linePenChanged(const QPen& pen);
Marek Rosa
QAbstractAxis: renamed Arrow and Axis to line in methods names
r1844 void lineVisibleChanged(bool visible);
Michal Klocek
Adds new API classes...
r1540 void labelsVisibleChanged(bool visible);
Michal Klocek
Refactors internals...
r2273 void labelsPenChanged(const QPen& pen);
void labelsBrushChanged(const QBrush& brush);
void labelsFontChanged(const QFont& pen);
void labelsAngleChanged(int angle);
void gridLinePenChanged(const QPen& pen);
void gridLineVisibleChanged(bool visible);
Michal Klocek
Adds new API classes...
r1540 void colorChanged(QColor color);
void labelsColorChanged(QColor color);
Michal Klocek
Refactors internals...
r2273 void titleTextChanged(const QString& title);
void titlePenChanged(const QPen& pen);
void titleBrushChanged(const QBrush brush);
void titleVisibleChanged(bool visible);
void titleFontChanged(const QFont& font);
Michal Klocek
Adds new API classes...
r1540 void shadesVisibleChanged(bool visible);
void shadesColorChanged(QColor color);
void shadesBorderColorChanged(QColor color);
Michal Klocek
Refactors internals...
r2273 void shadesPenChanged(const QPen& pen);
void shadesBrushChanged(const QBrush brush);
Michal Klocek
Adds new API classes...
r1540
protected:
Marek Rosa
Multiaxis support...
r2093 QScopedPointer<QAbstractAxisPrivate> d_ptr;
Tero Ahola
Switched the z-order of axis to be below series...
r1790 Q_DISABLE_COPY(QAbstractAxis)
Michal Klocek
Refactors QAxis to QAbstractAxis...
r1541 friend class ChartDataSet;
friend class ChartAxis;
Michal Klocek
Refactors core to support mulitpile axis and domains...
r1556 friend class ChartPresenter;
Michal Klocek
Refactors internals...
r2273 friend class ChartThemeManager;
Michal Klocek
Adds new API classes...
r1540 };
QTCOMMERCIALCHART_END_NAMESPACE
Jani Honkonen
Spit&polish public headers
r2046
#endif // QABSTRACTAXIS_H