Results 1 to 11 of 11

Thread: Removing last Painted point

Threaded View

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

    Arrow Removing last Painted point

    Good Day

    I store points in an array (points taken from position of mouse click)

    In my paintEvent I draw points from array
    Qt Code:
    1. painter.setPen(myPen);
    2. foreach(tempMark, myPoints)
    3. {
    4. painter.drawEllipse(tempMark, 2, 2);
    5. }
    To copy to clipboard, switch view to plain text mode 

    I created an UNDO Button that deletes the last point from array
    I tested it, by writing points to file, That point is deleted

    But my paintEvent still displays that point while I'm creating new points
    (note all points must be displayed at all times during the run of the program)
    If I click Undo, it should Remove only the last point
    (which it does from the array - Button is working) But the point is still displayed on the screen

    PushButton_Undo
    Qt Code:
    1. myPoints.removeLast();
    2. this->repaint(); //-> probably this->repaint() not working! maybe
    To copy to clipboard, switch view to plain text mode 

    Do I add something to the paint Event?
    Any Ideas?

    Many Thanks
    Last edited by ebsaith; 28th June 2013 at 11:01. Reason: updated contents

Similar Threads

  1. Replies: 3
    Last Post: 21st June 2011, 19:37
  2. QDialogButtonBox text not painted
    By kshi in forum Qt Programming
    Replies: 0
    Last Post: 8th January 2011, 00:41
  3. Replies: 1
    Last Post: 3rd December 2009, 14:23
  4. display a plot point by point
    By oswalidos in forum Newbie
    Replies: 32
    Last Post: 13th March 2009, 15:37
  5. how to paint scene point by point
    By elessaar in forum Qt Programming
    Replies: 8
    Last Post: 4th September 2008, 20:00

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.