##// END OF EJS Templates
Added QChart::locale property...
Added QChart::locale property This locale is used for localizing the numbers on various labels when localizeNumbers is set to true. It is also the locale that QDateTimeAxis labels use for month and day names. Task-number: QTRD-3179 Change-Id: Ib9a9cad770c5a6890311fe45a1d4cabd5f40aff4 Reviewed-by: Mika Salmela <mika.salmela@digia.com>

File last commit:

r2708:b421e87aa00a
r2708:b421e87aa00a
Show More
chartpresenter_p.h
191 lines | 5.5 KiB | text/x-c | CLexer
/ src / chartpresenter_p.h
Jani Honkonen
Add license headers
r794 /****************************************************************************
**
Titta Heikkala
Update copyright year...
r2688 ** Copyright (C) 2014 Digia Plc
Jani Honkonen
Add license headers
r794 ** All rights reserved.
** For any questions to Digia, please use contact form at http://qt.digia.com
**
Miikka Heikkinen
Qt Commercial -> Qt Enterprise...
r2574 ** This file is part of the Qt Enterprise Charts Add-on.
Jani Honkonen
Add license headers
r794 **
** $QT_BEGIN_LICENSE$
Miikka Heikkinen
Qt Commercial -> Qt Enterprise...
r2574 ** Licensees holding valid Qt Enterprise licenses may use this file in
** accordance with the Qt Enterprise License Agreement provided with the
Jani Honkonen
Add license headers
r794 ** 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$
**
****************************************************************************/
unknown
Added missing warning about private implementation
r1366 // W A R N I N G
// -------------
//
Miikka Heikkinen
Qt Commercial -> Qt Enterprise...
r2574 // This file is not part of the Qt Enterprise Chart API. It exists purely as an
unknown
Added missing warning about private implementation
r1366 // implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
Michal Klocek
Fixes header guard style issues
r969 #ifndef CHARTPRESENTER_H
#define CHARTPRESENTER_H
Michal Klocek
Refactors qchart , adds line animation...
r131
#include "qchartglobal.h"
Miikka Heikkinen
Remove cryptic/obsolete TODOs
r2439 #include "qchart.h" //because of QChart::ChartThemeId
Michal Klocek
Refactors qchart , adds line animation...
r131 #include <QRectF>
Michal Klocek
Implements minimumMargins...
r1883 #include <QMargins>
Miikka Heikkinen
Added QChart::localizeNumbers...
r2707 #include <QLocale>
Michal Klocek
Refactors qchart , adds line animation...
r131
QTCOMMERCIALCHART_BEGIN_NAMESPACE
Michal Klocek
Refactors internals...
r2273 class ChartItem;
class AxisItem;
Tero Ahola
Renamed QSeries to QAbstractSeries
r988 class QAbstractSeries;
Michal Klocek
Refactors qchart , adds line animation...
r131 class ChartDataSet;
Marek Rosa
Domains added
r2275 class AbstractDomain;
Miikka Heikkinen
Add Polar chart support...
r2483 class ChartAxisElement;
Michal Klocek
Animation refactor...
r530 class ChartAnimator;
Michal Klocek
Changes QChartAxis -> QAxis
r1006 class ChartBackground;
Michal Klocek
Refactors layout...
r1965 class ChartTitle;
Michal Klocek
Refactors axis animation, line animations
r1241 class ChartAnimation;
Miikka Heikkinen
Add Polar chart support...
r2483 class AbstractChartLayout;
Michal Klocek
Refactors qchart , adds line animation...
r131
class ChartPresenter: public QObject
{
Q_OBJECT
public:
Tero Ahola
Fixed drawing issues in Scatter
r375 enum ZValues {
BackgroundZValue = -1,
Miikka Heikkinen
Add API to specify plot area background....
r2498 PlotAreaZValue,
ShadesZValue,
Tero Ahola
Fixed drawing issues in Scatter
r375 GridZValue,
Tero Ahola
Switched the z-order of axis to be below series...
r1790 AxisZValue,
Tero Ahola
All the series to use the same z-plane
r1260 SeriesZValue,
LineChartZValue = SeriesZValue,
Michal Klocek
Fixes mouse handling in base class of chartseries
r1747 SplineChartZValue = SeriesZValue,
Tero Ahola
All the series to use the same z-plane
r1260 BarSeriesZValue = SeriesZValue,
ScatterSeriesZValue = SeriesZValue,
PieSeriesZValue = SeriesZValue,
Mika Salmela
A new box-and-whiskers series type added to charts....
r2548 BoxPlotSeriesZValue = SeriesZValue,
Michal Klocek
Fixes mouse handling in base class of chartseries
r1747 LegendZValue,
TopMostZValue
Tero Ahola
Fixed drawing issues in Scatter
r375 };
Tero Ahola
All the series to use the same z-plane
r1260
enum State {
ShowState,
Michal Klocek
Refactors axis animation, line animations
r1241 ScrollUpState,
ScrollDownState,
ScrollLeftState,
ScrollRightState,
ZoomInState,
ZoomOutState
};
Michal Klocek
Adds ZOrder enum to presenter
r262
Miikka Heikkinen
Add Polar chart support...
r2483 ChartPresenter(QChart *chart, QChart::ChartType type);
Michal Klocek
Refactors qchart , adds line animation...
r131 virtual ~ChartPresenter();
Michal Klocek
Refactored for MVP...
r139
Michal Klocek
Refactors internals...
r2273
void setGeometry(QRectF rect);
QRectF geometry() const;
QGraphicsItem *rootItem(){ return m_chart; }
Jani Honkonen
src folder: another massive victory for coding style police
r2131 ChartBackground *backgroundElement();
Miikka Heikkinen
Add API to specify plot area background....
r2498 QAbstractGraphicsShapeItem *plotAreaElement();
Jani Honkonen
src folder: another massive victory for coding style police
r2131 ChartTitle *titleElement();
Miikka Heikkinen
Add Polar chart support...
r2483 QList<ChartAxisElement *> axisItems() const;
Michal Klocek
Refactors internals...
r2273 QList<ChartItem *> chartItems() const;
Jani Honkonen
src folder: another massive victory for coding style police
r2131 QLegend *legend();
Michal Klocek
Refactors layout managment...
r1534
Jani Honkonen
src folder: another massive victory for coding style police
r2131 void setBackgroundBrush(const QBrush &brush);
Michal Klocek
Refactors layout managment...
r1534 QBrush backgroundBrush() const;
Jani Honkonen
src folder: another massive victory for coding style police
r2131 void setBackgroundPen(const QPen &pen);
Michal Klocek
Refactors layout managment...
r1534 QPen backgroundPen() const;
Miikka Heikkinen
Added API to set chart background roundness...
r2549 void setBackgroundRoundness(qreal diameter);
qreal backgroundRoundness() const;
Miikka Heikkinen
Add API to specify plot area background....
r2498 void setPlotAreaBackgroundBrush(const QBrush &brush);
QBrush plotAreaBackgroundBrush() const;
void setPlotAreaBackgroundPen(const QPen &pen);
QPen plotAreaBackgroundPen() const;
Jani Honkonen
src folder: another massive victory for coding style police
r2131 void setTitle(const QString &title);
Michal Klocek
Refactors layout managment...
r1534 QString title() const;
Jani Honkonen
src folder: another massive victory for coding style police
r2131 void setTitleFont(const QFont &font);
Michal Klocek
Refactors layout managment...
r1534 QFont titleFont() const;
void setTitleBrush(const QBrush &brush);
QBrush titleBrush() const;
void setBackgroundVisible(bool visible);
bool isBackgroundVisible() const;
Miikka Heikkinen
Add API to specify plot area background....
r2498 void setPlotAreaBackgroundVisible(bool visible);
bool isPlotAreaBackgroundVisible() const;
Michal Klocek
Refactors layout managment...
r1534 void setBackgroundDropShadowEnabled(bool enabled);
bool isBackgroundDropShadowEnabled() const;
Miikka Heikkinen
Added QChart::localizeNumbers...
r2707 void setLocalizeNumbers(bool localize);
Miikka Heikkinen
Added QChart::locale property...
r2708 inline bool localizeNumbers() const { return m_localizeNumbers; }
void setLocale(const QLocale &locale);
inline const QLocale &locale() const { return m_locale; }
Miikka Heikkinen
Added QChart::localizeNumbers...
r2707
Michal Klocek
Refactors layout managment...
r1534 void setVisible(bool visible);
Michal Klocek
Refactors qchart , adds line animation...
r131
Michal Klocek
Adds animation settings handling
r298 void setAnimationOptions(QChart::AnimationOptions options);
QChart::AnimationOptions animationOptions() const;
Jani Honkonen
src folder: another massive victory for coding style police
r2131 void startAnimation(ChartAnimation *animation);
Michal Klocek
Refactors internals...
r2273
void setState(State state,QPointF point);
Michal Klocek
Refactors axis animation, line animations
r1241 State state() const { return m_state; }
QPointF statePoint() const { return m_statePoint; }
Miikka Heikkinen
Add Polar chart support...
r2483 AbstractChartLayout *layout();
QChart::ChartType chartType() const { return m_chart->chartType(); }
Miikka Heikkinen
Add API to specify plot area background....
r2498 QChart *chart() { return m_chart; }
Michal Klocek
Refactors layout managment...
r1534
Miikka Heikkinen
Added HTML support for various text items...
r2539 static QRectF textBoundingRect(const QFont &font, const QString &text, qreal angle = 0.0);
Titta Heikkala
Fix long labels visibility for QBarChart...
r2604 static QString truncatedText(const QFont &font, const QString &text, qreal angle,
qreal maxWidth, qreal maxHeight, QRectF &boundingRect);
Miikka Heikkinen
Fix text item margins...
r2592 inline static qreal textMargin() { return qreal(0.5); }
Miikka Heikkinen
Added QChart::localizeNumbers...
r2707
QString numberToString(double value, char f = 'g', int prec = 6);
Michal Klocek
Refactors layout managment...
r1534 private:
void createBackgroundItem();
Miikka Heikkinen
Add API to specify plot area background....
r2498 void createPlotAreaBackgroundItem();
Michal Klocek
Refactors layout managment...
r1534 void createTitleItem();
Michal Klocek
Refactors qchart , adds line animation...
r131
sauimone
Q_SIGNALS and Q_SLOTS
r775 public Q_SLOTS:
Michal Klocek
Refactors internals...
r2273 void handleSeriesAdded(QAbstractSeries *series);
Jani Honkonen
src folder: another massive victory for coding style police
r2131 void handleSeriesRemoved(QAbstractSeries *series);
Michal Klocek
Refactors internals...
r2273 void handleAxisAdded(QAbstractAxis *axis);
Jani Honkonen
src folder: another massive victory for coding style police
r2131 void handleAxisRemoved(QAbstractAxis *axis);
Michal Klocek
Refactor domain model...
r439
Michal Klocek
Refactors qchart , adds line animation...
r131 private:
Jani Honkonen
src folder: another massive victory for coding style police
r2131 QChart *m_chart;
Michal Klocek
Refactors internals...
r2273 QList<ChartItem *> m_chartItems;
Miikka Heikkinen
Add Polar chart support...
r2483 QList<ChartAxisElement *> m_axisItems;
Michal Klocek
Refactors internals...
r2273 QList<QAbstractSeries *> m_series;
QList<QAbstractAxis *> m_axes;
Michal Klocek
Adds animation settings handling
r298 QChart::AnimationOptions m_options;
Michal Klocek
Refactors axis animation, line animations
r1241 State m_state;
QPointF m_statePoint;
Miikka Heikkinen
Add Polar chart support...
r2483 AbstractChartLayout *m_layout;
Jani Honkonen
src folder: another massive victory for coding style police
r2131 ChartBackground *m_background;
Miikka Heikkinen
Add API to specify plot area background....
r2498 QAbstractGraphicsShapeItem *m_plotAreaBackground;
Jani Honkonen
src folder: another massive victory for coding style police
r2131 ChartTitle *m_title;
Michal Klocek
Refactors internals...
r2273 QRectF m_rect;
Miikka Heikkinen
Added QChart::localizeNumbers...
r2707 bool m_localizeNumbers;
QLocale m_locale;
Michal Klocek
Refactors qchart , adds line animation...
r131 };
QTCOMMERCIALCHART_END_NAMESPACE
Jani Honkonen
Fix Krazy issues
r1935 #endif /* CHARTPRESENTER_H */