PDA

View Full Version : What exactly is a QPainter state?



tuli
30th December 2012, 20:17
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!

ChrisW67
30th December 2012, 20:27
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.

tuli
30th December 2012, 21:13
alright, thank you very much!