Qt Quick Components

RadioButton

A RadioButton is used in a list of items where only one item can be selected at a time. More...

  • List of all members, including inherited members
  • Properties

    Signals

    Detailed Description

    A radio button element consists of a radio button and a line of text. Only one item in a list may be selected at a time. Once an item is selected, it can be deselected only by selecting another item. Initial item selection may be set at the list creation. If not set, the list is shown without a selection.

    Using a radio button

    The following code creates a RadioButton list with three items in it. The platformExclusiveGroup property of all the radio buttons is 'group1' which is a CheckableGroup. This enforces that only one of the radio buttons can be selected at a time. Furthermore the item with the text '1' has the focus and the item with the text '2' is checked.

         CheckableGroup { id: group1 }
         Row {
             RadioButton {
                 id: button1
                 text: "1"
                 platformExclusiveGroup: group1
                 focus: true
             }
             RadioButton {
                 id: button2
                 text: "2"
                 platformExclusiveGroup: group1
                 checked: true
             }
             RadioButton {
                 id: button3
                 text: "3"
                 platformExclusiveGroup: group1
             }
         }

    Property Documentation

    checked : bool

    If a button is checked, checked is true. Otherwise it is false.

    See also Checkable.


    exclusiveGroup : variant

    Deprecated. Use platformExclusiveGroup instead.


    platformExclusiveGroup : QtObject

    Symbian:

    The exclusive group that this radio button belongs to. In an exclusive group, only one of the radio buttons can be selected at a time.

    See also CheckableGroup.


    pressed : bool

    Indicates that the user is pressing this radio button.

    See also clicked().


    text : string

    Symbian: The text that is shown beside the radio button.


    Signal Documentation

    RadioButton::clicked ()

    This signal is emitted if the button is pressed and then released.