qsetpixmap - assign pixmap to QLabel

Name

qsetpixmap — assign pixmap to QLabel

Syntax

qsetpixmap pixmap

qsetpixmap label pixmap

Description

The qsetpixmap command assigns a pixmap to a label. The label may exist either as the current widget, or it may be provided as an argument. The pixmap object is created using the qpixmap command.

Arguments

pixmap

Pixmap object created using the qpixmap command.

label

QLabel object created with the qlabel command.

Examples

Ex.1: qsetpixmap

The following example shows how to assign a pixmap to a QLabel using the implicit and explicit syntax versions of qsetpixmap.

set w [qwidget]
qsetwindowtitle "Pixmaps"
qhboxlayout {
	qlabel
	set i [qpixmap "C:/Documents and Settings/cut.xpm"]
	qsetpixmap $i
	
	set l [qlabel]
	set i [qpixmap "C:/Documents and Settings/copy.xpm"]
	qsetpixmap $l $i

	qhspacer ; # Push pixmaps to the left
	
}
qshow $w