Results 1 to 12 of 12

Thread: Draw New data, without erasing old ones

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    Join Date
    Dec 2008
    Posts
    31
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    2

    Default Re: Draw New data, without erasing old ones

    Quote Originally Posted by wysota View Post
    You will see everything at the right time unless you are drawing zillions of pieces of data at once.
    I am seeing them at once.
    But my app response is low,
    a. data which is in the buffer is read from a network at the same rate (500 items in 4 sec)
    b. as and when i read single data into buffer i call update() on my widget to schedule a paint.
    c. In the PaintEvent, i draw all the previous data (if any) and the current received data.


    May be this is making my UI less responsive? I need to make it as a Thread but the QTCpSocket is used in many classes to send data, as far i understand the networking stuff should be limited to one QThread. So i think its little tricky , is there any example which does implement Network read and write as QThread?



    Quote Originally Posted by wysota View Post
    From what I see you are always drawing a single entity (ellipse or no ellipse) so speed should not be an issue here.
    My drawing is in a loop running till buffer size. It needs to draw 500 items in 4 secs (worst case), every time i receive a new data i have to redraw everything from the buffer along with the new data.



    Quote Originally Posted by wysota View Post
    This is more complicated that using QGraphicsView which I advise you to look at.
    Even if i move to GraphicsView, reading from Network shouldnt be a Bottle Neck to me , should i use a Thread?

    I am slowing moving to GraphicsView, but i have already developed much of code with QPainter, and trying hard to get best out of it.

    I have attached two major files of my source
    1. circlewidget.cpp : One that handles drawing
    2. HmiGenric.cpp : This handles networking. (In this sendmsg() is called from different objects to send data) , this shouldnt be a hurdle to make this class as a Thread i guess.

    Can you help me out?
    Attached Files Attached Files
    Last edited by linuxdev; 7th January 2009 at 06:55.

Similar Threads

  1. Best way to display lots of data fast
    By New2QT in forum Newbie
    Replies: 4
    Last Post: 16th October 2008, 23:46
  2. Replies: 7
    Last Post: 29th August 2008, 11:24
  3. Replies: 4
    Last Post: 19th October 2007, 20:47
  4. speed of setdata - lots of items in treeview
    By Big Duck in forum Qt Programming
    Replies: 4
    Last Post: 6th July 2006, 13:53
  5. Replies: 16
    Last Post: 7th March 2006, 16: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.