Results 1 to 3 of 3

Thread: What exactly is a QPainter state?

  1. #1
    Join Date
    Jul 2012
    Posts
    244
    Thanks
    27
    Thanked 15 Times in 14 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default What exactly is a QPainter state?

    Hi,

    the documentation of QPainter mentions a painter state:

    QPainter::save()
    Saves the current painter state (pushes the state onto a stack). A save() must be followed by a corresponding restore(); the end() function unwinds the stack.
    However, i was unable to find what exactly is included in this "state" and what is not?

    happy new year!

  2. #2
    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: What exactly is a QPainter state?

    The information includes all information needed to save and restore the QPainter to an identical state. From a user perspective this includes things like current fonts, pens, brushes, clipping regions, transforms, composition mode, opacity etc. The state may also include internal information the QPainter needs to preserve. Once you have called save() you can change anything you like, paint anything, and be sure you can return to the saved state with a restore() call.

  3. #3
    Join Date
    Jul 2012
    Posts
    244
    Thanks
    27
    Thanked 15 Times in 14 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: What exactly is a QPainter state?

    alright, thank you very much!

Similar Threads

  1. Replies: 2
    Last Post: 26th December 2012, 01:03
  2. Change state property within a current state?
    By prophet0 in forum Qt Quick
    Replies: 1
    Last Post: 30th May 2012, 19:23
  3. Is there any easy way to copy QPainter state?
    By feverzsj in forum Newbie
    Replies: 1
    Last Post: 19th May 2012, 07:49
  4. State Machine returning to previous state
    By akiross in forum Qt Programming
    Replies: 2
    Last Post: 10th May 2011, 00:39
  5. Replies: 0
    Last Post: 19th December 2010, 16:03

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.