Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-30714

QFileSystemModel does not update when the contents of a file changes (file size)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P3: Somewhat important
    • None
    • 4.7.4
    • Widgets: Itemviews
    • None
    • Linux and Windows

    Description

      When I create new files, QFileSystemModel picks up the changes (touch NewFile). However if I change the contents of a file, the view does not get updated (echo "foobar" > NewFile).

      The QFileSystemWatcher does not emit the directoryChanged signal when a file has been modified. The documentation reads: "This signal is emitted when the directory at a specified path, is modified (e.g., when a file is added, modified or deleted) or removed from disk."

      Test case main.cpp to reproduce issue
      ====================================
      #include <QtGui>

      class TreeView : public QTreeView
      {
      Q_OBJECT
      public:
      TreeView(QWidget *parent = NULL) : QTreeView(parent)

      { QFileSystemModel *model = new QFileSystemModel(this);; model->setRootPath("/"); setModel(model); setRootIndex(model->index(QDir::currentPath())); }


      };

      #include "main.moc"

      int main(int argc, char **argv)
      {
      QApplication a(argc, argv);
      TreeView w;
      w.show();
      return a.exec();
      }

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              menard Alexis Menard (closed Nokia identity) (Inactive)
              christophermeacham Christopher Meacham
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes