KD Chart 2  [rev.2.7]
KDChartTextAttributes.h
Go to the documentation of this file.
1 /****************************************************************************
2 ** Copyright (C) 2001-2020 Klaralvdalens Datakonsult AB. All rights reserved.
3 **
4 ** This file is part of the KD Chart library.
5 **
6 ** Licensees holding valid commercial KD Chart licenses may use this file in
7 ** accordance with the KD Chart Commercial License Agreement provided with
8 ** the Software.
9 **
10 **
11 ** This file may be distributed and/or modified under the terms of the
12 ** GNU General Public License version 2 and version 3 as published by the
13 ** Free Software Foundation and appearing in the file LICENSE.GPL.txt included.
14 **
15 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17 **
18 ** Contact info@kdab.com if any conditions of this licensing are not
19 ** clear to you.
20 **
21 **********************************************************************/
22 
23 #ifndef KDCHARTTEXTATTRIBUTES_H
24 #define KDCHARTTEXTATTRIBUTES_H
25 
26 #include <QDebug>
27 #include <QMetaType>
28 #include "KDChartGlobal.h"
29 #include "KDChartMeasure.h"
30 
31 QT_BEGIN_NAMESPACE
32 class QPen;
33 class QFont;
34 class QTextDocument;
35 QT_END_NAMESPACE
36 
37 namespace KDChart {
38 
46 class KDCHART_EXPORT TextAttributes
47 {
48 public:
51  TextAttributes &operator= ( const TextAttributes& );
52  bool operator==( const TextAttributes& ) const;
53  inline bool operator!=( const TextAttributes& other ) const
54  { return !operator==(other); }
55 
56  ~TextAttributes();
57 
62  void setVisible( bool visible );
63 
67  bool isVisible() const;
68 
79  void setFont( const QFont& font );
80 
84  QFont font() const;
85 
91  void setFontSize( const Measure & measure );
92 
96  Measure fontSize() const;
97 
103  void setMinimalFontSize( const Measure & measure );
104 
108  Measure minimalFontSize() const;
109 
117  qreal calculatedFontSize( const QSizeF &referenceSize,
118  KDChartEnums::MeasureOrientation autoReferenceOrientation ) const;
119 
127 #if QT_VERSION < 0x040400 || defined(Q_COMPILER_MANGLES_RETURN_TYPE)
128  const qreal calculatedFontSize(
129 #else
130  qreal calculatedFontSize(
131 #endif
132  const QObject* autoReferenceArea,
133  KDChartEnums::MeasureOrientation autoReferenceOrientation ) const;
134 
142  const QFont calculatedFont(
143  const QObject* autoReferenceArea,
144  KDChartEnums::MeasureOrientation autoReferenceOrientation ) const;
145 
149  bool hasAbsoluteFontSize() const;
150 
156  void setAutoRotate( bool autoRotate );
157 
162  bool autoRotate() const;
163 
169  void setAutoShrink( bool autoShrink );
170 
175  bool autoShrink() const;
176 
188  void setRotation( int rotation );
189  void resetRotation();
190  bool hasRotation() const;
191 
195  int rotation() const;
196 
201  void setPen( const QPen& pen );
202 
206  QPen pen() const;
207 
212  QTextDocument* textDocument() const;
213 
217  void setTextDocument(QTextDocument* layout);
218 
219  // FIXME KDChartEnums::TextLayoutPolicy?
220 
221 private:
223 
224 }; // End of class TextAttributes
225 
226 }
227 
228 #if !defined(QT_NO_DEBUG_STREAM)
229 KDCHART_EXPORT QDebug operator<<(QDebug, const KDChart::TextAttributes& );
230 #endif /* QT_NO_DEBUG_STREAM */
231 
233 
234 QT_BEGIN_NAMESPACE
236 QT_END_NAMESPACE
237 Q_DECLARE_METATYPE( KDChart::TextAttributes )
238 
239 #endif // KDCHARTTEXTATTRIBUTES_H
MeasureOrientation
Measure orientation mode: the way how the absolute value of a KDChart::Measure is determined during K...
Definition: KDChartEnums.h:290
bool operator==(const Span &s1, const Span &s2)
#define KDCHART_DECLARE_PRIVATE_BASE_VALUE(X)
Definition: KDChartGlobal.h:71
Declaring the class KDChart::Measure.
Class only listed here to document inheritance of some KDChart classes.
bool operator!=(const TextAttributes &other) const
Measure is used to specify relative and absolute sizes in KDChart, e.g.
#define KDCHART_DECLARE_SWAP_SPECIALISATION(X)
Class only listed here to document inheritance of some KDChart classes.
QDebug operator<<(QDebug stream, const DataDimension &r)
QT_BEGIN_NAMESPACE Q_DECLARE_TYPEINFO(KDChart::TextAttributes, Q_MOVABLE_TYPE)
A set of text attributes.

Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/

https://www.kdab.com/development-resources/qt-tools/kd-chart/