Hello,

I'm creating a database program, which contains one QTableWidget "tableSongs" that displays the whole data of a database.

It has 6 columns: 4 of them contain numbers, one contains text string and the last one contains sets of chars like "1A", "1B", "2A", "32G" or "111E" - it consists of a number (1-3 digits) and one upcase letter.

What I want to do is to add sorting and filtering functionality - columns with numbers should be sorted using numbers' value, column with strings - alphabetically and the last one like that: "1A" < "1B" but "9Z" < "19Z".

I thought that QSortFilterProxyModel would be a good class to use here.
I created second QTableWidget "tableSource" but didn't placed in on the window. I'm inserting rows and adding items to tableSource and I want QSortFilterProxyModel to show them in tableSongs after doing the sorting and filtering. But I have problems with doing so. Here is my code:

QSortFilterProxyModel *proxyModel = new QSortFilterProxyModel(this);
proxyModel->setSourceModel(tableSource.model());
tableSongs->setModel(proxyModel);
But it doesn't work. How should I correct it?