RadioButton in qml
Unsolved
QML and Qt Quick
-
Hi,
I am trying to create a RadioButton in qml as shown below:
import QtQuick 2.12 import QtQuick.Templates 2.12 as T import QtQuick.Controls 2.12 import QtQuick.Controls.impl 2.12 import QtQuick.Layouts 1.14 import QtQuick.Controls.Styles 1.4 T.RadioDelegate { RadioButton { id: r1 checked: true text: qsTr("Option one") } RadioButton { id: r2 text: qsTr("Option two") anchors.top: r1.bottom } RadioButton { id: r3 text: qsTr("Option three") anchors.top: r2.bottom } }
In this i am trying to change the background color of radio button can anyone suggest how to do that?
-
@QtQmlLearner the Qt documentation has a section on customising controls, including RadioButton. The general idea is to create your own custom derived type and use that in place of the built-in type.
https://doc.qt.io/qt-5/qtquickcontrols2-customize.html#customizing-radiobutton