We have to be careful with such weak association, as Qt isn't able here to know that width depends on other parameters (imageVisible, textVisible, indicatorImage.width...). Prefer modifying width by hand when needed, or add the dependency variables as parameters to the getIndicatorWidth function.