1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
|
'\" t
.TH QStyleSheetItem 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*-
.\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
.\" license file included in the distribution for a complete license
.\" statement.
.\"
.ad l
.nh
.SH NAME
QStyleSheetItem \- Encapsulation of a set of text styles
.SH SYNOPSIS
\fC#include <ntqstylesheet.h>\fR
.PP
Inherits Qt.
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBQStyleSheetItem\fR ( QStyleSheet * parent, const TQString & name )"
.br
.ti -1c
.BI "\fBQStyleSheetItem\fR ( const QStyleSheetItem & other )"
.br
.ti -1c
.BI "\fB~QStyleSheetItem\fR ()"
.br
.ti -1c
.BI "QStyleSheetItem & \fBoperator=\fR ( const QStyleSheetItem & other )"
.br
.ti -1c
.BI "TQString \fBname\fR () const"
.br
.ti -1c
.BI "QStyleSheet * \fBstyleSheet\fR ()"
.br
.ti -1c
.BI "const QStyleSheet * \fBstyleSheet\fR () const"
.br
.ti -1c
.BI "enum \fBDisplayMode\fR { DisplayBlock, DisplayInline, DisplayListItem, DisplayNone }"
.br
.ti -1c
.BI "DisplayMode \fBdisplayMode\fR () const"
.br
.ti -1c
.BI "void \fBsetDisplayMode\fR ( DisplayMode m )"
.br
.ti -1c
.BI "int \fBalignment\fR () const"
.br
.ti -1c
.BI "void \fBsetAlignment\fR ( int f )"
.br
.ti -1c
.BI "enum \fBVerticalAlignment\fR { VAlignBaseline, VAlignSub, VAlignSuper }"
.br
.ti -1c
.BI "VerticalAlignment \fBverticalAlignment\fR () const"
.br
.ti -1c
.BI "void \fBsetVerticalAlignment\fR ( VerticalAlignment valign )"
.br
.ti -1c
.BI "int \fBfontWeight\fR () const"
.br
.ti -1c
.BI "void \fBsetFontWeight\fR ( int w )"
.br
.ti -1c
.BI "int \fBlogicalFontSize\fR () const"
.br
.ti -1c
.BI "void \fBsetLogicalFontSize\fR ( int s )"
.br
.ti -1c
.BI "int \fBlogicalFontSizeStep\fR () const"
.br
.ti -1c
.BI "void \fBsetLogicalFontSizeStep\fR ( int s )"
.br
.ti -1c
.BI "int \fBfontSize\fR () const"
.br
.ti -1c
.BI "void \fBsetFontSize\fR ( int s )"
.br
.ti -1c
.BI "TQString \fBfontFamily\fR () const"
.br
.ti -1c
.BI "void \fBsetFontFamily\fR ( const TQString & fam )"
.br
.ti -1c
.BI "int numberOfColumns () const \fI(obsolete)\fR"
.br
.ti -1c
.BI "void setNumberOfColumns ( int ncols ) \fI(obsolete)\fR"
.br
.ti -1c
.BI "TQColor \fBcolor\fR () const"
.br
.ti -1c
.BI "void \fBsetColor\fR ( const TQColor & c )"
.br
.ti -1c
.BI "bool \fBfontItalic\fR () const"
.br
.ti -1c
.BI "void \fBsetFontItalic\fR ( bool italic )"
.br
.ti -1c
.BI "bool \fBdefinesFontItalic\fR () const"
.br
.ti -1c
.BI "bool \fBfontUnderline\fR () const"
.br
.ti -1c
.BI "void \fBsetFontUnderline\fR ( bool underline )"
.br
.ti -1c
.BI "bool \fBdefinesFontUnderline\fR () const"
.br
.ti -1c
.BI "bool \fBfontStrikeOut\fR () const"
.br
.ti -1c
.BI "void \fBsetFontStrikeOut\fR ( bool strikeOut )"
.br
.ti -1c
.BI "bool \fBdefinesFontStrikeOut\fR () const"
.br
.ti -1c
.BI "bool \fBisAnchor\fR () const"
.br
.ti -1c
.BI "void \fBsetAnchor\fR ( bool anc )"
.br
.ti -1c
.BI "enum \fBWhiteSpaceMode\fR { WhiteSpaceNormal, WhiteSpacePre, WhiteSpaceNoWrap }"
.br
.ti -1c
.BI "WhiteSpaceMode \fBwhiteSpaceMode\fR () const"
.br
.ti -1c
.BI "void \fBsetWhiteSpaceMode\fR ( WhiteSpaceMode m )"
.br
.ti -1c
.BI "enum \fBMargin\fR { MarginLeft, MarginRight, MarginTop, MarginBottom, MarginFirstLine, MarginAll, MarginVertical, MarginHorizontal }"
.br
.ti -1c
.BI "int \fBmargin\fR ( Margin m ) const"
.br
.ti -1c
.BI "void \fBsetMargin\fR ( Margin m, int v )"
.br
.ti -1c
.BI "enum \fBListStyle\fR { ListDisc, ListCircle, ListSquare, ListDecimal, ListLowerAlpha, ListUpperAlpha }"
.br
.ti -1c
.BI "ListStyle \fBlistStyle\fR () const"
.br
.ti -1c
.BI "void \fBsetListStyle\fR ( ListStyle s )"
.br
.ti -1c
.BI "TQString \fBcontexts\fR () const"
.br
.ti -1c
.BI "void \fBsetContexts\fR ( const TQString & c )"
.br
.ti -1c
.BI "bool \fBallowedInContext\fR ( const QStyleSheetItem * s ) const"
.br
.ti -1c
.BI "bool \fBselfNesting\fR () const"
.br
.ti -1c
.BI "void \fBsetSelfNesting\fR ( bool nesting )"
.br
.ti -1c
.BI "int lineSpacing () const \fI(obsolete)\fR"
.br
.in -1c
.SH DESCRIPTION
The QStyleSheetItem class provides an encapsulation of a set of text styles.
.PP
A style sheet item consists of a name and a set of attributes that specifiy its font, color, etc. When used in a style sheet (see styleSheet()), items define the name() of a rich text tag and the display property changes associated with it.
.PP
The display mode attribute indicates whether the item is a block, an inline element or a list element; see setDisplayMode(). The treatment of whitespace is controlled by the white space mode; see setWhiteSpaceMode(). An item's margins are set with setMargin(), In the case of list items, the list style is set with setListStyle(). An item may be a hypertext link anchor; see setAnchor(). Other attributes are set with setAlignment(), setVerticalAlignment(), setFontFamily(), setFontSize(), setFontWeight(), setFontItalic(), setFontUnderline(), setFontStrikeOut and setColor().
.PP
See also Text Related Classes.
.SS "Member Type Documentation"
.SH "QStyleSheetItem::DisplayMode"
This enum type defines the way adjacent elements are displayed.
.TP
\fCQStyleSheetItem::DisplayBlock\fR - elements are displayed as a rectangular block (e.g. \fC<p>...</p>\fR).
.TP
\fCQStyleSheetItem::DisplayInline\fR - elements are displayed in a horizontally flowing sequence (e.g. \fC<em>...</em>\fR).
.TP
\fCQStyleSheetItem::DisplayListItem\fR - elements are displayed in a vertical sequence (e.g. \fC<li>...</li>\fR).
.TP
\fCQStyleSheetItem::DisplayNone\fR - elements are not displayed at all.
.SH "QStyleSheetItem::ListStyle"
This enum type defines how the items in a list are prefixed when displayed.
.TP
\fCQStyleSheetItem::ListDisc\fR - a filled circle (i.e. a bullet)
.TP
\fCQStyleSheetItem::ListCircle\fR - an unfilled circle
.TP
\fCQStyleSheetItem::ListSquare\fR - a filled square
.TP
\fCQStyleSheetItem::ListDecimal\fR - an integer in base 10: \fI1\fR, \fI2\fR, \fI3\fR, ...
.TP
\fCQStyleSheetItem::ListLowerAlpha\fR - a lowercase letter: \fIa\fR, \fIb\fR, \fIc\fR, ...
.TP
\fCQStyleSheetItem::ListUpperAlpha\fR - an uppercase letter: \fIA\fR, \fIB\fR, \fIC\fR, ...
.SH "QStyleSheetItem::Margin"
.TP
\fCQStyleSheetItem::MarginLeft\fR - left margin
.TP
\fCQStyleSheetItem::MarginRight\fR - right margin
.TP
\fCQStyleSheetItem::MarginTop\fR - top margin
.TP
\fCQStyleSheetItem::MarginBottom\fR - bottom margin
.TP
\fCQStyleSheetItem::MarginAll\fR - all margins (left, right, top and bottom)
.TP
\fCQStyleSheetItem::MarginVertical\fR - top and bottom margins
.TP
\fCQStyleSheetItem::MarginHorizontal\fR - left and right margins
.TP
\fCQStyleSheetItem::MarginFirstLine\fR - margin (indentation) of the first line of a paragarph (in addition to the MarginLeft of the paragraph)
.SH "QStyleSheetItem::VerticalAlignment"
This enum type defines the way elements are aligned vertically. This is only supported for text elements.
.TP
\fCQStyleSheetItem::VAlignBaseline\fR - align the baseline of the element (or the bottom, if the element doesn't have a baseline) with the baseline of the parent
.TP
\fCQStyleSheetItem::VAlignSub\fR - subscript the element
.TP
\fCQStyleSheetItem::VAlignSuper\fR - superscript the element
.SH "QStyleSheetItem::WhiteSpaceMode"
This enum defines the ways in which QStyleSheet can treat whitespace.
.TP
\fCQStyleSheetItem::WhiteSpaceNormal\fR - any sequence of whitespace (including line-breaks) is equivalent to a single space.
.TP
\fCQStyleSheetItem::WhiteSpacePre\fR - whitespace must be output exactly as given in the input.
.TP
\fCQStyleSheetItem::WhiteSpaceNoWrap\fR - multiple spaces are collapsed as with WhiteSpaceNormal, but no automatic line-breaks occur. To break lines manually, use the \fC<br>\fR tag.
.PP
.SH MEMBER FUNCTION DOCUMENTATION
.SH "QStyleSheetItem::QStyleSheetItem ( QStyleSheet * parent, const TQString & name )"
Constructs a new style called \fIname\fR for the stylesheet \fIparent\fR.
.PP
All properties in QStyleSheetItem are initially in the "do not change" state, except display mode, which defaults to DisplayInline.
.SH "QStyleSheetItem::QStyleSheetItem ( const QStyleSheetItem & other )"
Copy constructor. Constructs a copy of \fIother\fR that is not bound to any style sheet.
.SH "QStyleSheetItem::~QStyleSheetItem ()"
Destroys the style. Note that QStyleSheetItem objects become owned by QStyleSheet when they are created.
.SH "int QStyleSheetItem::alignment () const"
Returns the alignment of this style. Possible values are AlignAuto, AlignLeft, AlignRight, AlignCenter or AlignJustify.
.PP
See also setAlignment() and Qt::AlignmentFlags.
.SH "bool QStyleSheetItem::allowedInContext ( const QStyleSheetItem * s ) const"
Returns TRUE if this style can be nested into an element of style \fIs\fR; otherwise returns FALSE.
.PP
See also contexts() and setContexts().
.SH "TQColor QStyleSheetItem::color () const"
Returns the text color of this style or an invalid color if no color has been set.
.PP
See also setColor() and TQColor::isValid().
.SH "TQString QStyleSheetItem::contexts () const"
Returns a space-separated list of names of styles that may contain elements of this style. If nothing has been set, contexts() returns an empty string, which indicates that this style can be nested everywhere.
.PP
See also setContexts().
.SH "bool QStyleSheetItem::definesFontItalic () const"
Returns TRUE if the style defines a font shape; otherwise returns FALSE. A style does not define any shape until setFontItalic() is called.
.PP
See also setFontItalic() and fontItalic().
.SH "bool QStyleSheetItem::definesFontStrikeOut () const"
Returns TRUE if the style defines a setting for the strikeOut property of the font; otherwise returns FALSE. A style does not define this until setFontStrikeOut() is called.
.PP
See also setFontStrikeOut() and fontStrikeOut().
.SH "bool QStyleSheetItem::definesFontUnderline () const"
Returns TRUE if the style defines a setting for the underline property of the font; otherwise returns FALSE. A style does not define this until setFontUnderline() is called.
.PP
See also setFontUnderline() and fontUnderline().
.SH "DisplayMode QStyleSheetItem::displayMode () const"
Returns the display mode of the style.
.PP
See also setDisplayMode().
.SH "TQString QStyleSheetItem::fontFamily () const"
Returns the font family setting of the style. This is either a valid font family or TQString::null if no family has been set.
.PP
See also setFontFamily(), QFont::family(), and QFont::setFamily().
.SH "bool QStyleSheetItem::fontItalic () const"
Returns TRUE if the style sets an italic font; otherwise returns FALSE.
.PP
See also setFontItalic() and definesFontItalic().
.SH "int QStyleSheetItem::fontSize () const"
Returns the font size setting of the style. This is either a valid point size or QStyleSheetItem::Undefined.
.PP
See also setFontSize(), QFont::pointSize(), and QFont::setPointSize().
.SH "bool QStyleSheetItem::fontStrikeOut () const"
Returns TRUE if the style sets a strike out font; otherwise returns FALSE.
.PP
See also setFontStrikeOut() and definesFontStrikeOut().
.SH "bool QStyleSheetItem::fontUnderline () const"
Returns TRUE if the style sets an underlined font; otherwise returns FALSE.
.PP
See also setFontUnderline() and definesFontUnderline().
.SH "int QStyleSheetItem::fontWeight () const"
Returns the font weight setting of the style. This is either a valid QFont::Weight or the value QStyleSheetItem::Undefined.
.PP
See also setFontWeight() and QFont.
.SH "bool QStyleSheetItem::isAnchor () const"
Returns whether this style is an anchor.
.PP
See also setAnchor().
.SH "int QStyleSheetItem::lineSpacing () const"
\fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code.
.PP
Returns the linespacing
.SH "ListStyle QStyleSheetItem::listStyle () const"
Returns the list style of the style.
.PP
See also setListStyle() and ListStyle.
.SH "int QStyleSheetItem::logicalFontSize () const"
Returns the logical font size setting of the style. This is either a valid size between 1 and 7 or QStyleSheetItem::Undefined.
.PP
See also setLogicalFontSize(), setLogicalFontSizeStep(), QFont::pointSize(), and QFont::setPointSize().
.SH "int QStyleSheetItem::logicalFontSizeStep () const"
Returns the logical font size step of this style.
.PP
The default is 0. Tags such as \fCbig\fR define \fC+1\fR; \fCsmall\fR defines \fC-1\fR.
.PP
See also setLogicalFontSizeStep().
.SH "int QStyleSheetItem::margin ( Margin m ) const"
Returns the width of margin \fIm\fR in pixels.
.PP
The margin, \fIm\fR, can be MarginLeft, MarginRight, MarginTop, MarginBottom, or MarginFirstLine.
.PP
See also setMargin() and Margin.
.SH "TQString QStyleSheetItem::name () const"
Returns the name of the style item.
.SH "int QStyleSheetItem::numberOfColumns () const"
\fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code.
.PP
Returns the number of columns for this style.
.PP
See also setNumberOfColumns(), displayMode(), and setDisplayMode().
.SH "QStyleSheetItem & QStyleSheetItem::operator= ( const QStyleSheetItem & other )"
Assignment. Assings a copy of \fIother\fR that is not bound to any style sheet. Unbounds first from previous style sheet.
.SH "bool QStyleSheetItem::selfNesting () const"
Returns TRUE if this style has self-nesting enabled; otherwise returns FALSE.
.PP
See also setSelfNesting().
.SH "void QStyleSheetItem::setAlignment ( int f )"
Sets the alignment to \fIf\fR. This only makes sense for styles with a display mode of DisplayBlock. Possible values are AlignAuto, AlignLeft, AlignRight, AlignCenter or AlignJustify.
.PP
See also alignment(), displayMode(), and Qt::AlignmentFlags.
.SH "void QStyleSheetItem::setAnchor ( bool anc )"
If \fIanc\fR is TRUE, sets this style to be an anchor (hypertext link); otherwise sets it to not be an anchor. Elements in this style link to other documents or anchors.
.PP
See also isAnchor().
.SH "void QStyleSheetItem::setColor ( const TQColor & c )"
Sets the text color of this style to \fIc\fR.
.PP
See also color().
.SH "void QStyleSheetItem::setContexts ( const TQString & c )"
Sets a space-separated list of names of styles that may contain elements of this style. If \fIc\fR is empty, the style can be nested everywhere.
.PP
See also contexts().
.SH "void QStyleSheetItem::setDisplayMode ( DisplayMode m )"
Sets the display mode of the style to \fIm\fR.
.PP
See also displayMode().
.SH "void QStyleSheetItem::setFontFamily ( const TQString & fam )"
Sets the font family setting of the style to \fIfam\fR.
.PP
See also fontFamily(), QFont::family(), and QFont::setFamily().
.SH "void QStyleSheetItem::setFontItalic ( bool italic )"
If \fIitalic\fR is TRUE sets italic for the style; otherwise sets upright.
.PP
See also fontItalic() and definesFontItalic().
.SH "void QStyleSheetItem::setFontSize ( int s )"
Sets the font size setting of the style to \fIs\fR points.
.PP
See also fontSize(), QFont::pointSize(), and QFont::setPointSize().
.SH "void QStyleSheetItem::setFontStrikeOut ( bool strikeOut )"
If \fIstrikeOut\fR is TRUE, sets strike out for the style; otherwise sets no strike out.
.PP
See also fontStrikeOut() and definesFontStrikeOut().
.SH "void QStyleSheetItem::setFontUnderline ( bool underline )"
If \fIunderline\fR is TRUE, sets underline for the style; otherwise sets no underline.
.PP
See also fontUnderline() and definesFontUnderline().
.SH "void QStyleSheetItem::setFontWeight ( int w )"
Sets the font weight setting of the style to \fIw\fR. Valid values are those defined by QFont::Weight.
.PP
See also QFont and fontWeight().
.SH "void QStyleSheetItem::setListStyle ( ListStyle s )"
Sets the list style of the style to \fIs\fR.
.PP
This is used by nested elements that have a display mode of DisplayListItem.
.PP
See also listStyle(), DisplayMode, and ListStyle.
.SH "void QStyleSheetItem::setLogicalFontSize ( int s )"
Sets the logical font size setting of the style to \fIs\fR. Valid logical sizes are 1 to 7.
.PP
See also logicalFontSize(), QFont::pointSize(), and QFont::setPointSize().
.SH "void QStyleSheetItem::setLogicalFontSizeStep ( int s )"
Sets the logical font size step of this style to \fIs\fR.
.PP
See also logicalFontSizeStep().
.SH "void QStyleSheetItem::setMargin ( Margin m, int v )"
Sets the width of margin \fIm\fR to \fIv\fR pixels.
.PP
The margin, \fIm\fR, can be MarginLeft, MarginRight, MarginTop, MarginBottom, MarginFirstLine, MarginAll, MarginVertical or MarginHorizontal. The value \fIv\fR must be >= 0.
.PP
See also margin().
.SH "void QStyleSheetItem::setNumberOfColumns ( int ncols )"
\fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code.
.PP
Sets the number of columns for this style. Elements in the style are divided into columns.
.PP
This makes sense only if the style uses a block display mode (see QStyleSheetItem::DisplayMode).
.PP
See also numberOfColumns().
.SH "void QStyleSheetItem::setSelfNesting ( bool nesting )"
Sets the self-nesting property for this style to \fInesting\fR.
.PP
In order to support "dirty" HTML, paragraphs \fC<p>\fR and list items \fC<li>\fR are not self-nesting. This means that starting a new paragraph or list item automatically closes the previous one.
.PP
See also selfNesting().
.SH "void QStyleSheetItem::setVerticalAlignment ( VerticalAlignment valign )"
Sets the vertical alignment to \fIvalign\fR. Possible values are VAlignBaseline, VAlignSub or VAlignSuper.
.PP
The vertical alignment property is not inherited.
.PP
See also verticalAlignment().
.SH "void QStyleSheetItem::setWhiteSpaceMode ( WhiteSpaceMode m )"
Sets the whitespace mode to \fIm\fR.
.PP
See also WhiteSpaceMode.
.SH "QStyleSheet * QStyleSheetItem::styleSheet ()"
Returns the style sheet this item is in.
.SH "const QStyleSheet * QStyleSheetItem::styleSheet () const"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns the style sheet this item is in.
.SH "VerticalAlignment QStyleSheetItem::verticalAlignment () const"
Returns the vertical alignment of the style. Possible values are VAlignBaseline, VAlignSub or VAlignSuper.
.PP
See also setVerticalAlignment().
.SH "WhiteSpaceMode QStyleSheetItem::whiteSpaceMode () const"
Returns the whitespace mode.
.PP
See also setWhiteSpaceMode() and WhiteSpaceMode.
.SH "SEE ALSO"
.BR http://doc.trolltech.com/qstylesheetitem.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If you find a bug in Qt, please report it as described in
.BR http://doc.trolltech.com/bughowto.html .
Good bug reports help us to help you. Thank you.
.P
The definitive TQt documentation is provided in HTML format; it is
located at $TQTDIR/doc/html and can be read using TQt Assistant or with
a web browser. This man page is provided as a convenience for those
users who prefer man pages, although this format is not officially
supported by Trolltech.
.P
If you find errors in this manual page, please report them to
.BR qt-bugs@trolltech.com .
Please include the name of the manual page (tqstylesheetitem.3qt) and the Qt
version (3.3.8).
|