Foundation and layout
Container
Native Qt
Aspect Ratio
Aspect Ratio is a native Zui container in the foundation and layout catalog, with 5 component-specific properties.
Usage
Ruby example
Paste this complete Builder example inside the app surface from the Quickstart. Replace illustrative asset paths with files from your project.
aspect_ratio ratio: 16.0 / 9, width: 640, clip: true do
image "assets/preview.jpg", fill_mode: :preserve_aspect_crop
end
API
Component properties
5 component-specific values, plus shared item and layout properties.
ratioRatio configuration for Aspect Ratio.propertywidthWidth configuration for Aspect Ratio.propertyheightHeight configuration for Aspect Ratio.propertyclipClip configuration for Aspect Ratio.propertyvisibleVisible configuration for Aspect Ratio.propertyShow 14 shared item properties
enabledopacityscalerotationzfill_widthfill_heightpreferred_widthpreferred_heightminimum_widthminimum_heightmaximum_widthmaximum_heightlayout_alignment
Interaction
Events
Subscribe with on widget, :event and keep behavior in Ruby.
↗
clickNative event payload