Qt Quick Components

ToolBarLayout

ToolBarLayout is a container for items on a toolbar that automatically implements an appropriate layout for its children. More...

  • List of all members, including inherited members
  • Properties

    Methods

    Detailed Description

    Using the ToolBarLayout

    You use a ToolBarLayout when you specify the tools that go into a tool bar. The toolbar layout container lays out the tools appropriately for the platform.

    The code snippet below gives an example of how to use a ToolBarLayout.

    ### needs to come from a real application

     // Create a tool bar
     ToolBar {
         id: bar3
         anchors.bottom: parent.bottom
         // Inside a toolbar layout, specify one toolbar tool and the back button
         tools: ToolBarLayout {
             backButton: true
             ToolButton {
                 iconSource: "qrc:tb_plus.png"
                 onClicked: stack.pop()
             }
         }
     }

    Property Documentation

    backButton : bool

    This determines whether or not the first child is a back button. The back button always occupies the leftmost space in layout. If there is no backbutton this space is always empty.


    Method Documentation

    ToolBarLayout::buttonWidth ( child )

    Returns the width of the given child button in the toolbar layout.


    ToolBarLayout::layoutChildren ()

    Applies the layout rules to the buttons in the toolbar.

    In the case of a Symbian toolbar, the layout rules are as follows:

    1. The BackButton occupies the leftmost space separate with margin in landscape if there is no backbutton the space is left empty
    2. last icon button occupies rightmost space. If there is no rightmost iconbutton the space can be use for something else
    3. If the remaining items are text buttons, they are distributed around the center of empty space in the middle of toolbar
    4. If the remaining items are iconbuttons the they are distributed evenly along the toolbar area