QFileSystemModel的data(const QModelIndex &index, int role)方法何时,被谁调用?
将QFileSystemModel绑定QListView,然后当点击一个目录显示文件时,data()方法会被频繁调用好多次(4次左右,将一个目录下所有的文件名打印4次——log中显示),但是却找不到这个方法被谁调用。在QListView的父类方法QAbstractItemViewPrivate::checkMouseMove()中找到一次调用,但也只找到这一处调用,其它还有什么地方调用呢
请指导 谢谢~~
void QAbstractItemViewPrivate::checkMouseMove(const QPersistentModelIndex &index) {Qt QFileSystemmodel
//we take a persistent model index because the model might change by emitting signals
Q_Q(QAbstractItemView);
setHoverIndex(index);
if (viewportEnteredNeeded || enteredIndex != index) {
viewportEnteredNeeded = false;
if (index.isValid()) {
emit q->entered(index);
#ifndef QT_NO_STATUSTIP
QString statustip = model->data(index, Qt::StatusTipRole).toString();
......
}
补充:移动开发 , Qt