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 4 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

childlayout

parentgridlayout

row

column

stretch

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