Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display drop-down in column of QTableView and filter based on drop-down

Tags:

qt

I am newbie to Qt. I have to display a chunk of data in a QTableView and filter it column wise. For this I have used QSortFilterProxyModel, but as per requirement each column of the QTableView should have a drop-down list which shows unique values in that column. On selection of any of these values in the drop-down, only the rows having that particular value in the column should be displayed in the QTableView (Like you can do in Excel).

How would I implement this?

like image 512
john Avatar asked Sep 07 '25 04:09

john


1 Answers

I had the same issue a week ago I found a tutorial explaining how to do it. see link below http://programmingexamples.net/wiki/Qt/Delegates/ComboBoxDelegate

Now my problem is how to retrieve the value of a specific combobox. I think it is such a complex things to do in C++ and Qt display a combobox into a tableView. For being a web developer at first I can tell that web language are better suited to do thoses kind of things.

But still some time performance matter and I tried to do it in C++ with Qt but it is not as easy as it seems to be in Web language.