[Qt-interest] How to move a QTableView column created through QSqlRelation

Harry Sfougaris hsfougaris at gmail.com
Fri Apr 23 12:13:55 CEST 2010


After populating my QTableView from an QSqlRelationalTableModel, I'm trying
to put the columns in a custom order.
I've been using the following code to do that:
 ui->tblView->horizontalHeader()->moveSection(myModel->fieldIndex("fieldName"),1);

However, I also have a column that is created after I set a relation on a
field.
The lookup column (combo box) is placed at the end of my columns, and I
can't seem to access it.(i tried using moveSection with all possible
numbers, 0 to number of fields+1)

Is there another way of accessing and moving it where you want?

Thanks,
Harry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100423/08e1d65d/attachment.html 


More information about the Qt-interest-old mailing list