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. PyQt application hangs
Forum Updated to NodeBB v4.3 + New Features

PyQt application hangs

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 2.4k Views 1 Watching
  • 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.
  • S Offline
    S Offline
    ssal
    wrote on last edited by
    #1

    PyQt application hangs on QGraphicsView paintEvent. Since this application was written in Qt3, most of the drawing is done outside the paintEvent.
    QGraphicsView is inherited and within the update method of QGraphicsView, the application always create a new instance of QGraphicsScene ( since the contents change frequently ) and adds the QGraphicsLineItem, QGraphicsRectItem and QGraphicsPolygonItem to QGraphicsScene. And then paints the objects when paintEvent is called. Most of the time application works good. But sometimes it hangs and I have to kill the application. Since I am not able to generate a pattern that make application hang I cannot provide sample code that will reproduce this issue.
    The application hangs only in a particular situation though :

    In a method :
    I create QProgressDialog instance
    In a loop for each query
    set new value for QProgressDialog
    Go fetch data for that query and save it in the application.

    once the loop is completed I emit datachanged signal.

    Although in the logs I see that the progress.close() being called, adding the chart items to the QGraphicsScene is called. But progress dialog remains on the screen and no chart it drawn since application hangs at QGraphicsView paintEvent.

    Could be related to QTimer ? ( There are QTimer running with 100ms timeout ... while fetching the data )
    Could it be because I am painting outside paintEvent ?
    Could it be because I am calling QGraphicsScene.update in QGraphicsView.update method ?
    Or Could it be because I might be drawing outside QGraphicsScene bounding rect ?

    There is no recursion in my application.
    Can someone please advice How/where should I look into this issue.

    1 Reply Last reply
    0
    • D Offline
      D Offline
      danilocesar
      wrote on last edited by
      #2

      [quote author="ssal" date="1303155063"]the application always create a new instance of QGraphicsScene ( since the contents change frequently ) [/quote]
      I don't believe it's really necessary.

      Did you try PySide?

      <a href="http://www.danilocesar.com">Danilo Cesar Lemes de Paula</a>
      Software Engineer

      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