Unsolved Scrollbar not working in QTableView
-
Hi All
I have a QTableView , I am using following codeerrorTableView = 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 uselessWhat 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
-
Try explicitly setting the policy http://doc.qt.io/qt-5/qabstractscrollarea.html#horizontalScrollBarPolicy-prop
-
It is not working . Any other suggestion