QCheckBox indicator size is wrong after stylesheet was applied

1.1k views Asked by At

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.

0

There are 0 answers