Question

I'm using tablemodel with vertical scrollbar and want to keep the scrollbar always enabled no matter what status the table is.

Perhaps its possible to disable all flags for table or docking the scrollbar on the right side of the table.

Was it helpful?

Solution

If you're using QAbstractTableModel, you can reimpliment the flags() member function to return a read-only flag.

Have a look at the Qt::ItemFlags to see which ones you need and then leave off what you don't. At the very least, you should not be returning Qt::ItemIsEditable

OTHER TIPS

We had this issue with QScrollArea and solved it manually (eventually subclass and reimplement setEnabled).

area->setDisabled(false);
foreach(QWidget *w, area->findchildren<QWidget*>())
{
    w->setDisabled(true);
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top