| digiKam Developer Documentation Professional Photo Management with the Power of Open Source

Loading...
Searching...
No Matches
Public Types | Public Slots | Signals | Public Member Functions | Protected Slots | Protected Member Functions | Properties | List of all members
Digikam::ItemVisibilityController Class Reference
Inheritance diagram for Digikam::ItemVisibilityController:

## Public Types
enum | IncludeFadingOutMode { IncludeFadingOut , ExcludeFadingOut }
enum | State { Hidden , FadingIn , Visible , FadingOut }
| This class handles complex visibility situations for items. More...

## Public Slots
void | hide ()
void | hideAndRemoveItem (QObject *item)
| Hide the item, and then remove it.
void | hideItem (QObject *item)
void | setDirectlyVisible (bool visible)
void | setItemDirectlyVisible (QObject *item, bool visible)
void | setItemThatShallBeShown (QObject *item)
| Sets a single item to be shown.
void | setItemVisible (QObject *item, bool visible)
void | setShallBeShown (bool shallBeShown)
| Adjusts the first condition - the items are shown if shallBeShown is true and isVisible is true.
void | setShallBeShownDirectly (bool shallBeShown)
void | setVisible (bool visible)
void | show ()
| Adjusts the main condition.
void | showItem (QObject *item)
| Shows or hides a single item.

## Signals
void | hiddenAndRemoved (QObject *item)
| Emitted when hideAndRemoveItem has finished.
void | propertiesAssigned (bool visible)
| Emitted when the (main) transition has finished.
void | propertiesAssignedToItem (QObject *item, bool visible)
| Emitted when a transition for a single item finished (see setItemVisible())

## Public Member Functions
| ItemVisibilityController (QObject *const parent=nullptr)
void | addItem (QObject *const object)
| Add and remove objects.
void | clear ()
| Remove all animations.
bool | hasVisibleItems (IncludeFadingOutMode mode=IncludeFadingOut) const
| This returns the "result" of isVisible and shallBeShown: Something is indeed visible on the scene.
bool | isVisible () const
QList< QObject * > | items () const
| Returns all items under control.
void | removeItem (QObject *const object)
void | setAnimationDuration (int msecs)
void | setEasingCurve (const QEasingCurve &easing)
| Allows to change the default parameters of all animations.
bool | shallBeShown () const
State | state () const
QList< QObject * > | visibleItems (IncludeFadingOutMode mode=IncludeFadingOut) const
| Returns all currently visible items.

## Protected Slots
void | animationFinished ()
void | objectDestroyed (QObject *)

## Protected Member Functions
virtual QPropertyAnimation * | createAnimation (QObject *item)
| Creates the animation for showing and hiding the given item.

## Properties
bool | shallBeShown
bool | visible

## Member Enumeration Documentation

## ◆ IncludeFadingOutMode

enum Digikam::ItemVisibilityController::IncludeFadingOutMode

Enumerator
IncludeFadingOut | In addition to items visible or fading in, return those fading out.
ExcludeFadingOut | Do not return those items currently fading out (soon to be hidden)

## ◆ State

enum Digikam::ItemVisibilityController::State

There is a 3-tiered approach: 1) shallBeShown determines if the items shall at any time be shown. If it is false, items will never be shown. Default is true, so you can ignore this setting. 2) visible determines if the items shall be shown now. Only takes effect if shallBeShown is true. Default is false: Initially, controlled items are hidden. 3) Opacity and individual item visibility: When showing, items are first set to individually visible, then their opacity is increased from 0 to 1. When hiding, opacity is first decreased from 1 to 0, then they are set individually to hidden. Different types of items can be handled:

- a group of items with an "opacity" and "visible" property
- a single item with an "opacity" and "visible" property
- a proxy object with these properties (see above)

## Member Function Documentation

## ◆ addItem()

void Digikam::ItemVisibilityController::addItem | ( | QObject *const | object | ) |

The given objects shall provide an "opacity" and a "visible" property. You can, for convenience, use a ItemVisibilityControllerPropertyObject as a value container, if your items do not provide these properties directly. No ownership is taken, so the objects should live as long as this object is used.

## ◆ createAnimation()

QPropertyAnimation * Digikam::ItemVisibilityController::createAnimation | ( | QObject * | item | ) |
| protected virtual

The item is given for information only, you do not need to use it. The default implementation creates and animation for "opacity" from 0.0 to 1.0, using default easing curve and duration, which can and will be changed by setEasingCurve and setAnimationDuration.

## ◆ hasVisibleItems()

bool Digikam::ItemVisibilityController::hasVisibleItems | ( | IncludeFadingOutMode | mode = `IncludeFadingOut` | ) | const

Also returns false if no items are available.

## ◆ hideAndRemoveItem

void Digikam::ItemVisibilityController::hideAndRemoveItem | ( | QObject * | item | ) |
| slot

When finished, hiddenAndRemoved() is emitted.

## ◆ setItemThatShallBeShown

void Digikam::ItemVisibilityController::setItemThatShallBeShown | ( | QObject * | item | ) |
| slot

Calling setVisible() will effectively effect only this single item, as if calling setItemVisible(). Reset by calling with 0 or setShallBeShown().

## ◆ show

void Digikam::ItemVisibilityController::show | ( |  | ) |
| slot

All items are affected. If any items were shown or hidden separately, they will be resynchronized. "Directly" means no animation is employed.

## ◆ showItem

void Digikam::ItemVisibilityController::showItem | ( | QObject * | item | ) |
| slot

The item's status is changed individually. The next call to the "global" method will take precedence again. "Directly" means no animation is employed.