[solved]get the index of a hiddencolumn



  • 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



  • what did you do to solve this problem?



  • 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 2=ui->tableView->currentIndex();
    int test;
    test=index.row();@ and it's not what i want so i used this code 2 = 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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.