Mousemove is very slow in QGraphicsView



  • Description:

    I have created following Items Inherited with QGraphicsItem

    1. HCursor Item
    2. VCursor Item
    3. XYPlane Item
    4. ChannelData Item
    5. Offset Item

    The above items are added to DSOScene(QGraphicsScene)
    Each Item has individual Paint event It was constructed in my DSOGridView (QGraphicView)
    Problem:
    When I like to paint my QGraphicsview inside my QTimer It will slow down my mousemovements.

    How to implement QGraphicsview without affecting mouseevents.



  • Hi friends, No one faced this problem or No solution ?


  • Lifetime Qt Champion

    Hi,

    No and maybe. What is strange is your "paint in inside QTimer". Can you show your code ?



  • its big code. i can't paste here within allowed characters.


  • Moderators

    ok but why do you really use a QTimer for painting?
    seems to me that you do more work than you need to.



  • dear raven-worx,

    what else i can use for plotting the graph with huge sample points fastly.


  • Moderators

    should it be a real time graph?



  • yes. Digital Oscilloscope.


  • Moderators

    did you consider using "Qwt":http://qwt.sourceforge.net/curvescreenshots.html (if possible)?

    otherwise - without knowing your code - i would say you should optimize your data handling used for drawing. Thats most probably slowing down your painting.

    Do you store each single point and draw it as a graph? If so about how much points are we talking?



  • yea i saw Qwt.

    It requires opengl ES . Right now we are not using opengl ES.

    we use about 10K~50K samples.


  • Moderators

    [quote author="dreamerindia" date="1382709833"]
    we use about 10K~50K samples.[/quote]
    every time QTimer fires you paint this amount of dots?



  • yes we are using QTimer for this.


  • Moderators

    this sounds way too much for me just for painting... and is most probably the reason for your performance issue IMHO.

    Do you get the points in an ordered way? If so you should be able to optimize it and discard a certain amount of points and don't even save them ... at least for painting.



  • Points are not in ordered way.
    Points Range: 10000 - 50000
    Each point represents the real time signal level and it is stored in QVector and the QVector points are plotted.
    for eg. every 10 milli second my point will be updated and painting is required.
    any other S/W or H/W buffering technique to render my points without disturbing my mouse event.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.