Results 1 to 4 of 4

Thread: Signal in Qt which emits its signal if a file is pasted in a directory?

  1. #1
    Join Date
    Apr 2011
    Posts
    195
    Thanks
    49
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Smile Signal in Qt which emits its signal if a file is pasted in a directory?

    Hi
    I have a little problem. I'm writing a console programm which should watch a directory. If a file is pasted, the programm should do some work. I'm using the QFileSystemWatcher, but he also emits a signal when a file gets deleted.
    The signal should be emitted when a file is pasted. Do you have some suggestions?
    Maybe I have ti write my own signal? But how?

    Thank you!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,013 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Signal in Qt which emits its signal if a file is pasted in a directory?

    Use QFileWatcher and compare the directory contents before the signal and after the signal and you'll know wheter a new file appeared or not.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Apr 2011
    Posts
    195
    Thanks
    49
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Signal in Qt which emits its signal if a file is pasted in a directory?

    Thank you for your reply! Ok a good idea, but I can't find a class named QFileWatcher.
    I use Qt 4.7...

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,013 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Signal in Qt which emits its signal if a file is pasted in a directory?

    Sorry, should be QFileSystemWatcher.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. The following user says thank you to wysota for this useful post:

    Qiieha (29th April 2011)

Similar Threads

  1. Replies: 4
    Last Post: 23rd January 2011, 11:08
  2. Replies: 2
    Last Post: 15th September 2010, 01:54
  3. signal mapping on pushbutton signal clicked
    By wagmare in forum Qt Programming
    Replies: 2
    Last Post: 17th March 2009, 08:54
  4. Replies: 1
    Last Post: 28th January 2009, 10:21
  5. Replies: 1
    Last Post: 8th November 2007, 18:11

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.