PDA

View Full Version : QTableView empty view



zgulser
3rd December 2013, 12:23
Hi,

I have a table view. When no items exist, I want to show a message in the center of the table view like "No items". As far as I researched, there is no empty view widget inside QTableView. Any ideas for a possible workaround?

stampede
3rd December 2013, 13:40
Have you tried to subclass QTableView, reimplement paintEvent and render this text if your model contains no items ?

zgulser
3rd December 2013, 13:47
Yeah sorry to not mention. I thought about it but just wanted to check if there would be an easier solution.

This might be a good improvement as well if qt supports such embedded empty view for tables & lists for future releases.