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

Harry Sfougaris hsfougaris at gmail.com
Sat Apr 24 22:36:06 CEST 2010


Can someone please help with this?
Thanks,
Harry

On Fri, Apr 23, 2010 at 1:13 PM, Harry Sfougaris <hsfougaris at gmail.com>wrote:

>
> 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/20100424/0b14f166/attachment.html 


More information about the Qt-interest-old mailing list