PDA

View Full Version : QTableView Question



kandalf
4th February 2007, 17:00
Hi guys, I have a question about QTableView. Is there any way of stretch rows to the minimum size programatically?
I attached 2 screenshots to show what I have and what I want to achieve.

The file current.jpg shows what I actually get when the window is shown (lower left corner), and the file wished.jpg shows what I want to get.

The point is the row height of the QTableView.

Thanx in advance.

Cheers.

jpn
4th February 2007, 19:02
Try this before attaching the model to the table view:


int height = tableView->fontMetrics().height();
tableView->verticalHeader()->setDefaultSectionSize(height);