Hiding Qt widget and keeping widget space

In Qt 5.2 it is possible to do the following:

QSizePolicy sp_retain = widget->sizePolicy();
sp_retain.setRetainSizeWhenHidden(true);
widget->setSizePolicy(sp_retain);

I earlier posted the same solution here:

How to make a Qt widget invisible without changing the position of the other Qt widgets?

(which seems to be a duplicate of this question).

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)