Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
Wiki Markup
{alias:qsetspacing}
h2. Name

*qsetspacing* — set spacing between widgets in a layout

h2. Syntax
{panel:|borderStyle=solid|borderWidth=1|bgColor=#FFFFAA}

*qsetspacing* \[_layout_] _spacing_ 

{panel}

h2. Description

The *qsetspacing* command sets the spacing between the widgets in the layout object. 

h2. Arguments

_layout_
{indent}The target layout. This may be a [QGridLayout], [QVBoxLayout], [QHBoxLayout]. If no layout object is provided the current layout is used. 

Another frequently used layout modifier is [qsetmargin]. 
{indent}

_spacing_
{indent}Margin space in pixels. 

{indent} 

h2. Examples

h3. Ex.1: Layout with spacing
{anchor:Layout with spacing}

{noformat:|borderWidth=1|bgColor=#eeeeee}

Name

qsetspacing — set spacing between widgets in a layout

Syntax

Panel
bgColor#FFFFAA
borderWidth1
borderStylesolid

qsetspacing [layout] spacing

Description

The qsetspacing command sets the spacing between the widgets in the layout object.

Arguments

layout

spacing

Examples

Ex.1: Layout with spacing

Anchor
Layout with spacing
Layout with spacing

No Format
bgColor#eeeeee
borderWidth1
# explicit layout with spacing
set w1 [qwidget ]
qsetwindowtitle "Layout Spacing"
set layout [qhboxlayout $w1]
qsetspacing $layout 30
set label [qlabel "<---------->"]
qaddwidget $layout $label
set label [qlabel "<---------->"]
qaddwidget $layout $label
qshow $w1

# implicit layout with spacing
set w1 [qwidget ]
qsetwindowtitle "Layout Spacing"
qhboxlayout {
	qsetspacing 30
	qlabel "<------------>"
	qlabel "<------------>"
}

qshow $w1

{noformat}

!att:_img_cmd^qsetspacing.png!

The arrows displayed in the example above would usually have been aligned immediately next to each other. Now that the layout has its spacing parameter set the spacing too will be accordingly. 


{pagebreak}

Image Added

The arrows displayed in the example above would usually have been aligned immediately next to each other. Now that the layout has its spacing parameter set the spacing too will be accordingly.