Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Current »

Name

qlabel — read only text field

Syntax

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

set w [qwidget ]
qsetwindowtitle QLabel
qvboxlayout {
	qlabel "My label"
}
qshow $w

Example Simple label shows a toplevel window containing a QLabel as an only child.

Ex.2: HTML label

set w [qwidget ]
qsetwindowtitle QLabel
qvboxlayout {

	qlabel "My <em>HTML</em> <b>label</b>"
}
qshow $w

Example HTML label shows a QLabel with HTML formatted text.

Ex.3: Label with pixmap

set w [qwidget ]
qsetwindowtitle QLabel
qvboxlayout {
	set l [qlabel ]
	set pm [qpixmap c:/structured_points.xpm]
	qsetpixmap $l $pm
}
qshow $w

Example Label with pixmap shows a label with a pixmap.

  • No labels