Hi there,

I'm trying to understand the logic that Qt is used for initial minimum size calculation during layouting in buttons with style sheets.

Things are best shown in an example, see attached mini-project.

ButtonStyleIssueTest.zip

Try starting the dialog with `bool initiallyEnabled = false;` or `bool initiallyEnabled = true;` in Dialog.cpp


The style defines appearance of push buttons (among other things). The button has extra space around when in enabled state.

What happens now is that the standard push buttons (with horizontal size policy "minimum") appear to calculate the minimum size hint on first show, with the state set then und the style that applies at this point. However, when the state of the button changes, the sizehint is not updated, even though the style demands it.

Two questions:

a) is my analysis correct, or what would be the behavior of Qt here?
b) what is the best way to prevent/fix this problem?

Thanks,
Andreas