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

Version 1 Next »

Unknown macro: {alias}

Name

qaddlayout — add layout to another layout

Syntax

qaddlayout parentboxlayout childlayout [stretch]

qaddlayout parentgridlayout childlayout row column

qaddlayout parentgridlayout childlayout row column rowspan columnspan

Description

The qaddlayout command adds a layout to another layout according the layout policy of the receiving layout. This command is used when [nesting layouts].

Arguments

parentboxlayout

Unknown macro: {indent}

An instance of qhboxlayout or qvboxlayout. This is the layout that will contain the child layout to be added.

childlayout

Unknown macro: {indent}

The layout to be added to the parent layout. This can be any type of layout.

parentgridlayout

Unknown macro: {indent}

An instance of qgridlayout, acting as the receiving layout.

row

Unknown macro: {indent}

The row in the receiving qgridlayout where the child layout will be positioned.

column

Unknown macro: {indent}

The column in the receiving qgridlayout where the child layout will be positioned.

stretch

Unknown macro: {indent}

Stretch factor. An integer, this argument determines the layout's ability to stretch during resize. Use this to set preference to which layout(s) in a group should stretch. A value of 100 usually ensures that the given layout will be stretched rather than the other child layouts in the same containing layout.

Examples

Nested Layouts

set w [qwidget]
qsetwindowtitle "Nested Layouts"

# Main vertical layout for the toplevel window
set mainlayout [qvboxlayout $w]

set label [qlabel "<html>This label is added <em>directly</em> to the vertical layout</html>"]
qaddwidget $mainlayout $label

# Add OK and Cancel buttons in a separate horizontal layout
# Add this layout to main layout
set buttonlayout [qhboxlayout ]
qaddlayout $mainlayout $buttonlayout

set ok_button [qpushbutton OK]
qaddwidget $buttonlayout $ok_button

set cancel_button [qpushbutton Cancel]
qaddwidget $buttonlayout $cancel_button

qshow $w

The above example shows two buttons arranged in their own horizontal layout, which is added to the main vertical layout using the qaddlayout command.

  • No labels