Fix invisible window with Qt 5.6

Review Request #127847 - Created May 5, 2016 and submitted - Latest diff uploaded

Information
Elvis Angelaccio
kcalc
Applications/16.04
360105
Reviewers
kdeutils

Since Qt 5.6, minimumSize() returns an empty size (QSize(0, 0)).

This cause an invisible main window in KCalc, due to a setFixedSize(minimumSize()) call.

This (new?) behavior is documented in the QWidget api, so it doesn't look like a bug in Qt.

The proper way to set a fixed size (based on the actual content) is to use QLayout::setSizeConstraint(), as suggested by the documentation of setFixedSize() itself.

KCalc is now visible again with Qt 5.6. The main window size is fixed as before.

Loading...