0

I'm trying to set a custom style to a group of options belonging to a dropdown or a Radio Group. I'm searching all over and it seems impossible. At least I would like to decrease the size of the letters in the text of each option because is too big! and crashes my UI.

Here's and example of what I need:

RadioGroup {
 id: groupOrigin
 objectName: "groupOrigin"

 Option{
   text: "text to display" 
   //This text default style is what I'm trying to change. Please help!.
 }
}

thanks!

mariomunera
  • 323
  • 1
  • 4
  • 18

1 Answers1

0

for Radio group you can achieve this using custom implementation. Take a label and place it after the radio group did not provide text inside the options tag. So whatever style you want to apply can be done using label.

On label you can set the font size, color and other style parameter you want to apply.

Please check the source code below for this custom radio button. I did this in the QML you can achieve same in C++.

// The Component title.
    Label {
        id: titleLabel
        text: ""
        textStyle {
            base: SystemDefaults.TextStyles.SmallText
            alignment: TextAlignment.Center
        }
        layoutProperties: StackLayoutProperties {
            horizontalAlignment: HorizontalAlignment.Fill
        }
    }

    // The radio group presenting the different curves.
    RadioGroup {
        id: radioGroup

        Option {
            text: "Height"
        }
    }
Megha
  • 1,581
  • 2
  • 18
  • 33
  • Hi @Megha , thanks for answering. But I don't quite understand your point. Do you mean to set all the options and then, below, set a label for each option that I already stablished before? If it's that, how should I know the exact position to set each label in order to be aligned with the radioGroup option? Besides, I should add that unfortunately I'm supposed to make this happening from C++. – mariomunera Nov 17 '12 at 19:47
  • Hi, I am talking that Label then radio group. By arranging this way you can achieve. – Megha Nov 20 '12 at 10:31