Struct qt_core::QDebugStateSaver
source · #[repr(C)]pub struct QDebugStateSaver { /* private fields */ }
Expand description
Convenience class for custom QDebug operators
C++ class: QDebugStateSaver
.
Convenience class for custom QDebug operators
Saves the settings used by QDebug, and restores them upon destruction, then calls maybeSpace(), to separate arguments with a space if autoInsertSpaces() was true at the time of constructing the QDebugStateSaver.
The automatic insertion of spaces between writes is one of the settings that QDebugStateSaver stores for the duration of the current block.
The settings of the internal QTextStream are also saved and restored, so that using << hex in a QDebug operator doesn't affect other QDebug operators.
Implementations§
source§impl QDebugStateSaver
impl QDebugStateSaver
sourcepub unsafe fn new(dbg: impl CastInto<Ref<QDebug>>) -> CppBox<QDebugStateSaver>
pub unsafe fn new(dbg: impl CastInto<Ref<QDebug>>) -> CppBox<QDebugStateSaver>
Creates a QDebugStateSaver instance, which saves the settings currently used by dbg.
Calls C++ function: [constructor] void QDebugStateSaver::QDebugStateSaver(QDebug& dbg)
.
Creates a QDebugStateSaver instance, which saves the settings currently used by dbg.
See also QDebug::setAutoInsertSpaces() and QDebug::autoInsertSpaces().
Trait Implementations§
source§impl CppDeletable for QDebugStateSaver
impl CppDeletable for QDebugStateSaver
source§unsafe fn delete(&self)
unsafe fn delete(&self)
Destroys a QDebugStateSaver instance, which restores the settings used when the QDebugStateSaver instance was created.
Calls C++ function: [destructor] void QDebugStateSaver::~QDebugStateSaver()
.
Destroys a QDebugStateSaver instance, which restores the settings used when the QDebugStateSaver instance was created.
See also QDebug::setAutoInsertSpaces() and QDebug::autoInsertSpaces().