0

I want to clear all the widgets in a QHBoxLayout when click a button.How to solve this problem? Thanks!

Sander de Jong
  • 351
  • 6
  • 18
tao4yu
  • 316
  • 1
  • 5
  • 16
  • Do you want to remove all widgets from layout? – Sebastian Lange Mar 17 '14 at 08:37
  • yes,the widgets in the layout. – tao4yu Mar 17 '14 at 08:38
  • Did you read the documentation for `QBoxLayout`? Because there is a `removeWidget` method or a `takeAt` method which can be used to remove an item from the layout. There is no built-in method for removing all items. If you don't want to call `removeWidget` many times just replace the layout with a new instance. – Bakuriu Mar 17 '14 at 08:42
  • This might also come in handy: http://stackoverflow.com/questions/21213853/pyside-how-to-delete-widgets-from-gridlayout/21214247?noredirect=1#comment31969840_21214247 – three_pineapples Mar 17 '14 at 10:18

0 Answers0