Ok thx, i've also found a very detailed solution on stackoverflow on how to use a parent above evrything to display a component on top.
I didn't know about the ToolTip component. i might endup using it since it has the same purpose as what I did but probably more efficient and more weird-case-proof. So thank you for your answser.
Can you please provide an example or something to follow? Because I am still a newbie at both Qt and QML.
Sorry for bothering you with my many questions.
as you can see in the code, I change the state of the delegate through the mouse area in the delegate (it's commented out in the code). I was using it to test the states, now I've noticed another thing; Whenever I collapse the parent Item and then expand it, the previous states are not saved....does this have to do anything with what you mentioned?
I eventually found a solution/workaround to the problem. I am posting it here if anybody ever needs it.
The new approach was to create a C++ model derived from QAbstractItemModel and reimplementing the necessary functions. This model is essentially a filtering proxy for Model_A and Model_B.
The filtering is implemented in QAbstractItemModel::getData() and the elements are exposed through a reimplementation of QAbstractItemModel::roleNames().
For this filtering proxy to change state when the underlying data changes the dataChanged() signals of the underlying models was connected to a method in the proxy model computing the correct index invoking emit dataChanged(index).
The QML delegate reuse was then implemented as follows:
// some rendering of Model_A
property var propertyDelegateB: model.propertyDelegateB
// mulitple properties possible
This worked for my use case as I needed only one element in the model. For multiple elements this approach might not be ideal.
Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.