gpt4 book ai didi

c++ - 如何在 QHeaderView 中实现委托(delegate)

转载 作者:行者123 更新时间:2023-11-28 00:55:05 24 4
gpt4 key购买 nike

我使用 QTableview 和 QAbstractTableModel 创建了一个表。我使用 QHeaderView 添加了一些垂直标题。在其中一个标题单元格中,我想使用委托(delegate) ..

我正在使用委托(delegate),但它没有任何影响..

我哪里做错了吗?

最佳答案

我自己也遇到过这个问题。来自 Qt documentation 的答案很简单也很烦人:

Note: Each header renders the data for each section itself, and does not rely on a delegate. As a result, calling a header's setItemDelegate() function will have no effect.

换句话说,您不能将委托(delegate)与 QHeaderView 一起使用。

关于c++ - 如何在 QHeaderView 中实现委托(delegate),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11895388/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com