- Extending Qt Creator Manual
- QtCreator
- If
- Extending Qt Creator Manual 21.0.0-beta1

# Layouting::If Class

class Layouting::If

Conditionally includes layout items based on a boolean condition. More...

Header: | `#include <If>`

## Detailed Description

Use the `>>` operator to chain a Then and an optional Else clause:

     Column {
         If(condition) >> Then { label1, label2 } >> Else { label3 },
     }

At construction time the condition is evaluated and the matching item list is inlined into the enclosing layout.

See also Layouting::Then and Layouting::Else.