qpieslice.h
85 lines
| 2.3 KiB
| text/x-c
|
CLexer
|
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$ | ||||
** | ||||
****************************************************************************/ | ||||
|
r203 | #ifndef QPIESLICE_H | ||
#define QPIESLICE_H | ||||
#include <qchartglobal.h> | ||||
#include <QObject> | ||||
#include <QPen> | ||||
#include <QBrush> | ||||
#include <QFont> | ||||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
|
r818 | class PieSliceData; | ||
|
r203 | |||
class QTCOMMERCIALCHART_EXPORT QPieSlice : public QObject | ||||
{ | ||||
Q_OBJECT | ||||
|
r1162 | Q_PROPERTY(QString label READ label WRITE setLabel) | ||
Q_PROPERTY(qreal value READ value WRITE setValue) | ||||
Q_PROPERTY(bool exploded READ isExploded WRITE setExploded) | ||||
|
r203 | |||
public: | ||||
|
r970 | explicit QPieSlice(QObject *parent = 0); | ||
|
r314 | QPieSlice(qreal value, QString label, QObject *parent = 0); | ||
|
r203 | virtual ~QPieSlice(); | ||
|
r437 | void setValue(qreal value); | ||
|
r203 | qreal value() const; | ||
|
r437 | void setLabel(QString label); | ||
|
r203 | QString label() const; | ||
|
r696 | void setLabelVisible(bool visible = true); | ||
|
r203 | bool isLabelVisible() const; | ||
|
r696 | void setExploded(bool exploded = true); | ||
|
r203 | bool isExploded() const; | ||
|
r756 | void setPen(const QPen &pen); | ||
QPen pen() const; | ||||
void setBrush(const QBrush &brush); | ||||
QBrush brush() const; | ||||
|
r714 | void setLabelPen(const QPen &pen); | ||
QPen labelPen() const; | ||||
|
r469 | void setLabelFont(const QFont &font); | ||
|
r203 | QFont labelFont() const; | ||
|
r1009 | |||
|
r454 | void setLabelArmLengthFactor(qreal factor); | ||
qreal labelArmLengthFactor() const; | ||||
|
r618 | void setExplodeDistanceFactor(qreal factor); | ||
qreal explodeDistanceFactor() const; | ||||
|
r437 | |||
|
r1009 | qreal percentage() const; | ||
qreal startAngle() const; | ||||
qreal endAngle() const; | ||||
|
r203 | Q_SIGNALS: | ||
|
r1009 | void clicked(); | ||
void hovered(bool state); | ||||
|
r203 | void changed(); | ||
private: | ||||
|
r818 | friend class PieSliceData; | ||
PieSliceData * const d; | ||||
|
r669 | Q_DISABLE_COPY(QPieSlice) | ||
|
r203 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif // QPIESLICE_H | ||||