[solved]get the index of a hiddencolumn
-
wrote on 7 May 2014, 12:31 last edited by
hello
so i used a qtableview to show the data in a table of database when the data show a column be hide but the poblem that i want to get the index of the hidden column if it's possible -
wrote on 7 May 2014, 18:45 last edited by
what did you do to solve this problem?
-
wrote on 8 May 2014, 18:45 last edited by
hello Overtime
so firstly the column that i want not to show i hide it by using @setColumnHidden(0,true);@
the problem was that when the user select a row the index that i get it's the index of the second column and not of the first column that i hidde so to solve the problem i Followed this steps i create a @QModelIndex index
@ this index will contain the index of the second column @index=ui->tableView->currentIndex();
int test;
test=index.row();@ and it's not what i want so i used this code @index = index.sibling(test, 0);@ to post the number of column that i want and here it's 0 also to post the the row value here it's test
hoppe that's help you
1/3