- Qt 6.12
- Qt TaskTree
- C++ Classes
- Else
- Qt 6.12.0 Reference Documentation

# QtTaskTree::Else Class

class QtTaskTree::Else

An "else" element used in conditional expressions. More...

Header: | `#include <qconditional.h>`
CMake: | `find_package(Qt6 REQUIRED COMPONENTS TaskTree)` `target_link_libraries(mytarget PRIVATE Qt6::TaskTree)`
qmake: | `QT += tasktree`
Since: | Qt 6.11
Status: | Technology preview

This class is in technology preview and is subject to change.

- List of all members, including inherited members

Note: All functions in this class are reentrant.

## Public Functions

| Else(const QtTaskTree::GroupItems &children)
| Else(std::initializer_list<QtTaskTree::GroupItem> children)
| Else(QtTaskTree::Else &&other)

## Detailed Description

A body of an else branch of the conditional expressions. Must always be preceeded by Then element.

See also If, Then, and ElseIf.

## Member Function Documentation

### `[explicit]` Else::Else(const QtTaskTree::GroupItems &children)

Creates an else branch body element of the conditional expressions with children items. If the previous condition finishes with an error, the preceeding Then body is skipped, and `this` branch is selected. In this case the running QTaskTree executes the children, and the result of this execution is the final result of the whole conditional expression.

### `[explicit]` Else::Else(std::initializer_list<QtTaskTree::GroupItem> children)

Constructs an else branch body element from `std::initializer_list` given by children.

This is an overloaded function.

### `[constexpr noexcept default]` Else::Else(QtTaskTree::Else &&other)

Move-constructs an instance of Else.