##// END OF EJS Templates
Implements minimumMargins...
Implements minimumMargins * adds mising margin implementation * setter and getter for minimumMargins * changes return values QMargins instead of QRectF * updates unit tests * QML TODO: not clear what should be handled there margins or plotArea * fixes chartlayout - minimum width of Axis is calculated

File last commit:

r1845:0282556dc0a1
r1883:fa0e7a49da94
Show More
qabstractaxis.h
143 lines | 4.6 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
{
Q_OBJECT
Michal Klocek
Adds visibity paramter to axis
r1617 Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged)
Marek Rosa
QAbstractAxis: fixed tests after renaming
r1845 Q_PROPERTY(bool lineVisible READ isLineVisible WRITE setLineVisible NOTIFY lineVisibleChanged)
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
Adds new API classes...
r1540 Q_PROPERTY(bool labelsVisible READ labelsVisible WRITE setLabelsVisible NOTIFY labelsVisibleChanged)
Q_PROPERTY(int labelsAngle READ labelsAngle WRITE setLabelsAngle)
Q_PROPERTY(QFont labelsFont READ labelsFont WRITE setLabelsFont)
Q_PROPERTY(QColor labelsColor READ labelsColor WRITE setLabelsColor NOTIFY labelsColorChanged)
Q_PROPERTY(bool gridVisible READ isGridLineVisible WRITE setGridLineVisible NOTIFY gridVisibleChanged)
Q_PROPERTY(bool shadesVisible READ shadesVisible WRITE setShadesVisible NOTIFY shadesVisibleChanged)
Q_PROPERTY(QColor shadesColor READ shadesColor WRITE setShadesColor NOTIFY shadesColorChanged)
Q_PROPERTY(QColor shadesBorderColor READ shadesBorderColor WRITE setShadesBorderColor NOTIFY shadesBorderColorChanged)
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:
explicit QAbstractAxis(QAbstractAxisPrivate &d,QObject *parent = 0);
public:
~QAbstractAxis();
virtual AxisType type() const = 0;
Michal Klocek
Adds visibity paramter to axis
r1617 //visibilty hadnling
bool isVisible() const;
void setVisible(bool visible = true);
Michal Klocek
Adds new API classes...
r1540 //axis 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;
//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
Adds axis domain intialization
r1695 Qt::Orientation orientation();
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
void show();
void hide();
Q_SIGNALS:
void visibleChanged(bool visible);
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);
void gridVisibleChanged(bool visible);
void colorChanged(QColor color);
void labelsColorChanged(QColor color);
void shadesVisibleChanged(bool visible);
void shadesColorChanged(QColor color);
void shadesBorderColorChanged(QColor color);
protected:
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
Adds new API classes...
r1540 };
QTCOMMERCIALCHART_END_NAMESPACE
#endif