qsetmargin - set layout margin

Name

qsetmargin — set layout margin

Syntax

qsetmargin [layout] margin

Description

The qsetmargin command sets the layout margin in pixels. This is the space between the layouts outer border and the interior in which the widgets are contained. If a layout object is not provided as an argument, the current layout will be used. The layout object may be a qvboxlayout, a qhboxlayout, or a qgridlayout.

Arguments

layout

The layout in which the margin will be set.

margin

Margin space in pixels.

Examples

Ex.1: Layout with margin

set w [qwidget]
qsetwindowtitle "Layout margin"

# Main layout
set layout [qhboxlayout $w]


# Create groupbox inside main layout
set groupbox [qgroupbox "Group Box"]

qaddwidget $layout $groupbox

# Create layout inside group box with 20 pixel margin
set grouplayout [qhboxlayout $groupbox]
qsetmargin $grouplayout 20

# Add label inside groupbox
set label [qlabel "Hello"]
qaddwidget $grouplayout $label

qshow $w