Results 1 to 2 of 2

Thread: pyqt5 graphicsview app freezes intermittently

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2015
    Posts
    3
    Thanks
    2
    Qt products
    Qt5
    Platforms
    Windows

    Default pyqt5 graphicsview app freezes intermittently

    I have an app that consists right now of a qgraphicsview and qgraphicsscene, and in it I draw some widgets (converted to qgraphicsitem via the usual proxy method), and some lines between the widgets. The creation of lines are initiated via queued signals from a backend QThread, the drawing is occuring in the main thread.

    Every few runs, the app freezes halfway through drawing the lines -- no crashes, or exception raised, just freezes, and Windows shows the "(not responding)" in window title. I have QTimers firing a "heartbeat" every second: one fires in main thread, one in thread that signals for line to be drawn, and one in a do-nothing (other than heartbeat) thread: all three stop firing, indicating all event loops are frozen, so I don't think it is a deadlock (I am not using any mutexes or thread synchro due to use of queued signals). Could it be deadlock due to 2 threads wanting Python's GIL? Any ideas what might be causing this? When the backend stuff runs in main thread, no issues.

    I trust that if connection is made between a signal in one thread and a slot in another, Qt automatically choose Qt.QueuedSignal as connection type, so although I know it would cause havoc if lines were being drawn in backend thread, I have not rigorously verified the draw indeed happens, how could it not? But how do you recommend I check this, compare currentThreadId with main thread ID? I can't find where to get the main thread id.
    Last edited by schollii; 13th April 2015 at 14:06.

Similar Threads

  1. PyQt5 QPixmap
    By ChrisOfBristol in forum Newbie
    Replies: 4
    Last Post: 4th April 2015, 21:48
  2. QFileDialog freezes
    By FreddyKay in forum Qt Programming
    Replies: 4
    Last Post: 24th November 2014, 20:14
  3. QWebView: first XHR slow (GUI freezes)
    By yeikos in forum Qt Programming
    Replies: 0
    Last Post: 16th July 2014, 10:53
  4. GUI freezes in loop: Thread does not help?
    By Matty23 in forum Qt Programming
    Replies: 4
    Last Post: 25th November 2010, 21:04
  5. Keyboards freezes
    By giusepped in forum Qt-based Software
    Replies: 0
    Last Post: 28th October 2008, 01:30

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.