Hi all!

I have a QTableView that is disabled, but I'd like the user to still be able to see the data in the view using the scroll bars. The problem is that since the view is disabled the scrollbars are disabled as well, so no scrolling is possible.

I have tried subclassing the view and installing an event filter in the scroll bar widgets so they can ignore the enabled change event, but with no success.

Qt Code:
  1. myTableView::myTableView(QWidget *parent)
  2. : QTableView(parent)
  3. {
  4. this->horizontalScrollBar()->installEventFilter(this);
  5. this->verticalScrollBar()->installEventFilter(this);
  6. }
  7.  
  8. bool myTableView::eventFilter(QObject *o, QEvent *e)
  9. {
  10. if(e->type()==QEvent::EnabledChange)
  11. return true;
  12. else return false;
  13. }
To copy to clipboard, switch view to plain text mode 

Is there a way to keep the scroll bars enabled while the QTableView is disabled?

Thanks a lot!