在Qt中将dataChanged()与QTreeView一起使用时,"bottomRight"是什么意思? [英] What does 'bottomRight' mean when using dataChanged() with a QTreeView in Qt?

查看:178
本文介绍了在Qt中将dataChanged()与QTreeView一起使用时,"bottomRight"是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当使用 QTableView dataChanged(const QModelIndex& topLeft,const QModelIndex& bottomRight) signal时,很容易理解topLeft和bottomRight QModelIndex.当将 dataChanged() QTreeView 一起使用时,我会与 bottomRight 混淆.

It's straight forward to understand the topLeft and bottomRight QModelIndex when using dataChanged(const QModelIndex & topLeft, const QModelIndex & bottomRight)signal with a QTableView, but I'm confused with bottomRight when using dataChanged() with a QTreeView.

bottomRight 到底是什么意思?

我是否可以只通过一次发出datachanged()信号来更新整个树形视图?

Can I update the whole tree view by just emit datachanged() signal once?

推荐答案

模型中的 dataChanged()信号将更新视图.代码 emit dataChanged(QModelIndex(),QModelIndex())将更新整个树视图.树视图的 update()的调用不起作用.

The dataChanged() signal from a model updates the view. The code emit dataChanged(QModelIndex(), QModelIndex()) will update the whole tree view. The call of tree view's update() doesn't work.

代码:

// update the whole tree views.
emit dataChanged(QModelIndex(), QModelIndex());

这篇关于在Qt中将dataChanged()与QTreeView一起使用时,"bottomRight"是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆