Results 1 to 4 of 4

Thread: Qmutex/QThread PyQt problem

  1. #1
    Join Date
    Mar 2006
    Posts
    2
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Qmutex/QThread PyQt problem

    Hello,

    I have a problem with getting my thread to work correctly in pyqt. I also dont really understand mutex and where to use it correctly. I have attached my code.

    The short:
    I select a file that will get tailed.
    Once I click start a QTimer is activated to check for new files every 5 seconds to handle rollovers. (If there is another way to do this pray tell!)

    Anyways It works the first time that the program runs through but after that it complains about a RuntimeError: underlying C/C++ object has been deleted.

    Any help would be extremely appreciated!! Even if someone could maybe just paste me some py
    qt code that uses threads and mutexs' so I can get a general idea. There seems to be a very big void on google regarding the subject :-(

    Regards!
    Attached Files Attached Files

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

    Default Re: Qmutex/QThread PyQt problem

    Have you seen QFileSystemWatcher?

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

    boom (1st September 2008)

  4. #3
    Join Date
    Mar 2006
    Posts
    2
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qmutex/QThread PyQt problem

    Yes I have but can QFileSystemWatcher be timed down?

    The files the application is tailing is appending constantly.

    Is there maybe a way that I can implement this so that I get a signal when there is a new file created in the directory I am tailing the file in?

    Basiccally just receiving a signal if there is a new file in the directory and not a modified file. As the files will be modified the entire time ...

    -------------------------------------------------------------------------------------------------------

    Decided on using QFileSystemWatcher. Is there a easy way to fond out what the file was that changed in a directory that you are monitoring?
    Last edited by boom; 1st September 2008 at 12:48. Reason: updated contents

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

    Default Re: Qmutex/QThread PyQt problem

    The watcher will emit a signal which you can catch and interpret the way you want. It is you who decides how often react to changes.

Similar Threads

  1. Weird problem: multithread QT app kills my linux
    By Ishark in forum Qt Programming
    Replies: 2
    Last Post: 8th August 2008, 09:12
  2. Problem with PyQt 4.4.2 and Qt 4.4.0
    By tlam in forum Installation and Deployment
    Replies: 1
    Last Post: 6th August 2008, 16:34
  3. Steps in solving a programming problem?
    By triperzonak in forum General Programming
    Replies: 8
    Last Post: 5th August 2008, 08:47
  4. PyQt QTimer problem { FIXED }
    By WinchellChung in forum Newbie
    Replies: 0
    Last Post: 1st March 2008, 16:50
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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
  •  
Qt is a trademark of The Qt Company.