|
QGIS API Documentation 4.3.0-Master (96c7fa699b4)
|
Scoped object for saving and restoring a QPainter object's state. More...
#include <qgspainting.h>
Public Types | |
| enum class | InitialState { Save , NoSave } |
| Initial action to take when constructing the scoped object. More... | |
Public Member Functions | |
| QgsScopedQPainterState (const QgsScopedQPainterState &)=delete | |
| QgsScopedQPainterState (QgsScopedQPainterState &&)=delete | |
| QgsScopedQPainterState (QPainter *painter, InitialState initialState=InitialState::Save) | |
| Constructor for QgsScopedQPainterState. | |
| ~QgsScopedQPainterState () | |
| Restores the painter back to its original state. | |
| QgsScopedQPainterState & | operator= (const QgsScopedQPainterState &)=delete |
| QgsScopedQPainterState & | operator= (QgsScopedQPainterState &&)=delete |
| void | restore () |
| Performs a manual restore on the painter state, popping the latest state from the painter. | |
| void | save () |
| Performs a manual save on the painter state, pushing another saved state to the painter. | |
Scoped object for saving and restoring a QPainter object's state.
Temporarily saves the QPainter state for the lifetime of the object, before restoring it on destruction.
Since QGIS 4.4 this class supports multiple saved states, and early restoration of state.
Definition at line 166 of file qgspainting.h.
|
strong |
Initial action to take when constructing the scoped object.
| Enumerator | |
|---|---|
| Save | Immediately save the current painter state. |
| NoSave | Do not save the current painter state. |
Definition at line 172 of file qgspainting.h.
|
inline |
Constructor for QgsScopedQPainterState.
Saves the specified painter state.
Definition at line 183 of file qgspainting.h.
|
inline |
Restores the painter back to its original state.
Definition at line 196 of file qgspainting.h.
|
delete |
|
delete |
|
delete |
|
delete |
|
inline |
Performs a manual restore on the painter state, popping the latest state from the painter.
Definition at line 216 of file qgspainting.h.
|
inline |
Performs a manual save on the painter state, pushing another saved state to the painter.
Definition at line 230 of file qgspainting.h.