Results 1 to 6 of 6

Thread: reading integers from QTextEdit doesn't go right ?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: reading integers from QTextEdit doesn't go right ?

    QPainter::save() saves the current state of the painter not the painted device. That state is stored internally to the QPainter and can only live as long as the QPainter exists, which in this case is until the end of the paintEvent(). You never call QPainter::restore() so the saved states are never reused.

    Subsequent calls to the paintEvent() only draw the shape associated with the last clicked button because that is the logic you have implemented by clearing the px flag after drawing the shape x.

  2. The following user says thank you to ChrisW67 for this useful post:

    mernarezk (2nd December 2013)

Similar Threads

  1. add two integers
    By Gishan in forum Newbie
    Replies: 3
    Last Post: 8th September 2012, 08:44
  2. QTextEdit doesn't append text
    By Luc4 in forum Qt Programming
    Replies: 7
    Last Post: 13th June 2010, 22:45
  3. Only integers from QFontMetricsF width
    By StevenB in forum Qt Programming
    Replies: 3
    Last Post: 16th May 2008, 21:59
  4. how to get integers from mysql
    By eleanor in forum Qt Programming
    Replies: 9
    Last Post: 8th November 2007, 16:25
  5. reading QTextEdit from file
    By incapacitant in forum Newbie
    Replies: 3
    Last Post: 29th March 2006, 21:45

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
  •  
Qt is a trademark of The Qt Company.