Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does 'bottomRight' mean when using dataChanged() with a QTreeView in Qt?

Tags:

c++

qt

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.

What does bottomRight exactly mean?

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

like image 440
sake Avatar asked Mar 19 '15 09:03

sake


1 Answers

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.

Code:

// update the whole tree views.
emit dataChanged(QModelIndex(), QModelIndex());
like image 191
sake Avatar answered Oct 13 '22 00:10

sake