##// END OF EJS Templates
Added test app for testing QML properties
Added test app for testing QML properties

File last commit:

r1280:dde538c774a3
r1298:9b6f70236860
Show More
qpieslice.cpp
536 lines | 11.1 KiB | text/x-c | CppLexer
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$
**
****************************************************************************/
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 #include "qpieslice.h"
Jani Honkonen
pie: added everything as a property in QPieSlice...
r1274 #include "qpieslice_p.h"
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203
QTCOMMERCIALCHART_BEGIN_NAMESPACE
Jani Honkonen
Add documentation to pie
r314 /*!
\class QPieSlice
Jani Honkonen
Typo fix for slice doc
r339 \brief Defines a slice in pie series.
Jani Honkonen
Add documentation to pie
r314
Jani Honkonen
Pie doc updates
r952 This object defines the properties of a single slice in a QPieSeries.
Jani Honkonen
More documentation for pie
r320
Jani Honkonen
Pie doc updates
r952 In addition to the obvious value and label properties the user can also control
the visual appearance of a slice. By modifying the visual appearance also means that
Jani Honkonen
pieslice: update docs
r1277 the user is overriding the default appearance set by the theme.
Jani Honkonen
Pie doc updates
r952
Jani Honkonen
pieslice: update docs
r1277 Note that if the user has customized slices and theme is changed all customizations will be lost.
To enable user interaction with the pie some basic signals are provided about clicking and hovering.
Jani Honkonen
Add documentation to pie
r314 */
/*!
\property QPieSlice::label
Label of the slice.
Jani Honkonen
pieslice: update docs
r1277
\sa labelVisible, labelPen, labelFont, labelArmLengthFactor
*/
/*!
\fn void QPieSlice::labelChanged()
This signal emitted when the slice label has been changed.
\sa label
Jani Honkonen
Add documentation to pie
r314 */
/*!
\property QPieSlice::value
Value of the slice.
Jani Honkonen
Pie doc updates
r952
Jani Honkonen
pie: make it impossible to add negative slice values
r1280 Note that if users sets a negative value it is converted to a positive value.
Jani Honkonen
Pie doc updates
r952 \sa percentage(), QPieSeries::sum()
Jani Honkonen
Add documentation to pie
r314 */
/*!
Jani Honkonen
pieslice: update docs
r1277 \fn void QPieSlice::valueChanged()
Jani Honkonen
More documentation for pie
r320
Jani Honkonen
pieslice: update docs
r1277 This signal is emitted when the slice value changes.
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203
Jani Honkonen
pieslice: update docs
r1277 \sa value
*/
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203
Jani Honkonen
Add documentation to pie
r314 /*!
Jani Honkonen
pieslice: update docs
r1277 \property QPieSlice::labelVisible
Defienes the visibility of the slice label.
Default is not visible.
\sa label, labelPen, labelFont, labelArmLengthFactor
Jani Honkonen
Add documentation to pie
r314 */
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203
Jani Honkonen
Add documentation to pie
r314 /*!
Jani Honkonen
pieslice: update docs
r1277 \fn void QPieSlice::labelVisibleChanged()
Jani Honkonen
pie: added everything as a property in QPieSlice...
r1274
Jani Honkonen
pieslice: update docs
r1277 This signal emitted when visibility of the slice label has changed.
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203
Jani Honkonen
pieslice: update docs
r1277 \sa labelVisible
Jani Honkonen
Add documentation to pie
r314 */
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203
Jani Honkonen
Add documentation to pie
r314 /*!
Jani Honkonen
pieslice: update docs
r1277 \property QPieSlice::exploded
Defines if the slice is exploded from the pie.
\sa explodeDistanceFactor
Jani Honkonen
Add documentation to pie
r314 */
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203
Jani Honkonen
Add documentation to pie
r314 /*!
Jani Honkonen
pieslice: update docs
r1277 \fn void QPieSlice::explodedChanged()
This signal is emitted the the slice has been exploded from the pie or is returned back to the pie.
\sa exploded
Jani Honkonen
Add documentation to pie
r314 */
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203
Jani Honkonen
Add documentation to pie
r314 /*!
Jani Honkonen
pieslice: update docs
r1277 \property QPieSlice::pen
Pen used to draw the slice border.
Jani Honkonen
Add documentation to pie
r314 */
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203
Jani Honkonen
Add documentation to pie
r314 /*!
Jani Honkonen
pieslice: update docs
r1277 \fn void QPieSlice::penChanged()
Jani Honkonen
Introducing vertical and horizontal factors to control the position of the pie.
r454
Jani Honkonen
pieslice: update docs
r1277 This signal is emitted when the pen of the slice has changed.
\sa pen
*/
Jani Honkonen
Introducing vertical and horizontal factors to control the position of the pie.
r454
Jani Honkonen
pieslice: update docs
r1277 /*!
\property QPieSlice::brush
Jani Honkonen
Introducing vertical and horizontal factors to control the position of the pie.
r454
Jani Honkonen
pieslice: update docs
r1277 Brush used to draw the slice.
Jani Honkonen
Add documentation to pie
r314 */
Jani Honkonen
Make pie fit better inside its given rectangle. Label texts still go outside. Needs a bit more work...
r289
Jani Honkonen
Add documentation to pie
r314 /*!
Jani Honkonen
pieslice: update docs
r1277 \fn void QPieSlice::brushChanged()
Jani Honkonen
More documentation for pie
r320
Jani Honkonen
pieslice: update docs
r1277 This signal is emitted when the brush of the slice has changed.
Jani Honkonen
Pie doc updates
r952
Jani Honkonen
pieslice: update docs
r1277 \sa brush
Jani Honkonen
Add documentation to pie
r314 */
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203
Jani Honkonen
Add documentation to pie
r314 /*!
Jani Honkonen
pieslice: update docs
r1277 \property QPieSlice::labelPen
Jani Honkonen
More documentation for pie
r320
Jani Honkonen
pieslice: update docs
r1277 Pen used to draw label and label arm of the slice.
Jani Honkonen
More documentation for pie
r320
Jani Honkonen
pieslice: update docs
r1277 \sa label, labelVisible, labelFont, labelArmLengthFactor
Jani Honkonen
Add documentation to pie
r314 */
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203
Jani Honkonen
Add documentation to pie
r314 /*!
Jani Honkonen
pieslice: update docs
r1277 \fn void QPieSlice::labelPenChanged()
Jani Honkonen
More documentation for pie
r320
Jani Honkonen
pieslice: update docs
r1277 This signal is emitted when the label pen of the slice has changed.
Jani Honkonen
More documentation for pie
r320
Jani Honkonen
pieslice: update docs
r1277 \sa labelPen
Jani Honkonen
Add documentation to pie
r314 */
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203
Jani Honkonen
Add documentation to pie
r314 /*!
Jani Honkonen
pieslice: update docs
r1277 \property QPieSlice::labelFont
Font used for drawing label text.
\sa label, labelVisible, labelArmLengthFactor
Jani Honkonen
Add documentation to pie
r314 */
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203
Jani Honkonen
Add documentation to pie
r314 /*!
Jani Honkonen
pieslice: update docs
r1277 \fn void QPieSlice::labelFontChanged()
This signal is emitted when the label font of the slice has changed.
\sa labelFont
Jani Honkonen
Add documentation to pie
r314 */
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203
Jani Honkonen
Add documentation to pie
r314 /*!
Jani Honkonen
pieslice: update docs
r1277 \property QPieSlice::labelArmLengthFactor
Defines the length of the label arm.
The factor is relative to pie radius. For example:
1.0 means the length is the same as the radius.
0.5 means the length is half of the radius.
Default value is 0.15
\sa label, labelVisible, labelPen, labelFont
Jani Honkonen
Add documentation to pie
r314 */
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203
Jani Honkonen
Add documentation to pie
r314 /*!
Jani Honkonen
pieslice: update docs
r1277 \fn void QPieSlice::labelArmLengthFactorChanged()
This signal is emitted when the label arm factor of the slice has changed.
\sa labelArmLengthFactor
Jani Honkonen
Add documentation to pie
r314 */
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203
Jani Honkonen
Add documentation to pie
r314 /*!
Jani Honkonen
pieslice: update docs
r1277 \property QPieSlice::explodeDistanceFactor
When the slice is exploded this factor defines how far the slice is exploded away from the pie.
Jani Honkonen
Introducing vertical and horizontal factors to control the position of the pie.
r454
The factor is relative to pie radius. For example:
Jani Honkonen
pieslice: update docs
r1277 1.0 means the distance is the same as the radius.
0.5 means the distance is half of the radius.
Jani Honkonen
Introducing vertical and horizontal factors to control the position of the pie.
r454
Default value is 0.15
Jani Honkonen
pieslice: update docs
r1277 \sa exploded
Jani Honkonen
Add documentation to pie
r314 */
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203
Jani Honkonen
pie: remove changed() signal and replace it with more refined signals...
r1224 /*!
Jani Honkonen
pieslice: update docs
r1277 \fn void QPieSlice::explodeDistanceFactorChanged()
Jani Honkonen
pie: remove changed() signal and replace it with more refined signals...
r1224
Jani Honkonen
pieslice: update docs
r1277 This signal is emitted when the explode distance factor of the slice has changed.
Jani Honkonen
pie: remove changed() signal and replace it with more refined signals...
r1224
Jani Honkonen
pieslice: update docs
r1277 \sa explodeDistanceFactor
Jani Honkonen
pie: remove changed() signal and replace it with more refined signals...
r1224 */
/*!
Jani Honkonen
pieslice: update docs
r1277 \property QPieSlice::percentage
Jani Honkonen
pie: remove changed() signal and replace it with more refined signals...
r1224
Jani Honkonen
pieslice: update docs
r1277 Percentage of the slice compared to the sum of all slices in the series.
The actual value ranges from 0.0 to 1.0.
Updated automatically once the slice is added to the series.
\sa value, QPieSeries::sum
*/
/*!
\fn void QPieSlice::percentageChanged()
This signal is emitted when the percentage of the slice has changed.
\sa percentage
*/
/*!
\property QPieSlice::startAngle
Defines the starting angle of this slice in the series it belongs to.
Jani Honkonen
pie: remove changed() signal and replace it with more refined signals...
r1224
Jani Honkonen
pieslice: update docs
r1277 Full pie is 360 degrees where 0 degrees is at 12 a'clock.
Updated automatically once the slice is added to the series.
Jani Honkonen
pie: remove changed() signal and replace it with more refined signals...
r1224 */
/*!
Jani Honkonen
pieslice: update docs
r1277 \fn void QPieSlice::startAngleChanged()
This signal is emitted when the starting angle f the slice has changed.
\sa startAngle
*/
Jani Honkonen
pie: remove changed() signal and replace it with more refined signals...
r1224
Jani Honkonen
pieslice: update docs
r1277 /*!
\property QPieSlice::angleSpan
Span of the slice in degrees.
Full pie is 360 degrees where 0 degrees is at 12 a'clock.
Jani Honkonen
pie: remove changed() signal and replace it with more refined signals...
r1224
Jani Honkonen
pieslice: update docs
r1277 Updated automatically once the slice is added to the series.
Jani Honkonen
pie: remove changed() signal and replace it with more refined signals...
r1224 */
/*!
Jani Honkonen
pieslice: update docs
r1277 \fn void QPieSlice::angleSpanChanged()
Jani Honkonen
pie: remove changed() signal and replace it with more refined signals...
r1224
Jani Honkonen
pieslice: update docs
r1277 This signal is emitted when the angle span of the slice has changed.
Jani Honkonen
pie: remove changed() signal and replace it with more refined signals...
r1224
Jani Honkonen
pieslice: update docs
r1277 \sa angleSpan
Jani Honkonen
pie: remove changed() signal and replace it with more refined signals...
r1224 */
Jani Honkonen
pieslice: update docs
r1277
Jani Honkonen
Add documentation to pie
r314 /*!
Jani Honkonen
API review changes for pie
r1009 \fn void QPieSlice::clicked()
Jani Honkonen
Add documentation to pie
r314
This signal is emitted when user has clicked the slice.
\sa QPieSeries::clicked()
*/
/*!
Jani Honkonen
API review changes for pie
r1009 \fn void QPieSlice::hovered(bool state)
Jani Honkonen
Add documentation to pie
r314
Jani Honkonen
API review changes for pie
r1009 This signal is emitted when user has hovered over or away from the slice.
Jani Honkonen
Add documentation to pie
r314
Jani Honkonen
API review changes for pie
r1009 \a state is true when user has hovered over the slice and false when hover has moved away from the slice.
Jani Honkonen
Add documentation to pie
r314
Jani Honkonen
API review changes for pie
r1009 \sa QPieSeries::hovered()
Jani Honkonen
Add documentation to pie
r314 */
/*!
Jani Honkonen
pieslice: update docs
r1277 Constructs an empty slice with a \a parent.
\sa QPieSeries::append(), QPieSeries::insert()
Jani Honkonen
Add documentation to pie
r314 */
Jani Honkonen
pieslice: update docs
r1277 QPieSlice::QPieSlice(QObject *parent)
:QObject(parent),
d_ptr(new QPieSlicePrivate(this))
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 {
Jani Honkonen
pieslice: update docs
r1277
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 }
Jani Honkonen
Add documentation to pie
r314 /*!
Jani Honkonen
pieslice: update docs
r1277 Constructs an empty slice with given \a value, \a label and a \a parent.
\sa QPieSeries::append(), QPieSeries::insert()
Jani Honkonen
Add documentation to pie
r314 */
Jani Honkonen
pieslice: update docs
r1277 QPieSlice::QPieSlice(QString label, qreal value, QObject *parent)
:QObject(parent),
d_ptr(new QPieSlicePrivate(this))
{
Jani Honkonen
pie: make it impossible to add negative slice values
r1280 setValue(value);
setLabel(label);
Jani Honkonen
pieslice: update docs
r1277 }
/*!
Destroys the slice.
User should not delete the slice if it has been added to the series.
*/
QPieSlice::~QPieSlice()
{
}
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 void QPieSlice::setLabel(QString label)
{
Jani Honkonen
pie: added everything as a property in QPieSlice...
r1274 if (d_ptr->m_data.m_labelText != label) {
d_ptr->m_data.m_labelText = label;
Jani Honkonen
pie: remove changed() signal and replace it with more refined signals...
r1224 emit labelChanged();
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 }
}
Jani Honkonen
pieslice: update docs
r1277 QString QPieSlice::label() const
{
return d_ptr->m_data.m_labelText;
}
void QPieSlice::setValue(qreal value)
{
Jani Honkonen
pie: make it impossible to add negative slice values
r1280 value = qAbs(value); // negative values not allowed
Jani Honkonen
pieslice: update docs
r1277 if (!qFuzzyIsNull(d_ptr->m_data.m_value - value)) {
d_ptr->m_data.m_value = value;
emit valueChanged();
}
}
qreal QPieSlice::value() const
{
return d_ptr->m_data.m_value;
}
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 void QPieSlice::setLabelVisible(bool visible)
{
Jani Honkonen
pie: added everything as a property in QPieSlice...
r1274 if (d_ptr->m_data.m_isLabelVisible != visible) {
d_ptr->m_data.m_isLabelVisible = visible;
emit labelVisibleChanged();
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 }
}
Jani Honkonen
pieslice: update docs
r1277 bool QPieSlice::isLabelVisible() const
{
return d_ptr->m_data.m_isLabelVisible;
}
Jani Honkonen
Pie doc updates
r952
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 void QPieSlice::setExploded(bool exploded)
{
Jani Honkonen
pie: added everything as a property in QPieSlice...
r1274 if (d_ptr->m_data.m_isExploded != exploded) {
d_ptr->m_data.m_isExploded = exploded;
emit explodedChanged();
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 }
}
Jani Honkonen
pieslice: update docs
r1277 bool QPieSlice::isExploded() const
Jani Honkonen
Make pie fit better inside its given rectangle. Label texts still go outside. Needs a bit more work...
r289 {
Jani Honkonen
pieslice: update docs
r1277 return d_ptr->m_data.m_isExploded;
Jani Honkonen
Make pie fit better inside its given rectangle. Label texts still go outside. Needs a bit more work...
r289 }
Jani Honkonen
remove "slice" word from pen/brush setters/getters
r756 void QPieSlice::setPen(const QPen &pen)
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 d_ptr->setPen(pen, false);
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 }
Jani Honkonen
pieslice: update docs
r1277 QPen QPieSlice::pen() const
{
return d_ptr->m_data.m_slicePen;
}
Jani Honkonen
Pie doc updates
r952
Jani Honkonen
remove "slice" word from pen/brush setters/getters
r756 void QPieSlice::setBrush(const QBrush &brush)
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 d_ptr->setBrush(brush, false);
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 }
Jani Honkonen
pieslice: update docs
r1277 QBrush QPieSlice::brush() const
{
return d_ptr->m_data.m_sliceBrush;
}
Jani Honkonen
Pie doc updates
r952
Jani Honkonen
Get pie slice label font and pen from theme
r714 void QPieSlice::setLabelPen(const QPen &pen)
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 d_ptr->setLabelPen(pen, false);
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 }
Jani Honkonen
pieslice: update docs
r1277 QPen QPieSlice::labelPen() const
{
return d_ptr->m_data.m_labelPen;
}
Jani Honkonen
Pie doc updates
r952
Jani Honkonen
Renaming pen & brush functions for pie and adding const
r469 void QPieSlice::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 {
Jani Honkonen
pie: added everything as a property in QPieSlice...
r1274 d_ptr->setLabelFont(font, false);
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 }
Jani Honkonen
pieslice: update docs
r1277 QFont QPieSlice::labelFont() const
{
return d_ptr->m_data.m_labelFont;
}
Jani Honkonen
Introducing vertical and horizontal factors to control the position of the pie.
r454
void QPieSlice::setLabelArmLengthFactor(qreal factor)
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 if (!qFuzzyIsNull(d_ptr->m_data.m_labelArmLengthFactor - factor)) {
d_ptr->m_data.m_labelArmLengthFactor = factor;
emit labelArmLengthFactorChanged();
}
}
Jani Honkonen
pieslice: update docs
r1277 qreal QPieSlice::labelArmLengthFactor() const
{
return d_ptr->m_data.m_labelArmLengthFactor;
}
void QPieSlice::setExplodeDistanceFactor(qreal factor)
{
if (!qFuzzyIsNull(d_ptr->m_data.m_explodeDistanceFactor - factor)) {
d_ptr->m_data.m_explodeDistanceFactor = factor;
emit explodeDistanceFactorChanged();
}
}
qreal QPieSlice::explodeDistanceFactor() const
{
return d_ptr->m_data.m_explodeDistanceFactor;
}
qreal QPieSlice::percentage() const
{
return d_ptr->m_data.m_percentage;
}
qreal QPieSlice::startAngle() const
{
return d_ptr->m_data.m_startAngle;
}
qreal QPieSlice::angleSpan() const
{
return d_ptr->m_data.m_angleSpan;
}
Jani Honkonen
pie: added everything as a property in QPieSlice...
r1274 QPieSlicePrivate::QPieSlicePrivate(QPieSlice *parent)
:QObject(parent),
q_ptr(parent)
{
}
QPieSlicePrivate::~QPieSlicePrivate()
{
}
QPieSlicePrivate *QPieSlicePrivate::fromSlice(QPieSlice *slice)
{
return slice->d_func();
}
void QPieSlicePrivate::setPen(const QPen &pen, bool themed)
{
if (m_data.m_slicePen != pen) {
m_data.m_slicePen = pen;
m_data.m_slicePen.setThemed(themed);
emit q_ptr->penChanged();
}
}
void QPieSlicePrivate::setBrush(const QBrush &brush, bool themed)
{
if (m_data.m_sliceBrush != brush) {
m_data.m_sliceBrush = brush;
m_data.m_sliceBrush.setThemed(themed);
emit q_ptr->brushChanged();
}
}
void QPieSlicePrivate::setLabelPen(const QPen &pen, bool themed)
{
if (m_data.m_labelPen != pen) {
m_data.m_labelPen = pen;
m_data.m_labelPen.setThemed(themed);
emit q_ptr->labelPenChanged();
}
}
void QPieSlicePrivate::setLabelFont(const QFont &font, bool themed)
{
if (m_data.m_labelFont != font) {
m_data.m_labelFont = font;
m_data.m_labelFont.setThemed(themed);
emit q_ptr->labelFontChanged();
}
}
void QPieSlicePrivate::setPercentage(qreal percentage)
{
if (!qFuzzyIsNull(m_data.m_percentage - percentage)) {
m_data.m_percentage = percentage;
emit q_ptr->percentageChanged();
}
}
void QPieSlicePrivate::setStartAngle(qreal angle)
{
if (!qFuzzyIsNull(m_data.m_startAngle - angle)) {
m_data.m_startAngle = angle;
emit q_ptr->startAngleChanged();
}
}
void QPieSlicePrivate::setAngleSpan(qreal span)
{
if (!qFuzzyIsNull(m_data.m_angleSpan - span)) {
m_data.m_angleSpan = span;
emit q_ptr->angleSpanChanged();
Jani Honkonen
Refactor pie (again). QPieSlice's now emit signals and no id's anymore. Just pointers in the interface.
r203 }
}
QTCOMMERCIALCHART_END_NAMESPACE
Tero Ahola
Fixed compilation issue on Qt 4.7
r837
QTCOMMERCIALCHART_USE_NAMESPACE
#include "moc_qpieslice.cpp"
Jani Honkonen
pie: added everything as a property in QPieSlice...
r1274 #include "moc_qpieslice_p.cpp"