QTableWidget setColumnWidth didn't work in Qt6, but work in Qt5
-
In Qt6(6.6.1), if I use setStyleSheet, the setColumnWidth didn't work. but in Qt5(5.11.2), it works well.
here is the code.
setColumnCount(2)
setStyleSheet("QTableView { border:none; background:transparent;}")
setColumnWidth(0, 30)
setColumnWidth(0, 60)I try to use ResizeMode.ResizeToContents, ResizeMode.Fixed, they didn't work.
So is it an issue or is there a way to set the column width in QSS?
-
Hi and welcome to devnet,
Which OS are you on ?
-
Upgrade to a more recent version: https://bugreports.qt.io/browse/QTBUG-122109