Search code examples
qtscrollsmooth-scrollingqtablewidget

Can we make QTableWidget to smooth scroll its content?


I have a QTableWidget displayed rows with different height. It cause the scrolling behaviour looks jumpy. I think even if all the rows were in the same height, the scrolling is also not smooth.

Haven't found an answer to this issue (or maybe it was just a bad google day). Any suggestions?


Solution

  • tableWidget->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);

    The same goes for horizontal scroll mode.

    If you're using QDesigner (or the one built in QtCreator), you can set this property on the QTableWidget in its properties.