Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

I want to change the position of Text on QCheckBox bottom.



  • Hi!

    My QT version is 4.8.7.
    My OS is CentOS7.

    I want to change the position of Text on QCheckBox bottom.

    example)
    ㅁ CheckBox

    -> i want ->


    CheckBox

    Please Help me!


  • Lifetime Qt Champion

    Hi
    Well you can get
    alt text

    by simply inserting a \n in front of the text.

    but if you want them aligned then you must subclass and draw it yourself.

    You might be able to use a QProxyStyle and the SE_CheckBoxContents but I recall on window
    the FusionStyle didn't ask for it, making it a no-go.

    A maybe far easier way is simply to have no text on the check box and then place it with a QLable in a layout
    to give same effect.

    alt text

    alt text



  • @mrjj
    ohhhhhhhhhhhhhh!!!!!
    thank you champion!!!!!
    I used QCheckBox and QLabel as a Vertical Layout to solve it.

    very thank you so much!!!!!!


Log in to reply