Scrollbar not working in QTableView



  • Hi All
    I have a QTableView , I am using following code

    errorTableView = new QTableView();
    errorTableView->verticalHeader()->show();
    errorTableView->setSelectionBehavior(QAbstractItemView::SelectRows);
    /we can select multiple rows with ctrl click/
    errorTableView->setSelectionMode(QAbstractItemView::ExtendedSelection);
    errorTableView->horizontalHeader()->setResizeMode(QHeaderView::Interactive);
    errorTableView->horizontalHeader()->setStretchLastSection(true);
    errorTableView->resizeColumnsToContents();

    proxyModel = new QSortFilterProxyModel;;
    model = new QAbstractTableModel;
    proxyModel->setSourceModel(modell);
    errorTableView->setModel(d_proxyModel);
    errorTableView->setSortingEnabled(true);
    errorTableView->sortByColumn(0,Qt::AscendingOrder);
    if(errorTableView->horizontalHeader()) {
    errorTableView->horizontalHeader()->setSortIndicator(0,Qt::AscendingOrder);
    }

    In this case Horizontal scrollbar is not working



  • model = new QAbstractTableModel; is illegal
    errorTableView->resizeColumnsToContents(); before setting the model is useless

    What is wrong with the scroll bar? doesn't appear?



  • It appears , but I cannot move it further with mouse button and it is some how freezed



  • It appears , but I cannot move it further with mouse button and it is some how freezed and also it is visible when not required , when all the data is visible in the QTableView





  • It is not working . Any other suggestion


Log in to reply
 

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