qpieslice.h
114 lines
| 3.6 KiB
| text/x-c
|
CLexer
Jani Honkonen
|
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
|
r203 | #ifndef QPIESLICE_H | ||
#define QPIESLICE_H | ||||
#include <qchartglobal.h> | ||||
#include <QObject> | ||||
#include <QPen> | ||||
#include <QBrush> | ||||
#include <QFont> | ||||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
Jani Honkonen
|
r1274 | class QPieSlicePrivate; | ||
Jani Honkonen
|
r203 | |||
class QTCOMMERCIALCHART_EXPORT QPieSlice : public QObject | ||||
{ | ||||
Q_OBJECT | ||||
Jani Honkonen
|
r1224 | Q_PROPERTY(QString label READ label WRITE setLabel NOTIFY labelChanged) | ||
Q_PROPERTY(qreal value READ value WRITE setValue NOTIFY valueChanged) | ||||
Jani Honkonen
|
r1274 | Q_PROPERTY(bool labelVisible READ isLabelVisible WRITE setLabelVisible NOTIFY labelVisibleChanged) | ||
Q_PROPERTY(bool exploded READ isExploded WRITE setExploded NOTIFY explodedChanged) | ||||
Q_PROPERTY(QPen pen READ pen WRITE setPen NOTIFY penChanged) | ||||
Q_PROPERTY(QBrush brush READ brush WRITE setBrush NOTIFY brushChanged) | ||||
Q_PROPERTY(QPen labelPen READ labelPen WRITE setLabelPen NOTIFY labelPenChanged) | ||||
Q_PROPERTY(QFont labelFont READ labelFont WRITE setLabelFont NOTIFY labelFontChanged) | ||||
Jani Honkonen
|
r1277 | Q_PROPERTY(qreal labelArmLengthFactor READ labelArmLengthFactor WRITE setLabelArmLengthFactor) | ||
Jani Honkonen
|
r1224 | Q_PROPERTY(qreal explodeDistanceFactor READ explodeDistanceFactor WRITE setExplodeDistanceFactor) | ||
Jani Honkonen
|
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
|
r203 | |||
public: | ||||
Michal Klocek
|
r970 | explicit QPieSlice(QObject *parent = 0); | ||
Jani Honkonen
|
r1206 | QPieSlice(QString label, qreal value, QObject *parent = 0); | ||
Jani Honkonen
|
r203 | virtual ~QPieSlice(); | ||
Jani Honkonen
|
r437 | void setLabel(QString label); | ||
Jani Honkonen
|
r203 | QString label() const; | ||
Jani Honkonen
|
r1224 | |||
void setValue(qreal value); | ||||
qreal value() const; | ||||
Jani Honkonen
|
r203 | |||
Jani Honkonen
|
r1274 | void setLabelVisible(bool visible = true); | ||
bool isLabelVisible() const; | ||||
void setExploded(bool exploded = true); | ||||
bool isExploded() const; | ||||
Jani Honkonen
|
r756 | void setPen(const QPen &pen); | ||
QPen pen() const; | ||||
Jani Honkonen
|
r1224 | |||
Jani Honkonen
|
r756 | void setBrush(const QBrush &brush); | ||
QBrush brush() const; | ||||
Jani Honkonen
|
r1224 | |||
Jani Honkonen
|
r714 | void setLabelPen(const QPen &pen); | ||
QPen labelPen() const; | ||||
Jani Honkonen
|
r1224 | |||
Jani Honkonen
|
r469 | void setLabelFont(const QFont &font); | ||
Jani Honkonen
|
r203 | QFont labelFont() const; | ||
Jani Honkonen
|
r1009 | |||
Jani Honkonen
|
r1274 | void setLabelArmLengthFactor(qreal factor); | ||
qreal labelArmLengthFactor() const; | ||||
Jani Honkonen
|
r1224 | |||
Jani Honkonen
|
r618 | void setExplodeDistanceFactor(qreal factor); | ||
qreal explodeDistanceFactor() const; | ||||
Jani Honkonen
|
r437 | |||
Jani Honkonen
|
r1009 | qreal percentage() const; | ||
qreal startAngle() const; | ||||
Jani Honkonen
|
r1274 | qreal angleSpan() const; | ||
Jani Honkonen
|
r1009 | |||
Jani Honkonen
|
r203 | Q_SIGNALS: | ||
Jani Honkonen
|
r1224 | void labelChanged(); | ||
void valueChanged(); | ||||
Jani Honkonen
|
r1274 | void labelVisibleChanged(); | ||
void explodedChanged(); | ||||
void penChanged(); | ||||
void brushChanged(); | ||||
void labelPenChanged(); | ||||
void labelFontChanged(); | ||||
void labelArmLengthFactorChanged(); | ||||
void explodeDistanceFactorChanged(); | ||||
void percentageChanged(); | ||||
void startAngleChanged(); | ||||
void angleSpanChanged(); | ||||
Jani Honkonen
|
r1009 | void clicked(); | ||
void hovered(bool state); | ||||
Jani Honkonen
|
r203 | |||
private: | ||||
Jani Honkonen
|
r1274 | QPieSlicePrivate * const d_ptr; | ||
Q_DECLARE_PRIVATE(QPieSlice) | ||||
Jani Honkonen
|
r669 | Q_DISABLE_COPY(QPieSlice) | ||
Jani Honkonen
|
r203 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif // QPIESLICE_H | ||||