PyQt4 - widget signal trouble

Marco Bizzarri marco.bizzarri at
Sun Apr 26 14:46:14 CEST 2009

On Sun, Apr 26, 2009 at 12:38 PM, Joacim Thomassen
<joacim at> wrote:
> Den Sat, 25 Apr 2009 23:47:57 +0200, skrev Marco Bizzarri:
> Hello Marco,
> python's fcntl() call the regular C fcntl() function and as stated in the
> manual pages for C fcntl:
> ----------- Snippet from fcntl man pages ----------------
> File and directory change notification (dnotify)
>       F_NOTIFY (long)
>              (Linux  2.4 onwards) Provide notification when the
>                      directory referred to by fd or any of the files that it
>                      contains is changed.  The  events  to  be  notified  are
>              specified in arg, which is a bit mask specified by ORing
>                      together zero or more of the following bits:
>              DN_MODIFY   A file was modified (write, pwrite, writev,
>                                                       truncate, ftruncate).
> ------------- End snippet of fcntl man pages -------------------
> The fact that my program actually trigger a signal as the monitored
> directoy's image.jpg file change confirm that this part of the code do
> work. I do get "Change happened!" as i manually do a "cp another.jpg
> image.jpg", but this action is first seen after I close my application
> window. (I do not get "Change happened!" if I don't do my manual cp
> command. :-) )
> Personaly I believe this has something to do with the GUI/Qt4 part that I
> have not understood. Something about how a widget repaint itself or
> something in that direction.
> Best regards,
> Joacim
> --

You're right: I've found the following answer googling:

indeed, addind a startTimer() to your code, makes it works ;).


Marco Bizzarri

More information about the Python-list mailing list