admin管理员组文章数量:1125898
When I use resizeColumnToContents() on QTableView in PyQt the column is well resized but unfortunately it is also frozen and not resizable/editable on GUI after. I would like to :
- either be able to make it resizable after calling this function with the mouse cursor,
- and to be able to set min/max limits for the length (not to make it more than 1000 pixels for example),
- or simply recode this function with min/max. Thank you very much
Example:
self.tableView.resizeColumnToContents(col_index, min_length=30, max_length=888)
or:
resizeMode = QHeaderView.ResizeMode.ResizeToContents|ResizableAfter
horizontal_header.setSectionResizeMode(resizeMode)
本文标签:
版权声明:本文标题:python - PyQt QTableView column with resizeColumnToContents() is not resizable on GUI after call - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736645385a1946089.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论