Change size of radiobutton Qt Quick Controls 2



  • Hello,

    I am wondering if it's possible to change the size of the RadioButton in QML in the Qt Quick Controls 2 library.
    Previously I used the Version 1 of the Qt Quick Controls library. All the components where smaller in version 1.

    I know it's possible to change the 'unselected' circle like this:

    RadioButton {
    	text: "Round X, -90 degr."
    	ButtonGroup.group: tabRotationGroup
    	Layout.preferredHeight: 15
    	indicator.height: 10
    	indicator.width: 10
    	onClicked:{ currentRotationIndex = 2 }
    }
    

    But the 'selected' circle is still big, it looks like this:

    RadioButtonBadExample

    Can someone help me? It looks really terrible...

    Kind regards,

    Koen



  • @koeniee Open the RadioButton.qml file in your Qt installation directory qml/QtQuick/Controls.2/. You can see that the indicator item is implemented with RadioIndicator type. Open RadioIndicator.qml. Now you can copy it to your own RadioButton and customize it.


  • Qt Champions 2016

    @koeniee said in Change size of radiobutton Qt Quick Controls 2:

    Previously I used the Version 1 of the Qt Quick Controls library. All the components where smaller in version 1.

    are you developing for mobile platforms ?
    then it's recommended to have controls your users can easy touch. It's a common mis-design in mobile apps that controls are too small or don't have enough space around.
    a good explanation: https://www.smashingmagazine.com/2012/02/finger-friendly-design-ideal-mobile-touchscreen-target-sizes/



  • No i am not developing for Mobile Platforms. I will customize the RadioButton Identicator.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.