Hi Tim, I attached a branch which should give you an idea of how I think the problem can be solved. Beware, I didn't test it and it's not complete (it doesn't adjust contentY yet), it's just to be used as a starting point.
In that branch I'm attaching some extra data to the flickable (using setProperty; but other methods, such a static QHash<QQuickFlickable*,HeaderData> are also possible -- I used setProperty because then I don't have to care about memory management):
- The original value of topMargin, before any header was bound to the flickable
- The number of headers currently bound to the flickable
This makes it easy to restore the flickable's margin once the last header detaches from it.
Please let me know if you'd like me to continue working on this branch, or if you'd like to take it over yourself, or if you completely disagree with this solution. I don't see any reason why something like this wouldn't work but, as I wrote, I didn't test it, so maybe I'm missing some big point.
Hi Tim, I attached a branch which should give you an idea of how I think the problem can be solved. Beware, I didn't test it and it's not complete (it doesn't adjust contentY yet), it's just to be used as a starting point.
In that branch I'm attaching some extra data to the flickable (using setProperty; but other methods, such a static QHash<QQuickFli ckable* ,HeaderData> are also possible -- I used setProperty because then I don't have to care about memory management):
- The original value of topMargin, before any header was bound to the flickable
- The number of headers currently bound to the flickable
This makes it easy to restore the flickable's margin once the last header detaches from it.
Please let me know if you'd like me to continue working on this branch, or if you'd like to take it over yourself, or if you completely disagree with this solution. I don't see any reason why something like this wouldn't work but, as I wrote, I didn't test it, so maybe I'm missing some big point.