Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.4.2, 5.8.0
-
None
-
Tested on win7 64bit, Qt 5.8 and win10 64bit, Qt 5.4.3
Description
When a QTableWidget only has only 1 column, and header property SectionResizeMode
set to QHeaderView::ResizeToContents, property HorizontalScrollMode set to QAbstractItemView::ScrollPerItem,
then insert a row has long text.
Expect: There should appear a horizontal scrollbar so user can read all content in the column.
Actual Happened: No horizontal scrollbar appear, although the column width be resize to content, no way to see them...
a possible solution for this:
QTableWidget* tw = ui->tableWidget; tw->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
Just set HorizontalScrollMode to QAbstractItemView::ScrollPerPixel.
The same bug reported for QTableView on Qt 4.8, see QTBUG-27993.
Test case uploaded as a rar file.
I understand the reason of this, the mode ScrollPerItem behaviour is undifined when only 1 column exists. Please fix it, maybe update the document or code, thanks a lot.