##// END OF EJS Templates
Fix QNX build issue...
Fix QNX build issue Use qmath and cmath methods instead of math.h methods. Change-Id: I7c853f2e1218a1d3cde15a089192c24a6b0b1395 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@theqtcompany.com>

File last commit:

r2740:377e4516d036
r2775:143be951b1fe
Show More
qpieslice.h
148 lines | 4.6 KiB | text/x-c | CLexer
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.
Titta Heikkala
Updated license headers...
r2740 ** For any questions to Digia, please use contact form at http://qt.io
Jani Honkonen
Add license headers
r794 **
Titta Heikkala
Updated license headers...
r2740 ** This file is part of the Qt Charts module.
Jani Honkonen
Add license headers
r794 **
Titta Heikkala
Updated license headers...
r2740 ** Licensees holding valid commercial license for Qt may use this file in
** accordance with the Qt License Agreement provided with the Software
** or, alternatively, in accordance with the terms contained in a written
** agreement between you and Digia.
Jani Honkonen
Add license headers
r794 **
** If you have questions regarding the use of this file, please use
Titta Heikkala
Updated license headers...
r2740 ** contact form at http://qt.io
Jani Honkonen
Add license headers
r794 **
****************************************************************************/
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 #ifndef QPIESLICE_H
#define QPIESLICE_H
Titta Heikkala
Fix include syntax...
r2714 #include <QtCharts/QChartGlobal>
#include <QtCore/QObject>
#include <QtGui/QPen>
#include <QtGui/QBrush>
#include <QtGui/QFont>
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203
Titta Heikkala
Qt Charts project file structure change...
r2712 QT_CHARTS_BEGIN_NAMESPACE
Jani Honkonen
pie: added everything as a property in QPieSlice...
r1274 class QPieSlicePrivate;
Jani Honkonen
Add QPieSlice::series() and tests
r1323 class QPieSeries;
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203
Titta Heikkala
Qt Charts project file structure change...
r2712 class QT_CHARTS_EXPORT QPieSlice : public QObject
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 {
Q_OBJECT
Jani Honkonen
pie: add label position to slice
r1450 Q_ENUMS(LabelPosition)
Jani Honkonen
pie: remove changed() signal and replace it with more refined signals...
r1224 Q_PROPERTY(QString label READ label WRITE setLabel NOTIFY labelChanged)
Q_PROPERTY(qreal value READ value WRITE setValue NOTIFY valueChanged)
Jani Honkonen
pie: added everything as a property in QPieSlice...
r1274 Q_PROPERTY(bool labelVisible READ isLabelVisible WRITE setLabelVisible NOTIFY labelVisibleChanged)
Tero Ahola
Removed unnecessary signals from QPieSlice
r1494 Q_PROPERTY(LabelPosition labelPosition READ labelPosition WRITE setLabelPosition)
Q_PROPERTY(bool exploded READ isExploded WRITE setExploded)
Jani Honkonen
pie: added everything as a property in QPieSlice...
r1274 Q_PROPERTY(QPen pen READ pen WRITE setPen NOTIFY penChanged)
Jani Honkonen
Fix issues with pen/brush convenience properties and update docs
r1338 Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor NOTIFY borderColorChanged)
Q_PROPERTY(int borderWidth READ borderWidth WRITE setBorderWidth NOTIFY borderWidthChanged)
Jani Honkonen
pie: added everything as a property in QPieSlice...
r1274 Q_PROPERTY(QBrush brush READ brush WRITE setBrush NOTIFY brushChanged)
Jani Honkonen
Fix issues with pen/brush convenience properties and update docs
r1338 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
Tero Ahola
Use labelBrush instead of labelPen for text labels
r1307 Q_PROPERTY(QBrush labelBrush READ labelBrush WRITE setLabelBrush NOTIFY labelBrushChanged)
Jani Honkonen
Fix issues with pen/brush convenience properties and update docs
r1338 Q_PROPERTY(QColor labelColor READ labelColor WRITE setLabelColor NOTIFY labelColorChanged)
Jani Honkonen
pie: added everything as a property in QPieSlice...
r1274 Q_PROPERTY(QFont labelFont READ labelFont WRITE setLabelFont NOTIFY labelFontChanged)
Tero Ahola
Removed unnecessary signals from QPieSlice
r1494 Q_PROPERTY(qreal labelArmLengthFactor READ labelArmLengthFactor WRITE setLabelArmLengthFactor)
Q_PROPERTY(qreal explodeDistanceFactor READ explodeDistanceFactor WRITE setExplodeDistanceFactor)
Jani Honkonen
pie: added everything as a property in QPieSlice...
r1274 Q_PROPERTY(qreal percentage READ percentage NOTIFY percentageChanged)
Q_PROPERTY(qreal startAngle READ startAngle NOTIFY startAngleChanged)
Q_PROPERTY(qreal angleSpan READ angleSpan NOTIFY angleSpanChanged)
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203
Jani Honkonen
pie: add label position to slice
r1450 public:
enum LabelPosition {
LabelOutside,
Jani Honkonen
QPieSlice::LabelInside -> LabelInsideHorizontal
r1759 LabelInsideHorizontal,
Tero Ahola
Removed some carbage from pie series public APIs
r2044 LabelInsideTangential,
LabelInsideNormal
Jani Honkonen
pie: add label position to slice
r1450 };
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 public:
Michal Klocek
Fixes explicit issues in cstr
r970 explicit QPieSlice(QObject *parent = 0);
Jani Honkonen
pie: change the order of parameters when creating slices to be more intuitive
r1206 QPieSlice(QString label, qreal value, QObject *parent = 0);
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 virtual ~QPieSlice();
Jani Honkonen
Added a pie chart customization example and refactoring the pie interface.
r437 void setLabel(QString label);
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 QString label() const;
Jani Honkonen
pie: remove changed() signal and replace it with more refined signals...
r1224
void setValue(qreal value);
qreal value() const;
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203
Jani Honkonen
pie: added everything as a property in QPieSlice...
r1274 void setLabelVisible(bool visible = true);
bool isLabelVisible() const;
Jani Honkonen
pie: add label position to slice
r1450 LabelPosition labelPosition();
void setLabelPosition(LabelPosition position);
Jani Honkonen
pie: added everything as a property in QPieSlice...
r1274 void setExploded(bool exploded = true);
bool isExploded() const;
Jani Honkonen
remove "slice" word from pen/brush setters/getters
r756 void setPen(const QPen &pen);
QPen pen() const;
Jani Honkonen
pie: remove changed() signal and replace it with more refined signals...
r1224
Jani Honkonen
Fix issues with pen/brush convenience properties and update docs
r1338 QColor borderColor();
void setBorderColor(QColor color);
int borderWidth();
void setBorderWidth(int width);
Jani Honkonen
remove "slice" word from pen/brush setters/getters
r756 void setBrush(const QBrush &brush);
QBrush brush() const;
Jani Honkonen
pie: remove changed() signal and replace it with more refined signals...
r1224
Jani Honkonen
Fix issues with pen/brush convenience properties and update docs
r1338 QColor color();
void setColor(QColor color);
Tero Ahola
Use labelBrush instead of labelPen for text labels
r1307 void setLabelBrush(const QBrush &brush);
QBrush labelBrush() const;
Jani Honkonen
pie: remove changed() signal and replace it with more refined signals...
r1224
Jani Honkonen
Fix issues with pen/brush convenience properties and update docs
r1338 QColor labelColor();
void setLabelColor(QColor color);
Jani Honkonen
Renaming pen & brush functions for pie and adding const
r469 void setLabelFont(const QFont &font);
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 QFont labelFont() const;
Jani Honkonen
API review changes for pie
r1009
Jani Honkonen
pie: added everything as a property in QPieSlice...
r1274 void setLabelArmLengthFactor(qreal factor);
qreal labelArmLengthFactor() const;
Jani Honkonen
pie: remove changed() signal and replace it with more refined signals...
r1224
Jani Honkonen
Add animations to pie. Works but has some visual issues when adding slices.
r618 void setExplodeDistanceFactor(qreal factor);
qreal explodeDistanceFactor() const;
Jani Honkonen
Added a pie chart customization example and refactoring the pie interface.
r437
Jani Honkonen
API review changes for pie
r1009 qreal percentage() const;
qreal startAngle() const;
Jani Honkonen
pie: added everything as a property in QPieSlice...
r1274 qreal angleSpan() const;
Jani Honkonen
API review changes for pie
r1009
Jani Honkonen
Add QPieSlice::series() and tests
r1323 QPieSeries *series() const;
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 Q_SIGNALS:
Tero Ahola
Removed unnecessary signals from QPieSlice
r1494 void clicked();
void hovered(bool state);
Titta Heikkala
Add pressed, released and doubleClicked signals...
r2739 void pressed();
void released();
void doubleClicked();
Jani Honkonen
pie: remove changed() signal and replace it with more refined signals...
r1224 void labelChanged();
void valueChanged();
Jani Honkonen
pie: added everything as a property in QPieSlice...
r1274 void labelVisibleChanged();
void penChanged();
void brushChanged();
Tero Ahola
Use labelBrush instead of labelPen for text labels
r1307 void labelBrushChanged();
Jani Honkonen
pie: added everything as a property in QPieSlice...
r1274 void labelFontChanged();
void percentageChanged();
void startAngleChanged();
void angleSpanChanged();
Tero Ahola
Removed DeclarativePieSlice; properties in QPieSlice now
r1329 void colorChanged();
void borderColorChanged();
void borderWidthChanged();
void labelColorChanged();
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203
private:
Jani Honkonen
pie: added everything as a property in QPieSlice...
r1274 QPieSlicePrivate * const d_ptr;
Q_DECLARE_PRIVATE(QPieSlice)
Jani Honkonen
Adding PIMPL to pie
r669 Q_DISABLE_COPY(QPieSlice)
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 };
Titta Heikkala
Qt Charts project file structure change...
r2712 QT_CHARTS_END_NAMESPACE
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203
#endif // QPIESLICE_H