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

前端 未结 10 2385
醉梦人生
醉梦人生 2020-12-01 10:09

I\'ve got a window full of QPushButtons and QLabels and various other fun QWidgets, all layed out dynamically using various QLayout objects... and what I\'d lik

10条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-01 10:38

    You can use a QStackedWidget. Put your button on the first page, a blank QWidget on the second, and change the page index to make your button vanish while retaining its original space.

提交回复
热议问题