QSkinny 0.8.0
C++/Qt UI toolkit
Loading...
Searching...
No Matches
QskPlacementPolicy Class Reference

#include <QskPlacementPolicy.h>

Detailed Description

QskPlacementPolicy is a hint for layout code how to deal with the geometry of an item depending on its visibility.

See also
QskControl::placementPolicy(), qskPlacementPolicy()

Definition at line 13 of file QskPlacementPolicy.h.

Public Types

enum  Policy { Ignore , Reserve , Adjust }
 

Properties

Policy visiblePolicy
 Policy for the item, when being visible ( to its parent )
 
Policy hiddenPolicy
 Policy for the item, when being hidden ( to its parent )
 

Public Member Functions

constexpr QskPlacementPolicy () noexcept
 Default constructor.
 
constexpr QskPlacementPolicy (Policy) noexcept
 
constexpr QskPlacementPolicy (Policy visiblePolicy, Policy hiddenPolicy) noexcept
 
constexpr QskPlacementPolicy (Qsk::Visibilities, Policy) noexcept
 
constexpr bool operator== (const QskPlacementPolicy &) const noexcept
 
constexpr bool operator!= (const QskPlacementPolicy &) const noexcept
 
void setPolicy (Qsk::Visibilities, Policy) noexcept
 
constexpr Policy policy (Qsk::Visibility) const noexcept
 
constexpr bool isEffective () const noexcept
 
constexpr bool isIgnoring (Qsk::Visibility) const noexcept
 
constexpr bool isAdjusting (Qsk::Visibility) const noexcept
 
void setVisiblePolicy (Policy) noexcept
 
constexpr Policy visiblePolicy () const noexcept
 
void setHiddenPolicy (Policy) noexcept
 
constexpr Policy hiddenPolicy () const noexcept
 

Member Enumeration Documentation

◆ Policy

Hint for the layout code how to deal with the geometry of an item. QskPlacementPolicy has two values: one for the visible, the other for the hidden state.

Enumerator
Ignore 
 Ignore the item for all type of layout calculations
Reserve 
 Reseve space without giving the item its geometry
Adjust 
 Reserve space and adjust the geometry of the item
See also
visiblePolicy, hiddenPolicy

Definition at line 22 of file QskPlacementPolicy.h.

Constructor & Destructor Documentation

◆ QskPlacementPolicy() [1/4]

constexpr QskPlacementPolicy::QskPlacementPolicy ( )
inlineconstexprnoexcept

Default constructor.

QskPlacementPolicy::Adjust is set for Qsk::Visible, while QskPlacementPolicy::Ignore is used for Qsk::Hidden.

See also
visiblePolicy, hiddenPolicy

Definition at line 57 of file QskPlacementPolicy.h.

◆ QskPlacementPolicy() [2/4]

constexpr QskPlacementPolicy::QskPlacementPolicy ( Policy  policy)
constexprnoexcept

visiblePolicy and hiddenPolicy are set to policy

Definition at line 70 of file QskPlacementPolicy.h.

◆ QskPlacementPolicy() [3/4]

constexpr QskPlacementPolicy::QskPlacementPolicy ( Policy  visiblePolicy,
Policy  hiddenPolicy 
)
inlineconstexprnoexcept

Initialization from visiblePolicy and hiddenPolicy

Definition at line 63 of file QskPlacementPolicy.h.

◆ QskPlacementPolicy() [4/4]

constexpr QskPlacementPolicy::QskPlacementPolicy ( Qsk::Visibilities  visiblities,
Policy  policy 
)
constexprnoexcept

Initialize visiblePolicy and hiddenPolicy depending on visiblities

Definition at line 76 of file QskPlacementPolicy.h.

Member Function Documentation

◆ hiddenPolicy()

constexpr QskPlacementPolicy::Policy QskPlacementPolicy::hiddenPolicy ( ) const
inlineconstexprnoexcept

Definition at line 127 of file QskPlacementPolicy.h.

◆ isAdjusting()

constexpr bool QskPlacementPolicy::isAdjusting ( Qsk::Visibility  visibility) const
inlineconstexprnoexcept
Returns
true, when QskPlacementPolicy::Adjust is set for the visibility

Definition at line 143 of file QskPlacementPolicy.h.

◆ isEffective()

constexpr bool QskPlacementPolicy::isEffective ( ) const
inlineconstexprnoexcept
Returns
true, when visiblePolicy or hiddenPolicy is not QskPlacementPolicy::Ignore
See also
isIgnoring()

Definition at line 132 of file QskPlacementPolicy.h.

◆ isIgnoring()

constexpr bool QskPlacementPolicy::isIgnoring ( Qsk::Visibility  visibility) const
inlineconstexprnoexcept
Returns
true, when visiblePolicy and hiddenPolicy are set to QskPlacementPolicy::Ignore
See also
isEffective()

Definition at line 137 of file QskPlacementPolicy.h.

◆ operator!=()

constexpr bool QskPlacementPolicy::operator!= ( const QskPlacementPolicy other) const
inlineconstexprnoexcept

"Not equal to" operator

See also
operator==(), operator<()

Definition at line 90 of file QskPlacementPolicy.h.

◆ operator==()

constexpr bool QskPlacementPolicy::operator== ( const QskPlacementPolicy other) const
inlineconstexprnoexcept

"Equal to" operator

See also
operator!=(), operator<()

Definition at line 83 of file QskPlacementPolicy.h.

◆ policy()

constexpr QskPlacementPolicy::Policy QskPlacementPolicy::policy ( Qsk::Visibility  visibility) const
inlineconstexprnoexcept

Definition at line 107 of file QskPlacementPolicy.h.

◆ setHiddenPolicy()

void QskPlacementPolicy::setHiddenPolicy ( Policy  policy)
inlinenoexcept
See also
hiddenPolicy(), setVisiblePolicy()

Definition at line 122 of file QskPlacementPolicy.h.

◆ setPolicy()

void QskPlacementPolicy::setPolicy ( Qsk::Visibilities  visibilities,
Policy  policy 
)
inlinenoexcept

Definition at line 96 of file QskPlacementPolicy.h.

◆ setVisiblePolicy()

void QskPlacementPolicy::setVisiblePolicy ( Policy  policy)
inlinenoexcept
See also
visiblePolicy(), setHiddenPolicy()

Definition at line 112 of file QskPlacementPolicy.h.

◆ visiblePolicy()

constexpr QskPlacementPolicy::Policy QskPlacementPolicy::visiblePolicy ( ) const
inlineconstexprnoexcept

Definition at line 117 of file QskPlacementPolicy.h.

Property Documentation

◆ hiddenPolicy

QskPlacementPolicy::hiddenPolicy
readwrite

Policy for the item, when being hidden ( to its parent )

Access functions:
hiddenPolicy(), setHiddenPolicy()
See also
visiblePolicy, QskItem::isVisibleToParent(), qskIsVisibleToParent()
Note
QskPlacementPolicy::Ignore is stored in the transparentForPositioner bit in QQuickItem and might have an impact on Qt/Quick layout code.
QskPlacementPolicy::Reserve is equivalent to what is offered by
See also
QSizePolicy::retainSizeWhenHidden().
setHiddenPolicy(), visiblePolicy()

Definition at line 18 of file QskPlacementPolicy.h.

◆ visiblePolicy

QskPlacementPolicy::visiblePolicy
readwrite

Policy for the item, when being visible ( to its parent )

  • QskPlacementPolicy::Ignore

    For situations where a parent takes care of the geometry for its children, but the specific item should be omitted. F.e a focus indicator.

  • QskPlacementPolicy::Reserve

    There are not many relevant scenarios for reserving space for visible items without adjusting them. An example might be when an item is inside of a grid box, where all the size hints should have an effect, but the final alignment of the item inside of the cell has to be done manually.

  • QskPlacementPolicy::Adjust:

    The default value

Access functions:
visiblePolicy(), setVisiblePolicy()
See also
hiddenPolicy, QskItem::isVisibleToParent(), qskIsVisibleToParent()
Note
QskPlacementPolicy::Ignore is stored in the transparentForPositioner bit in QQuickItem and might have an impact on Qt/Quick layout code.
See also
setVisiblePolicy(), hiddenPolicy()

Definition at line 17 of file QskPlacementPolicy.h.