当前位置:编程学习 > wap >>

QFileSystemModel的data(const QModelIndex &index, int role)方法何时,被谁调用?

将QFileSystemModel绑定QListView,然后当点击一个目录显示文件时,data()方法会被频繁调用好多次(4次左右,将一个目录下所有的文件名打印4次——log中显示),但是却找不到这个方法被谁调用。

在QListView的父类方法QAbstractItemViewPrivate::checkMouseMove()中找到一次调用,但也只找到这一处调用,其它还有什么地方调用呢  

请指导  谢谢~~

void QAbstractItemViewPrivate::checkMouseMove(const QPersistentModelIndex &index) {
//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 QFileSystemmodel
补充:移动开发 ,  Qt
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,