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

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

XMLWordPrintable

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

      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();
      }

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes