##// END OF EJS Templates
Add dealy to tst_qchartview
Add dealy to tst_qchartview

File last commit:

r855:e561e621da22
r911:131b52731487
Show More
axisitem_p.h
143 lines | 3.6 KiB | text/x-c | CLexer
Jani Honkonen
Add license headers
r794 /****************************************************************************
**
** 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$
**
****************************************************************************/
Michal Klocek
Add zoom support...
r67 #ifndef AXISITEM_H_
#define AXISITEM_H_
Michal Klocek
Refactor qledgend handling...
r855 #include "qchartglobal.h"
Michal Klocek
Refactors chartitem...
r677 #include "chart_p.h"
Michal Klocek
Add zoom support...
r67 #include <QGraphicsItem>
QTCOMMERCIALCHART_BEGIN_NAMESPACE
Michal Klocek
Adds refactored axis to presenter
r140 class QChartAxis;
Michal Klocek
Animation refactor...
r530 class ChartPresenter;
Michal Klocek
Adds refactored axis to presenter
r140
Michal Klocek
Refactors chartitem...
r677 class Axis : public Chart
Michal Klocek
Add zoom support...
r67 {
Michal Klocek
Adds refactored axis to presenter
r140 Q_OBJECT
Michal Klocek
Add zoom support...
r67 public:
enum AxisType{X_AXIS,Y_AXIS};
sauimone
more minor code review fixes
r745 Axis(QChartAxis *axis, ChartPresenter *presenter, AxisType type = X_AXIS);
Michal Klocek
Refactors chartitem...
r677 ~Axis();
Michal Klocek
Add zoom support...
r67
Tero Ahola
Internal review: Removed extra semicolons
r760 AxisType axisType() const { return m_type; }
Michal Klocek
Adds refactored axis to presenter
r140
Michal Klocek
Fixes wrong shades zvalues
r184 void setAxisOpacity(qreal opacity);
qreal axisOpacity() const;
Michal Klocek
Adds more axis handling...
r176 void setGridOpacity(qreal opacity);
qreal gridOpacity() const;
Michal Klocek
Adds refactored axis to presenter
r140
Michal Klocek
Adds more axis handling...
r176 void setLabelsOpacity(qreal opacity);
qreal labelsOpacity() const;
Michal Klocek
Adds refactored axis to presenter
r140
Michal Klocek
Adds more axis handling...
r176 void setShadesOpacity(qreal opacity);
qreal shadesOpacity() const;
Michal Klocek
Add zoom support...
r67
Michal Klocek
Adds more axis handling...
r176 void setLabelsAngle(int angle);
int labelsAngle()const { return m_labelsAngle; }
sauimone
more minor code review fixes
r745 void setShadesBrush(const QBrush &brush);
void setShadesPen(const QPen &pen);
Michal Klocek
Adds refactored axis to presenter
r140
sauimone
more minor code review fixes
r745 void setAxisPen(const QPen &pen);
void setGridPen(const QPen &pen);
Michal Klocek
Adds more axis handling...
r176
sauimone
more minor code review fixes
r745 void setLabelsPen(const QPen &pen);
void setLabelsBrush(const QBrush &brush);
void setLabelsFont(const QFont &font);
Michal Klocek
Adds more axis handling...
r176
Michal Klocek
Adding zoom in out animation support
r513 inline QRectF geometry() const { return m_rect; }
Tero Ahola
Internal review: Removed extra semicolons
r760 inline QVector<qreal> layout() { return m_layoutVector; }
Michal Klocek
Fix grid animation to do not go out of bound
r504
sauimone
Q_SIGNALS and Q_SLOTS
r775 public Q_SLOTS:
Michal Klocek
Axis refactoring to support better barcharts
r502 void handleAxisUpdated();
void handleAxisCategoriesUpdated();
Michal Klocek
Adds scroll support...
r531 void handleRangeChanged(qreal min , qreal max,int tickCount);
sauimone
more minor code review fixes
r745 void handleGeometryChanged(const QRectF &size);
Michal Klocek
Refactor domain model...
r439
Michal Klocek
Clean up axis animation code
r393
Michal Klocek
Refactora axis and line chart to use graphics items insted of painter.
r85 private:
Michal Klocek
Refacotr axisitem to handle ticks changes
r452 inline bool isEmpty();
Michal Klocek
Refactors axis handling...
r223 void createItems(int count);
Michal Klocek
Axis refactoring to support better barcharts
r502 void deleteItems(int count);
Michal Klocek
Animation refactor...
r530
Michal Klocek
Axis refactoring to support better barcharts
r502 QVector<qreal> calculateLayout() const;
sauimone
more minor code review fixes
r745 void updateLayout(QVector<qreal> &layout);
void setLayout(QVector<qreal> &layout);
Michal Klocek
Animation refactor...
r530
sauimone
more minor code review fixes
r745 bool createLabels(QStringList &labels,qreal min, qreal max,int ticks) const;
Michal Klocek
Refactors chartitem...
r677 void axisSelected();
Michal Klocek
Adds draft of axis bar label support
r497
Michal Klocek
Add zoom support...
r67 private:
Michal Klocek
Refactor domain model...
r439 QChartAxis* m_chartAxis;
Michal Klocek
Adds refactored axis to presenter
r140 AxisType m_type;
QRectF m_rect;
Michal Klocek
Adds more axis handling...
r176 int m_labelsAngle;
Michal Klocek
Adds axis scoped pointers (to be checked on windows)
r788 QScopedPointer<QGraphicsItemGroup> m_grid;
QScopedPointer<QGraphicsItemGroup> m_shades;
QScopedPointer<QGraphicsItemGroup> m_labels;
QScopedPointer<QGraphicsItemGroup> m_axis;
Michal Klocek
Refactors axis layout managment...
r291 QVector<qreal> m_layoutVector;
Michal Klocek
Refacotr axisitem to handle ticks changes
r452 qreal m_min;
qreal m_max;
Michal Klocek
Axis refactoring to support better barcharts
r502 int m_ticksCount;
Michal Klocek
Adds refactored axis to presenter
r140
Michal Klocek
Animation refactor...
r530 friend class AxisAnimation;
Michal Klocek
Refactors chartitem...
r677 friend class AxisItem;
};
class AxisItem: public QGraphicsLineItem
{
public:
Tero Ahola
Internal review: Removed extra semicolons
r760 AxisItem(Axis *axis, QGraphicsItem *parent = 0) : QGraphicsLineItem(parent), m_axis(axis) {}
Michal Klocek
Refactors chartitem...
r677
protected:
void mousePressEvent(QGraphicsSceneMouseEvent *event)
{
Q_UNUSED(event)
m_axis->axisSelected();
}
QRectF boundingRect() const
{
Michal Klocek
Refactors barchart axis hadnling...
r679 return shape().boundingRect();
Michal Klocek
Refactors chartitem...
r677 }
QPainterPath shape() const
{
Michal Klocek
Refactors barchart axis hadnling...
r679 QPainterPath path = QGraphicsLineItem::shape();
QRectF rect = path.boundingRect();
path.addRect(rect.adjusted(0,0,m_axis->axisType()!=Axis::X_AXIS?8:0,m_axis->axisType()!=Axis::Y_AXIS?8:0));
Michal Klocek
Refactors chartitem...
r677 return path;
}
Michal Klocek
Refactors barchart axis hadnling...
r679
Michal Klocek
Refactors chartitem...
r677 private:
Axis* m_axis;
Michal Klocek
Animation refactor...
r530
Michal Klocek
Add zoom support...
r67 };
QTCOMMERCIALCHART_END_NAMESPACE
#endif /* AXISITEM_H_ */