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

Enable rich text format for QRadioButton - how?



  • Hello, all.

    I saw there is a similar topic posted almost an year ago, but the final answer is too generic. I saw a Qt user has struggled with exactly the same issue and has come up with a QStyle-based solution. Translated the latter from Python to C++ but it lacks correct size hint management - the custom QStyle's size for contents function doesn't use QTextDocument for obtaining the correct size hint. My wondering here about the size hint is also whether the custom QStyle's size hint suffices for the calculation of the QRadioButton's one but should look again into the sources. Is there any better and more integrated way of enabling rich text in QRadioButton and not only - QComboBox, QPushButton, etc.?


Log in to reply