Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QFileSystemWatcher

QFileSystemWatcher

Scheduled Pinned Locked Moved General and Desktop
10 Posts 5 Posters 4.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    paganotti
    wrote on last edited by
    #1

    Good Morning, today I'm trying to do something test using QFileSystemWatcher class.
    Is It possible to know what file is been deleted, renamed, modified programmaticaly in signal directoryChanged and it is possible to know what operation is applied to that file?
    For example if I rename a file test.txt contained in a folder called share, can I know via API that file test.txt is renamed instantly?

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      Why not add all the files in the dir to the watcher and catch fileChanged() signal?

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • P Offline
        P Offline
        paganotti
        wrote on last edited by
        #3

        With fileChanged() is it possible know also the operation over that file? For example when renamed file test.txt to test2.txt, FileChanded() says me I have renamed that file test.txt to test2.txt? Can you post me a snippet, please? Thank you so much.

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on last edited by
          #4

          You have read the documentation of "QFileSystemWatcher::fileChanged() ":http://doc.qt.nokia.com/4.7/qfilesystemwatcher.html#fileChanged, haven't you?

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • P Offline
            P Offline
            paganotti
            wrote on last edited by
            #5

            I have read the documentation. FileChanged says me that something is success on that file, but it doesn't say me exactly the operation: rename, delete or modify. I need know exacly what it is happened on that file.

            1 Reply Last reply
            0
            • G Offline
              G Offline
              goetz
              wrote on last edited by
              #6

              You'll have to check this yourself.

              There are some issues in the bug tracker that are related to your problem:

              • "QTBUG-2264":http://bugreports.qt.nokia.com/browse/QTBUG-2264
              • "QTBUG-172":http://bugreports.qt.nokia.com/browse/QTBUG-172, you might want to re-open this one

              http://www.catb.org/~esr/faqs/smart-questions.html

              1 Reply Last reply
              0
              • S Offline
                S Offline
                stukdev
                wrote on last edited by
                #7

                So there isn't a way to do this?

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  goetz
                  wrote on last edited by
                  #8

                  No, unfortunately, there is no builtin way to get this information, sorry.

                  http://www.catb.org/~esr/faqs/smart-questions.html

                  1 Reply Last reply
                  0
                  • D Offline
                    D Offline
                    dangelog
                    wrote on last edited by
                    #9

                    Not in Qt as of now. KDE does something better with KDirWatch.

                    Software Engineer
                    KDAB (UK) Ltd., a KDAB Group company

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      andre
                      wrote on last edited by
                      #10

                      I have requested "bug 172":http://bugreports.qt.nokia.com/browse/QTBUG-172 be re-opened. That has been done. You can vote for it now, if you want. Don't count on this being fixed any time soon though, seeing that the priority is not that high.

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved