class RUI::GuiBuilder::Layout

A widget layout.

Two orientations are supported: horizontal and vertical. The orientation is controlled by the type attribute of this descriptor.

A margin can also be specified using the margin attribute.

Public Instance Methods

create_element(window, parent, desc) click to toggle source
# File lib/rui/toolkits/qtbase/gui_builder.rb, line 191
def create_element(window, parent, desc)
  factory = if desc.opts[:type] == :horizontal
    Qt::HBoxLayout
  else
    Qt::VBoxLayout
  end
  layout = factory.new
  layout.margin = desc.opts[:margin] if desc.opts[:margin]
  parent.add_layout(layout)
  layout
end