0

I would like to have a collapsable Widget like seen here. The Problem with the accepted solution for me: I want to dynamically change the content of the collapse-widget (adding / removing widgets while it is collapsed or expanded). The provided solution copies the content height on creation, and is thus not responsible as I need.

I already experimented a lot with Layout-SizeConstraint and Widget-Sizehints, but did not manage to adjust the solution there to be responsive.

How can I create a collapsable widget that allows for content size changes?

Erik Brendel
  • 683
  • 9
  • 23

1 Answers1

0

You should take a look at Qt Animation Framework.

This is for Widgets, but QML also has almost identical functionality. You just define different states (like, for example: "DEFAULT", "COLLAPSED", "EXPANDED") and transition animations (with easing curves, delays and other fancy stuff). If you have more questions regarding states and animation, let me know.

Rinat Veliakhmedov
  • 1,021
  • 1
  • 19
  • 36