- Qt 6.9
- Qt Test
- C++ Classes
- QtTestLib
- ThrowOnFailEnabler
- Qt 6.9.3 Reference Documentation

# QTest::ThrowOnFailEnabler Class

class QTest::ThrowOnFailEnabler

Header: | `#include <ThrowOnFailEnabler>`
Since: | Qt 6.8

- List of all members, including inherited members

## Public Functions

| ThrowOnFailEnabler()
| ~ThrowOnFailEnabler()

## Detailed Description

RAII class around setThrowOnFail().

## Member Function Documentation

### ThrowOnFailEnabler::ThrowOnFailEnabler()

Constructor. Calls `setThrowOnFail(true)`.

### `[noexcept]` ThrowOnFailEnabler::~ThrowOnFailEnabler()

Destructor. Calls `setThrowOnFail(false)`.