...
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
The label 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.
|
Example Label with pixmap shows a label with a pixmap.