0

I created an own checkbox class from QCheckBox class. In my implementation I use size of checkbox indicator and checkbox label spacing for my internal algorithms.

I get sizes like this:

// Checkbox indicator size.
style()->subElementRect(QStyle::SE_CheckBoxIndicator, &option);

// Checkbox label spacing size.
style()->pixelMetric(QStyle::PM_CheckBoxLabelSpacing, &option);

For standard widget it works OK. But when I apply qss on my widget with custom indicator icon with another size, I still get standard values, instead of qss one.

How can I get a correct values for styled widget? I am using Qt 4.6.

Mykola Niemtsov
  • 540
  • 1
  • 7
  • 23
  • not enough code. What are you tying to achieve/change? Why style sheet is not enough? – Marek R Mar 11 '14 at 12:46
  • 1
    Don't use QSS. Because `QStyle` does not support a lot of features of QSS. See this answer: http://stackoverflow.com/questions/19138100/how-to-draw-control-with-qstyle-and-with-specified-qss – Dmitry Sazonov Mar 11 '14 at 13:25

0 Answers0