Questions tagged [qfilesystemwatcher]

A QFileSystemWatcher is a class from the Qt toolkit which provides an interface for monitoring files and directories for modifications.

QFileSystemWatcher monitors the file system for changes to files and directories by watching a list of specified paths.

It emits signals whenever a file has been modified, renamed or removed from disk, or when a directory or its contents is modified or removed.

The official Qt documenation can be found here for Qt 4.8 or here for Qt 5.

47 questions
10
votes
2 answers

Qt: check if a file in folder is changed

There any way to trigger an action if a file in a specified directory ( or in a subfolder ) without fetching all modification times every time ? I'm asking because i've to check this live
Lwyrn
  • 1,821
  • 1
  • 16
  • 27
5
votes
2 answers

Qt QFileSystemWatcher on Windows

I have the following issue: I create a QFileSystemWatcher and it runs and works nicely on Linux, but no way on Windows 7. Can you spot anything in the code that might make it not to work? Thx. Here is the code to initialize it: mConfigChangeWatcher…
Ferenc Deak
  • 34,348
  • 17
  • 99
  • 167
3
votes
2 answers

QFileSystemWatcher: Detect if file has been flushed

I have a QT app that needs to know when new data is available in a specific file. So I used QFileSystemWatcher and connected the fileChanged signal to a function that will send a message in case of changes. The probelm is that the fileChanged signal…
user3114639
  • 1,895
  • 16
  • 42
3
votes
1 answer

How to know that a file was opened ? QT

I want to know if a file was opened by user for reading (double click or open with ...), I am coding a C++ application with Qt Creator on Windows, after some research I found QFileSystemWatche, but it let me know only if a change was happened in…
Oumaya
  • 655
  • 4
  • 18
  • 43
2
votes
0 answers

Qt device watcher?

Because of the problem I am experiencing described here Cannot use keyboard within Qt app without sudo and here Qt embedded linux event watcher I was wondering either there is in Qt, an event watcher? I Have found library named QFileSystemWatcher…
Łukasz Przeniosło
  • 2,725
  • 5
  • 38
  • 74
2
votes
1 answer

QFileSystemWatcher does not emit fileChanged() in console application

in my files console.h/.cpp i have a small class which just asks the user to type in some text and then just prints the text again until the user enters "quit" (see method consoleMain()). However, in main.cpp I also have a QFileSystemWatcher which…
Varius
  • 469
  • 3
  • 17
2
votes
0 answers

Qt QFileSystemWatcher on Windows doesn't send fileChanged() signal

I'm tracking a log file that is changed by another application. In linux I receive the fileChanged signal correctly as soon as the other application changes the file. In windows QFileSystemWatcher doesn't emit any fileChanged signal until the other…
2
votes
0 answers

Should QFileSystemWatcher work with device nodes?

Qt is new to me so I don't know all the idioms yet. I have a custom linux driver which exposes itself as /dev/mydevice. When something interesting happens in hardware, the driver writes some data to that file. I have tested that this works with xxd…
2
votes
1 answer

QT detect directory and subfolders changes

i want to detect any changes in a directory uncluding subfolders : exemple : if i put a listner in the directory D:\dropbox i want my application shows this : D:\dropbox\folder1\file1.txt is deleted D:\dropbox\folder1\folder2 is…
Aouidane Med Amine
  • 1,571
  • 16
  • 17
2
votes
1 answer

How to refresh a QFileSystemModel in a QTreeView after files change through another process?

I have a QTreeView with a QFileSystemModel as the model. Files and directories load correctly. In my application workflow, a different process copies and overwrites files on the file system. However, my QTreeView does not update the item/row for…
GraehamF
  • 1,971
  • 24
  • 24
2
votes
2 answers

QT - QFileSystemModel on server-client program

I am working on a server-client QT project that allows to transfer files between server and client. Being a GUI project, I want to display the server's file system on client program, like a file explorer. The question is : is there a way to send…
2
votes
1 answer

C++ Qt QFileSystemWatcher file upload double

I am having issues where the file is being uploaded twice to the server. I am using the QFileSystemWatcher class from C++ Qt on Windows XP to send a file when the folder changes The files are small (1-12kb). The application sends the files by…
alexg
  • 902
  • 11
  • 37
2
votes
1 answer

QFileSystemWatcher: detects removed & added files but not modified one

I'm developing an app on windows with Qt and I need to detect changes in a specific folder. So I used a QFileSystemWatcher, and I connect the directoryChanged signal to a function that will send a message in case of changes. The problem is that the…
lagarkane
  • 915
  • 2
  • 9
  • 22
1
vote
1 answer

QFileSystemModel doesn't emit fileRenamed signal

I am trying to watch the changes in a directory using QFileSystemModel. Whenever I rename a file in the root path, only the directoryLoaded() signal is emitted. I want the fileRenamed() signal to be emitted so that I know which file is renamed to a…
Yeakub
  • 13
  • 3
1
vote
1 answer

Qt: Catch external changes on an SQLite database

) I'm deveoping a program using an SQLite database I acces via QSqlDatabase. I'd like to handle the (hopefully rare) case when some changes are done to the database which are not caused by the program while it's running (e. g. the user could remove…
Tobias Leupold
  • 1,512
  • 1
  • 16
  • 41
1
2 3 4