MeeGo 1.2 Harmattan Developer Documentation Develop for the Nokia N9

QML ToolBarLayout Element

container for items shown in toolbar. More...

Inherits Item

This element was introduced in qt-components 4.7.

Detailed Description

This component can be attached to the tools property of the ToolBar. ToolBarLayout is a container for other components supposed to appear in a ToolBar and automatically gives an appropriate layout to them.

Using the ToolBarLayout is optional as you can use any item for the toolbar but it simplifies the layout of some common differences between portrait and landscape modes.

By default, items are positioned evenly spaced and vertically aligned using their implicit size. Some components such as TextField and ButtonRows will expand to fill the remaining available space on the tool bar.

Some basic use cases:

Single left aligned back button

 ToolBarLayout { ToolItem{} }

Single right aligned menu button

 ToolBarLayout { Item{} ToolItem{} }

Two tool buttons

 ToolBarLayout {ButtonRow{ ToolButton{} ToolButton{}}}

Two Tab buttons

 ToolBarLayout {ButtonRow{ TabButton{} TabButton{} }}