PDA

View Full Version : QTablaView::hiderow(int ) won't work



ottoshmidt
15th May 2011, 22:46
QSqlTableModel *model;
model = new QSqlTableModel;

model->setTable("clientcategory");
model->select();

ui->tableView->setModel(model);

ui->tableView->hideRow(0);


Does't really hide that row? :(

ChrisW67
16th May 2011, 04:19
Sure it does.

Now try to explain what you expected to see, what you actually saw, and why you think they are different.

ottoshmidt
16th May 2011, 17:36
ups I put it wrong, I wanted to say when a tableview is attached to combobox, suppose like this:

model->setTable("legaltype");
model->select();
QTableView *view1;
view1 = new QTableView;
ui->combobox->setModel(model);
ui->combobox->setView(view1);
view1->hideColumn(0);
;

first column is hidden (index 0). The height of a drop-down table becomes the size of a combobox height itself (no matter the size of combobox height), so that only Column Headers are visible... and this happens only when the firsts (0 index) column is hidden. For any other column hidden everything goes fine.