Fix invisible window with Qt 5.6

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

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.

Elvis Angelaccio
Elvis Angelaccio
Elvis Angelaccio
Ragnar Thomsen
Elvis Angelaccio
Review request changed

Status: Closed (submitted)

Change Summary:

Submitted with commit 2678cb9c7a07381e3ffb8a2107946cec53bf5909 by Elvis Angelaccio to branch Applications/16.04.
Loading...