Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要将 QTreeWidget 中列的宽度设置为固定大小。setColumnWidth() 似乎没有效果,这里给出的代码导致编译器错误“'headerView': is not a member of 'QTreeWidget'”。
我正在使用 Qt 4.7.4。
QHeaderView::resizeSection() 可能对你有用。尝试执行以下代码:
treeWidget->header()->resizeSection(index, width);