How to disable QTableWidget scrolling to selected cell?

后端 未结 2 364
-上瘾入骨i
-上瘾入骨i 2021-01-23 11:05

Currently, if the user clicks on a cell that is only partially visible, the window automatically scrolls over so that the cell is fully displayed. Is there any way to stop the t

2条回答
  •  执念已碎
    2021-01-23 11:20

    You can easily disable this behavior with:

    ui->tableWidget->setAutoScroll(false);
    

    alexisdm's answer is dealing with another problem. Suppose you are incrementally appending new rows to your table and you want to maintain current vertical scroll position. I am dealing with this second problem and alexisdm's answer seems promising.

提交回复
热议问题