KChart

KChartPieAttributes.h
1/*
2 * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 *
4 * This file is part of the KD Chart library.
5 *
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
8
9#ifndef KCHART_PIE_ATTRIBUTES_H
10#define KCHART_PIE_ATTRIBUTES_H
11
12#include <QMetaType>
13#include "KChartAbstractThreeDAttributes.h"
14#include "KChartGlobal.h"
15
16namespace KChart {
17
18/**
19 * @brief A set of attributes controlling the appearance of pie charts
20 */
21class KCHART_EXPORT PieAttributes
22{
23public:
26 PieAttributes &operator= ( const PieAttributes& );
27
29
30 /** \brief Enable or disable exploding the respective pie piece(s).
31 *
32 * The default explode factor is 10 percent; use setExplodeFactor
33 * to specify a different factor.
34 *
35 * \note This is a convenience function: Calling setExplode( true )
36 * does the same as calling setExplodeFactor( 0.1 ), and calling
37 * setExplode( false ) does the same as calling setExplodeFactor( 0.0 ).
38 *
39 * \sa setExplodeFactor
40 */
41 void setExplode( bool explode );
42
43 /** @return whether the respective pie piece(s) will be exploded. */
44 bool explode() const;
45
46 /** Set the explode factor.
47 * The explode factor is a qreal between 0 and 1, and is interpreted
48 * as a percentage of the total available radius of the pie.
49 *
50 * \sa setExplode
51 */
52 void setExplodeFactor( qreal factor );
53
54 /** @return the explode factor set by setExplode or by setExplodeFactor. */
55 qreal explodeFactor() const;
56
57 void setGapFactor( bool circular, qreal factor );
58 qreal gapFactor( bool circular ) const;
59
60 bool operator==( const PieAttributes& ) const;
61 inline bool operator!=( const PieAttributes& other ) const { return !operator==(other); }
62
63private:
64 KCHART_DECLARE_PRIVATE_BASE_VALUE( PieAttributes )
65}; // End of class PieAttributes
66
67}
68
69#if !defined(QT_NO_DEBUG_STREAM)
70KCHART_EXPORT QDebug operator<<(QDebug, const KChart::PieAttributes& );
71#endif /* QT_NO_DEBUG_STREAM */
72
73KCHART_DECLARE_SWAP_SPECIALISATION( KChart::PieAttributes )
74
75QT_BEGIN_NAMESPACE
76Q_DECLARE_TYPEINFO( KChart::PieAttributes, Q_MOVABLE_TYPE );
77QT_END_NAMESPACE
78
79Q_DECLARE_METATYPE( KChart::PieAttributes )
80
81#endif // KCHART_PIE_ATTRIBUTES_H
Contains KChart macros.
A set of attributes controlling the appearance of pie charts.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:02:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.