I had a problem with QTableView widget: I need to horizontal scroll whole widget with headers, but standart scrolling scroll only content, but not headers.
Then I tried to add QScrollArea like this (this all in QDockWidget):
class matrix : public QScrollArea {
};
in constructor:
QVBoxLayout* layout = new QVBoxLayout(this);
tableView = new QTableView(this);
tableView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
tableView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
layout->addWidget(tableView);
this->setLayout(layout);
but it doesn't work properly: scrolling bar doesn't appear.
(sorry, if I break some rules - it's my first question here, and sorry for my bad english)