Results 1 to 3 of 3

Thread: Keeping points displayed as new ones created

  1. #1
    Join Date
    Jun 2013
    Posts
    58
    Thanks
    26
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Windows

    Question Keeping points displayed as new ones created

    Good Day,

    I made a simple program that creates 2 points based on mouse click position and draws lines between them
    Since it happens several times new points are created and new lines are drawn.... Works fine all points are saved in an array

    My problem is after line drawn between two points, when user clicks a new point for a new line
    the old line/old points disappear.

    How do i keep the points displayed all the time

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: Keeping points displayed as new ones created

    Store each set of the point in a list / array and redraw them again.
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

  3. The following user says thank you to Santosh Reddy for this useful post:

    ebsaith (18th June 2013)

  4. #3
    Join Date
    Jun 2013
    Posts
    58
    Thanks
    26
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Windows

    Smile Re: Keeping points displayed as new ones created

    Kind Regards
    Last edited by ebsaith; 19th June 2013 at 15:13. Reason: updated contents

Similar Threads

  1. Replies: 4
    Last Post: 8th April 2013, 04:19
  2. Replies: 2
    Last Post: 2nd May 2012, 09:49
  3. Keeping the connection open
    By KillGabio in forum Newbie
    Replies: 6
    Last Post: 8th February 2012, 20:28
  4. QPolygonF created from QRectF has five(?!) points
    By Asperamanca in forum Qt Programming
    Replies: 6
    Last Post: 2nd April 2011, 16:55
  5. keeping a widget to be square
    By jmsbc in forum Qt Programming
    Replies: 5
    Last Post: 16th June 2009, 19:47

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.