PDA

View Full Version : Display contents of list widget based on a RegEx



SirSharpest
15th January 2016, 23:22
Hello all,

My first time posting here so I hope I'm asking properly.

I'm attempting to make my own music player though the QT frame work. Everything so far has been going very well and I have found a lot of great resources on the internet.

My issue has now become displaying 3 separate list boxes (Artist, Album, Track). I am wondering if there is a straightforward way for me to change the contents of the boxes based on a RegEx of string matching.

i.e. if I click on the artist list and select "artist1" then I want the other boxes to only show items which data matches "artist1".

In addition to this I am wondering is there a easy method that is essentially "click to update" other lists?

Many thanks for any responses!

anda_skoa
16th January 2016, 09:33
You could use a QSortFilterProxyModel to filter the actual model, or implement the filter in the model itself.

Cheers,
_