Results 1 to 5 of 5

Thread: How to discard initial data of QGraphicsView or QPainterPath's?

  1. #1
    Join Date
    May 2006
    Location
    Bangalore,India
    Posts
    235
    Qt products
    Qt3 Qt4
    Platforms
    Windows
    Thanks
    7
    Thanked 25 Times in 24 Posts

    Question How to discard initial data of QGraphicsView or QPainterPath's?

    I am displaying graph in a QGraphicsView using QPainterPath.
    I am using QPainterPath's lineTo(x,y).
    After displaying a huge data, I want to discard initial data(graph).
    is there any way to discard initial(starting) data of QGraphicsView or QPainterPath's?
    I am using Qt4.3.1 on windows.

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 541 Times in 521 Posts

    Default Re: How to discard initial data of QGraphicsView or QPainterPath's?

    If the root node of the graph is also the parent of all nodes( in the sense of QGraphicsItem parent-child relation) then you can call QGraphicsScene::removeItem.
    It will remove the root and all children from the scene.

    The responsibility to delete the item( deallocating the memory) is passed on to you.

  3. #3
    Join Date
    May 2006
    Location
    Bangalore,India
    Posts
    235
    Qt products
    Qt3 Qt4
    Platforms
    Windows
    Thanks
    7
    Thanked 25 Times in 24 Posts

    Default Re: How to discard initial data of QGraphicsView or QPainterPath's?

    I dont want to remove full item, want to remove starting part of graph.

    I am displaying digital wave signal by using QPainterPath. I want to display only 10ms data. when it cross 10 ms (say 11ms)data then I want to revove wave signal from begning(1ms data).

  4. #4
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 541 Times in 521 Posts

    Default Re: How to discard initial data of QGraphicsView or QPainterPath's?

    But that depends entirely on your data structure and graphics items design.
    I can't give you a general method...

    Regards

  5. #5
    Join Date
    May 2006
    Location
    Bangalore,India
    Posts
    235
    Qt products
    Qt3 Qt4
    Platforms
    Windows
    Thanks
    7
    Thanked 25 Times in 24 Posts

    Default Re: How to discard initial data of QGraphicsView or QPainterPath's?

    m_pPainterPath.moveTo(0,0);
    m_pPainterPath.lineTo(x,y);
    m_pPainterPath.lineTo(x1,y1);
    m_pPainterPath.lineTo(x2,y2);

    after this can I delete like

    m_pPainterPath.moveTo(0,0);
    m_pPainterPath.removelineTo(x,y); --> is there any eqv function like removeline

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.