“清爽” QT 模型中的列标题名称
有谁知道如何“刷新”QT 中的列名称(列标题)?
我的代码在某些情况下会更改列的名称。
model_ptr->header_list.replace( 1, "Bank #" );
另一个例子:
model_ptr->header_list.replace( 1, "Credit Union #" );
但是,只有当我实际单击列标题以按该列排序时,才会刷新。我希望它无需单击列标题即可更新。
Does anyone know how you "refresh" the names of the columns (the column headers) in QT?
I have code that, in certain cases, changes the name of a column.
model_ptr->header_list.replace( 1, "Bank #" );
Another example:
model_ptr->header_list.replace( 1, "Credit Union #" );
However this is only being refreshed when I actually click on the column header to sort by that column. I would like it to update without having to click on the column header.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用模型的
方法应该会导致视图更新。假设您的视图的标头连接到模型的
headerDataChanged()
信号。Using the model's
method should cause the view to update. Assuming your view's header is connected to the model's
headerDataChanged()
signal.