Wiki Markup |
---|
{alias:qlabel}
h2. Name
*qlabel* — read only text field
h2. Syntax
{panel:|borderStyle=solid|borderWidth=1|bgColor=#FFFFAA}
*qlabel* \[_text_]
{panel}
h2. Description
The *qlabel* command creates a QLabel object. This widget shows a read-only text label or a pixmap. The text may be in HTML.
The label text may be set anytime using the [qsettext] command. To read the text use the [qtext] command.
A label may also show a pixmap instead of text. To set the pixmap use the [qsetpixmap] command.
h2. Arguments
_text_
{indent}The label text.
{indent}
h2. Examples
h3. Ex.1: Simple label
{anchor:Simple label}
{noformat:|borderWidth=1|bgColor=#eeeeee} |
Name
qlabel — read only text field
Syntax
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
qlabel [text] |
Description
The qlabel command creates a QLabel object. This widget shows a read-only text label or a pixmap. The text may be in HTML.
The label text may be set anytime using the qsettext command. To read the text use the qtext command.
A label may also show a pixmap instead of text. To set the pixmap use the qsetpixmap command.
Arguments
text
Examples
Ex.1: Simple label
Anchor | ||||
---|---|---|---|---|
|
No Format | ||||
---|---|---|---|---|
| ||||
set w [qwidget ]
qsetwindowtitle QLabel
qvboxlayout {
qlabel "My label"
}
qshow $w
{noformat}
!att:_img_cmd^simple_label.png!
Example +Simple label+ shows a toplevel window containing a QLabel as an only child.
h3. |
Example Simple label shows a toplevel window containing a QLabel as an only child.
Ex.2:
...
HTML
...
label
...
Anchor | ||||
---|---|---|---|---|
|
No Format | ||||
---|---|---|---|---|
| ||||
set w [qwidget ]
qsetwindowtitle QLabel
qvboxlayout {
qlabel "My <em>HTML</em> <b>label</b>"
}
qshow $w
{noformat}
!att:_img_cmd^html_label.png!
Example +HTML label+ shows a QLabel with HTML formatted text.
h3. |
Example HTML label shows a QLabel with HTML formatted text.
Ex.3:
...
Label
...
with
...
pixmap
...
Anchor | ||||
---|---|---|---|---|
|
No Format | ||||
---|---|---|---|---|
| ||||
set w [qwidget ]
qsetwindowtitle QLabel
qvboxlayout {
set l [qlabel ]
set pm [qpixmap c:/structured_points.xpm]
qsetpixmap $l $pm
}
qshow $w
{noformat}
!att:_img_cmd^qlabel_pixmap.png!
Example +Label with pixmap+ shows a label with a pixmap.
{pagebreak}
|
Example Label with pixmap shows a label with a pixmap.