##// END OF EJS Templates
Add qml Font properties & docs
Jani Honkonen -
r1517:7e86792a50b2
parent child
Show More
@@ -0,0 +1,114
1 /*!
2 \qmlclass Font QFont
3 \brief Defines the font used for drawing text.
4
5 Font instantiates the C++ class QFont
6 */
7
8 // NOTE: This is a copy-paste from:
9 // <qt dir>\src\declarative\graphicsitems\qdeclarativetext.cpp
10
11 /*!
12 \qmlproperty string Font::family
13
14 Sets the family name of the font.
15
16 The family name is case insensitive and may optionally include a foundry name, e.g. "Helvetica [Cronyx]".
17 If the family is available from more than one foundry and the foundry isn't specified, an arbitrary foundry is chosen.
18 If the family isn't available a family will be set using the font matching algorithm.
19 */
20
21 /*!
22 \qmlproperty bool Font::bold
23
24 Sets whether the font weight is bold.
25 */
26
27 /*!
28 \qmlproperty enumeration Font::weight
29
30 Sets the font's weight.
31
32 The weight can be one of:
33 \list
34 \o Font.Light
35 \o Font.Normal - the default
36 \o Font.DemiBold
37 \o Font.Bold
38 \o Font.Black
39 \endlist
40
41 \qml
42 Text { text: "Hello"; font.weight: Font.DemiBold }
43 \endqml
44 */
45
46 /*!
47 \qmlproperty bool Font::italic
48
49 Sets whether the font has an italic style.
50 */
51
52 /*!
53 \qmlproperty bool Font::underline
54
55 Sets whether the text is underlined.
56 */
57
58 /*!
59 \qmlproperty bool Font::strikeout
60
61 Sets whether the font has a strikeout style.
62 */
63
64 /*!
65 \qmlproperty real Font::pointSize
66
67 Sets the font size in points. The point size must be greater than zero.
68 */
69
70 /*!
71 \qmlproperty int Font::pixelSize
72
73 Sets the font size in pixels.
74
75 Using this function makes the font device dependent.
76 Use \c pointSize to set the size of the font in a device independent manner.
77 */
78
79 /*!
80 \qmlproperty real Font::letterSpacing
81
82 Sets the letter spacing for the font.
83
84 Letter spacing changes the default spacing between individual letters in the font.
85 A positive value increases the letter spacing by the corresponding pixels; a negative value decreases the spacing.
86 */
87
88 /*!
89 \qmlproperty real Font::wordSpacing
90
91 Sets the word spacing for the font.
92
93 Word spacing changes the default spacing between individual words.
94 A positive value increases the word spacing by a corresponding amount of pixels,
95 while a negative value decreases the inter-word spacing accordingly.
96 */
97
98 /*!
99 \qmlproperty enumeration Font::capitalization
100
101 Sets the capitalization for the text.
102
103 \list
104 \o Font.MixedCase - This is the normal text rendering option where no capitalization change is applied.
105 \o Font.AllUppercase - This alters the text to be rendered in all uppercase type.
106 \o Font.AllLowercase - This alters the text to be rendered in all lowercase type.
107 \o Font.SmallCaps - This alters the text to be rendered in small-caps type.
108 \o Font.Capitalize - This alters the text to be rendered with the first character of each word as an uppercase character.
109 \endlist
110
111 \qml
112 Text { text: "Hello"; font.capitalization: Font.AllLowercase }
113 \endqml
114 */
@@ -58,6 +58,13 QTCOMMERCIALCHART_BEGIN_NAMESPACE
58 58 */
59 59
60 60 /*!
61 \qmlproperty Font ChartView::titleFont
62 The title font of the chart
63
64 See the \l {Font} {QML Font Element} for detailed documentation.
65 */
66
67 /*!
61 68 \qmlproperty string ChartView::title
62 69 The title of the chart, shown on top of the chart.
63 70 \sa ChartView::titleColor
@@ -250,6 +257,16 void DeclarativeChart::setTitleColor(QColor color)
250 257 }
251 258 }
252 259
260 QFont DeclarativeChart::titleFont() const
261 {
262 return m_chart->titleFont();
263 }
264
265 void DeclarativeChart::setTitleFont(const QFont& font)
266 {
267 m_chart->setTitleFont(font);
268 }
269
253 270 QColor DeclarativeChart::titleColor()
254 271 {
255 272 return m_chart->titleBrush().color();
@@ -37,6 +37,7 class DeclarativeChart : public QDeclarativeItem
37 37 Q_PROPERTY(Theme theme READ theme WRITE setTheme)
38 38 Q_PROPERTY(Animation animationOptions READ animationOptions WRITE setAnimationOptions)
39 39 Q_PROPERTY(QString title READ title WRITE setTitle)
40 Q_PROPERTY(QFont titleFont READ titleFont WRITE setTitleFont)
40 41 Q_PROPERTY(QColor titleColor READ titleColor WRITE setTitleColor NOTIFY titleColorChanged)
41 42 Q_PROPERTY(QAxis *axisX READ axisX)
42 43 Q_PROPERTY(QAxis *axisY READ axisY)
@@ -103,6 +104,8 public:
103 104 QLegend *legend();
104 105 QVariantList axisXLabels();
105 106 void setAxisXLabels(QVariantList list);
107 QFont titleFont() const;
108 void setTitleFont(const QFont& font);
106 109 void setTitleColor(QColor color);
107 110 QColor titleColor();
108 111 void setBackgroundColor(QColor color);
@@ -110,6 +110,17 QTCOMMERCIALCHART_BEGIN_NAMESPACE
110 110 */
111 111
112 112 /*!
113 \property QAxis::labelsFont
114 The font of the axis labels.
115 */
116 /*!
117 \qmlproperty Font Axis::labelsFont
118 The font of the axis labels.
119
120 See the \l {Font} {QML Font Element} for detailed documentation.
121 */
122
123 /*!
113 124 \property QAxis::labelsColor
114 125 The color of the axis labels.
115 126 */
@@ -37,6 +37,7 class QTCOMMERCIALCHART_EXPORT QAxis : public QObject
37 37 Q_PROPERTY(QColor color READ axisPenColor WRITE setAxisPenColor NOTIFY colorChanged)
38 38 Q_PROPERTY(bool labelsVisible READ labelsVisible WRITE setLabelsVisible NOTIFY labelsVisibleChanged)
39 39 Q_PROPERTY(int labelsAngle READ labelsAngle WRITE setLabelsAngle)
40 Q_PROPERTY(QFont labelsFont READ labelsFont WRITE setLabelsFont)
40 41 Q_PROPERTY(QColor labelsColor READ labelsColor WRITE setLabelsColor NOTIFY labelsColorChanged)
41 42 Q_PROPERTY(bool gridVisible READ isGridLineVisible WRITE setGridLineVisible NOTIFY gridVisibleChanged)
42 43 Q_PROPERTY(bool shadesVisible READ shadesVisible WRITE setShadesVisible NOTIFY shadesVisibleChanged)
@@ -76,6 +76,13 QTCOMMERCIALCHART_BEGIN_NAMESPACE
76 76 */
77 77
78 78 /*!
79 \qmlproperty Font BarSet::labelFont
80 Defines the font used by the barSet's label.
81
82 See the \l {Font} {QML Font Element} for detailed documentation.
83 */
84
85 /*!
79 86 \property QBarSet::color
80 87 The fill (brush) color of the bar set.
81 88 */
@@ -276,6 +276,16 QTCOMMERCIALCHART_BEGIN_NAMESPACE
276 276 */
277 277
278 278 /*!
279 \qmlproperty Font PieSlice::labelFont
280
281 Defines the font used for slice label.
282
283 See the \l {Font} {QML Font Element} for detailed documentation.
284
285 \sa labelVisible, labelPosition
286 */
287
288 /*!
279 289 \property QPieSlice::labelPosition
280 290 Position of the slice label.
281 291 \sa label, labelVisible
General Comments 0
You need to be logged in to leave comments. Login now