I eventually found a solution/workaround to the problem. I am posting it here if anybody ever needs it.
The main issue it seems is wanting to filter the C++ model in QML/JavaScript. Getting elements out of the C++ model into QML seems to be possible as a returning a QVariantMap maps to a JS object in the QML engine. Using this returned object as a model proved not to work directly. This might work with further effort but due to time constraints this approach was abandoned.
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:
Rectangle {
// some rendering of Model_A
Repeater {
delegate: Delegate_B{}
model:
Item{
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.