Actually it would be better to also highlight playlists in which the selected track is included. So maybe that way:
1) some signal on selection change in the library-Table-View which gives the selected trackId
2) a new member highlightTrackId in TreeItemModel which stores the id of the track to be highlighted
3) a condition in TreeItemModel::data for role = QBackgroundRole to change the background (or something else) for the TreeItems whose child-models contain highlightTrackId
4) a slot in TreeItemModel to set highlightTrackId
5) some way to connect the signal of selection change (1) to the slot(4)
Actually it would be better to also highlight playlists in which the selected track is included. So maybe that way:
1) some signal on selection change in the library-Table-View which gives the selected trackId
2) a new member highlightTrackId in TreeItemModel which stores the id of the track to be highlighted
3) a condition in TreeItemModel::data for role = QBackgroundRole to change the background (or something else) for the TreeItems whose child-models contain highlightTrackId
4) a slot in TreeItemModel to set highlightTrackId
5) some way to connect the signal of selection change (1) to the slot(4)