Comment 2 for bug 1380467

Revision history for this message
-MK- (mk42) wrote :

What I got so far:

I can use sql to get the crates a specific trackId is in:
Select crate_id from crate_tracks where track_id = [track_id]

I think highlighting itself can only be done by TreeItemModel::data.
That means the TreeItemModel needs to know the Items which need to be highlighted. The data_path of the TreeItems stores the crate_id for crates so it would be sufficient to store some "QList<QString> highlightItemsDataPath" in TreeItemModel.

What I need:
1) some signal on selection change in the library-Table-View which gives the selected crateIds as QList<QString> or sth.
2) a new member highlightItemsDataPath in TreeItemModel which is a QList<QString> and stores the data_path's of TreeItems to be highlighted
3) a condition in TreeItemModel::data for role = QBackgroundRole to change the background (or something else) for the TreeItems with data_path in highlightItemsDataPath
4) a slot in TreeItemModel to set highlightItemsDataPath
5) some way to connect the signal of selection change (1) to the slot(4)