1.2
Public Member Functions | Public Attributes | List of all members
Painter::AutoSaveRestore Struct Reference

Scoped save() and restore() for a Painter. More...

Public Member Functions

 AutoSaveRestore (AutoSaveRestore &&)=delete
 
 AutoSaveRestore (const AutoSaveRestore &)=delete
 
 AutoSaveRestore (Painter &painter)
 
 ~AutoSaveRestore ()
 
AutoSaveRestoreoperator= (AutoSaveRestore &&)=delete
 
AutoSaveRestoreoperator= (const AutoSaveRestore &)=delete
 

Public Attributes

Painterm_painter
 

Detailed Description

Scoped save() and restore() for a Painter.

You are encouraged to use this instead of manually calling Painter::save() and Painter::restore().

Example

void SomeWidget::paint(Painter& painter)
{
Painter::AutoSaveRestore sr(painter);
// painter state will be restored when sr is destructed
}

Constructor & Destructor Documentation

◆ AutoSaveRestore() [1/3]

AutoSaveRestore ( Painter painter)
inlineexplicit

◆ AutoSaveRestore() [2/3]

AutoSaveRestore ( const AutoSaveRestore )
delete

◆ AutoSaveRestore() [3/3]

◆ ~AutoSaveRestore()

~AutoSaveRestore ( )
inline

Member Function Documentation

◆ operator=() [1/2]

AutoSaveRestore& operator= ( AutoSaveRestore &&  )
delete

◆ operator=() [2/2]

AutoSaveRestore& operator= ( const AutoSaveRestore )
delete

Member Data Documentation

◆ m_painter

Painter& m_painter