Qt Reference Documentation

QML ButtonRow Element

Provides a component for arranging a set of buttons in a row. More...

This element was introduced in Qt Quick Components 1.0.


Detailed Description

The ButtonRow component is a container for buttons and items with the checked property. It makes the child items equal-wide and arranges them in a horizontal row. RadioButton and checkable button components can be made mutually exclusive in a ButtonRow with the exclusive property. When you place Button and ToolButton components in ButtonRow, they form a row of seamless and segmented buttons.

Creating a ButtonRow

The code snippet below illustrates how to create a ButtonRow component that contains three buttons. The ButtonRow's exclusive property is not set, so it is true by default, and thus its child buttons are checkable. In addition, the 'b2' button is set to checked.

     ButtonRow {
         checkedButton: b2
         Button {
             id: b1
             text: "b1"

         Button {
             id: b2
             text: "b2"

         Button {
             id: b3
             text: "b3"

The screenshot below illustrates the result of the code snippet.

See also ButtonColumn.

Property Documentation

checkedButton : Item

Defines which button in the ButtonRow is checked.

exclusive : bool

Indicates whether or not the ButtonRow's buttons are mutually exclusive, that is, only one button can be checked at a time. If the exclusive value is true, the buttons are checkable and mutually exclusive; otherwise not.

The exclusive property is true by default.