Hi, I want to rearrange some columns of a QTableView after setting the QTableModel. I want to exchange column 1 with 2. How I can do that? :confused:
Thanks
Printable View
Hi, I want to rearrange some columns of a QTableView after setting the QTableModel. I want to exchange column 1 with 2. How I can do that? :confused:
Thanks
have a look at QHeaderView::swapSections.
Thank you!
Also have a look at QHeaderView::moveSection
QxTableView::QxTableView(QWidget *parent)
: QTableView(parent)
void QxTableView::moveSection(int from, int to)
{
verticalHeader()->moveSection(from, to);
}
void QxTableView::swapSections(int first, int second)
{
verticalHeader()->swapSections(first , second);
}