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

Cannot create global QFileSystemWatcher object

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 5.9.1
    • None
    • Windows 10 + MSVC 2015/2017 64

    Description

      Following demo code works fine with Qt 5.6.2, but causes crash with Qt 5.9.1 on Windows. 

      And it's fine to create QFileSystemWatcher  object as a local variable. 

       #include <QApplication>
      #include <QFileSystemWatcher>
      
      
      QFileSystemWatcher watcher;
      
      int main(int argc, char* argv[])
      {
          QApplication app(argc, argv);
      
          watcher.addPath("C:/QtTest");
      
          QStringList directoryList = watcher.directories();
          Q_FOREACH(QString directory, directoryList)
                  qDebug() << "Directory name" << directory <<"\n";
      
          QObject::connect(&watcher, &QFileSystemWatcher::directoryChanged, [] (QString const &) {
              QMessageBox::information(nullptr, "Directory Modified", "Your Directory is modified");
          });
      
          return app.exec();
      }
      
      

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            cong Cong Ma
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes