digiKam
Digikam::HidingStateChanger Class Reference
+ Inheritance diagram for Digikam::HidingStateChanger:

Public Types

enum  IncludeFadingOutMode { IncludeFadingOut , ExcludeFadingOut }
 
enum  State { Hidden , FadingIn , Visible , FadingOut }
 

Public Slots

void changeValue (const QVariant &value)
 
void hide ()
 
void hideAndRemoveItem (QObject *item)
 
void hideItem (QObject *item)
 
void setDirectlyVisible (bool visible)
 
void setItemDirectlyVisible (QObject *item, bool visible)
 
void setItemThatShallBeShown (QObject *item)
 
void setItemVisible (QObject *item, bool visible)
 
void setShallBeShown (bool shallBeShown)
 
void setShallBeShownDirectly (bool shallBeShown)
 
void setVisible (bool visible)
 
void show ()
 
void showItem (QObject *item)
 

Signals

void finished ()
 
void hiddenAndRemoved (QObject *item)
 
void propertiesAssigned (bool visible)
 
void propertiesAssigned (QObject *item, bool visible)
 
void stateChanged ()
 

Public Member Functions

void addItem (QObject *object)
 
void clear ()
 
bool hasVisibleItems (IncludeFadingOutMode mode=IncludeFadingOut) const
 
 HidingStateChanger (QObject *const parent=nullptr)
 
 HidingStateChanger (QObject *const target, const QByteArray &property, QObject *const parent=nullptr)
 
bool isVisible () const
 
QList< QObject * > items () const
 
void removeItem (QObject *object)
 
void setAnimationDuration (int msecs)
 
void setEasingCurve (const QEasingCurve &easing)
 
void setPropertyName (const QByteArray &propertyName)
 
void setTargetObject (QObject *const object)
 
bool shallBeShown () const
 
State state () const
 
QList< QObject * > visibleItems (IncludeFadingOutMode mode=IncludeFadingOut) const
 

Protected Slots

void animationFinished ()
 
void objectDestroyed (QObject *)
 
void slotPropertiesAssigned (bool)
 

Protected Member Functions

virtual QPropertyAnimation * createAnimation (QObject *item)
 

Protected Attributes

QObject * m_object
 
QByteArray m_property
 
QVariant m_value
 

Properties

bool shallBeShown
 
bool visible
 

Member Enumeration Documentation

◆ 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

This class handles complex visibility situations for items. 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)
Enumerator
Hidden 
FadingIn 
Visible 
FadingOut 

Constructor & Destructor Documentation

◆ HidingStateChanger() [1/2]

Digikam::HidingStateChanger::HidingStateChanger ( QObject *const  parent = nullptr)
explicit

This class provides a state change while fading in and out: When changeValue is called, first the items are hidden, when this is finished, the property is assigned to the object. Afterwards, the items are shown again. Note that the targetObject is not necessarily a controlled item!

References Digikam::ItemVisibilityController::propertiesAssigned(), and slotPropertiesAssigned().

◆ HidingStateChanger() [2/2]

Digikam::HidingStateChanger::HidingStateChanger ( QObject *const  target,
const QByteArray &  property,
QObject *const  parent = nullptr 
)

Member Function Documentation

◆ addItem()

void Digikam::ItemVisibilityController::addItem ( QObject *  object)
inherited

Add and remove objects. 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.

References Digikam::ItemVisibilityController::createAnimation().

Referenced by Digikam::AnimatedVisibility::AnimatedVisibility(), Digikam::AssignNameWidgetStates::AssignNameWidgetStates(), Digikam::FaceGroup::slotAddItemMoving(), and Digikam::FocusPointGroup::slotAddItemMoving().

◆ animationFinished

void Digikam::ItemVisibilityController::animationFinished ( )
protectedslotinherited

◆ changeValue

void Digikam::HidingStateChanger::changeValue ( const QVariant &  value)
slot

◆ clear()

◆ createAnimation()

QPropertyAnimation * Digikam::ItemVisibilityController::createAnimation ( QObject *  item)
protectedvirtualinherited

Creates the animation for showing and hiding the given item. 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.

Referenced by Digikam::ItemVisibilityController::addItem().

◆ finished

void Digikam::HidingStateChanger::finished ( )
signal

Emitted when the items were hidden, the target object's property changed, and the items shown again

Referenced by slotPropertiesAssigned().

◆ hasVisibleItems()

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

This returns the "result" of isVisible and shallBeShown: Something is indeed visible on the scene. Also returns false if no items are available.

Referenced by changeValue(), Digikam::FaceGroup::hasVisibleItems(), and Digikam::FocusPointGroup::hasVisibleItems().

◆ hiddenAndRemoved

void Digikam::ItemVisibilityController::hiddenAndRemoved ( QObject *  item)
signalinherited

Emitted when hideAndRemoveItem has finished

◆ hide

void Digikam::ItemVisibilityController::hide ( )
slotinherited

◆ hideAndRemoveItem

void Digikam::ItemVisibilityController::hideAndRemoveItem ( QObject *  item)
slotinherited

Hide the item, and then remove it. When finished, hiddenAndRemoved() is emitted.

Referenced by Digikam::FaceGroup::slotRejected().

◆ hideItem

void Digikam::ItemVisibilityController::hideItem ( QObject *  item)
slotinherited

◆ isVisible()

bool Digikam::ItemVisibilityController::isVisible ( ) const
inherited

◆ items()

QList< QObject * > Digikam::ItemVisibilityController::items ( ) const
inherited

Returns all items under control

Referenced by Digikam::ItemVisibilityController::visibleItems().

◆ objectDestroyed

void Digikam::ItemVisibilityController::objectDestroyed ( QObject *  item)
protectedslotinherited

◆ propertiesAssigned [1/2]

void Digikam::ItemVisibilityController::propertiesAssigned ( bool  visible)
signalinherited

Emitted when the (main) transition has finished

Referenced by Digikam::ItemVisibilityController::animationFinished(), and HidingStateChanger().

◆ propertiesAssigned [2/2]

void Digikam::ItemVisibilityController::propertiesAssigned ( QObject *  item,
bool  visible 
)
signalinherited

Emitted when a transition for a single item finished (see setItemVisible())

◆ removeItem()

void Digikam::ItemVisibilityController::removeItem ( QObject *  object)
inherited

◆ setAnimationDuration()

void Digikam::ItemVisibilityController::setAnimationDuration ( int  msecs)
inherited

◆ setDirectlyVisible

void Digikam::ItemVisibilityController::setDirectlyVisible ( bool  visible)
slotinherited

◆ setEasingCurve()

void Digikam::ItemVisibilityController::setEasingCurve ( const QEasingCurve &  easing)
inherited

Allows to change the default parameters of all animations.

◆ setItemDirectlyVisible

void Digikam::ItemVisibilityController::setItemDirectlyVisible ( QObject *  item,
bool  visible 
)
slotinherited

◆ setItemThatShallBeShown

void Digikam::ItemVisibilityController::setItemThatShallBeShown ( QObject *  item)
slotinherited

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

References Digikam::ItemVisibilityController::setVisible().

Referenced by Digikam::FocusPointGroup::setVisibleItem(), Digikam::FaceGroup::setVisibleItem(), and Digikam::FocusPointGroup::slotAddItemMoving().

◆ setItemVisible

void Digikam::ItemVisibilityController::setItemVisible ( QObject *  item,
bool  visible 
)
slotinherited

◆ setPropertyName()

void Digikam::HidingStateChanger::setPropertyName ( const QByteArray &  propertyName)

References m_property.

Referenced by HidingStateChanger().

◆ setShallBeShown

void Digikam::ItemVisibilityController::setShallBeShown ( bool  shallBeShown)
slotinherited

◆ setShallBeShownDirectly

void Digikam::ItemVisibilityController::setShallBeShownDirectly ( bool  shallBeShown)
slotinherited

◆ setTargetObject()

void Digikam::HidingStateChanger::setTargetObject ( QObject *const  object)

References m_object.

Referenced by HidingStateChanger().

◆ setVisible

◆ shallBeShown()

bool Digikam::ItemVisibilityController::shallBeShown ( ) const
inherited

◆ show

void Digikam::ItemVisibilityController::show ( )
slotinherited

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

References Digikam::ItemVisibilityController::setVisible().

Referenced by Digikam::FaceGroup::itemStateChanged(), Digikam::FocusPointGroup::itemStateChanged(), Digikam::FaceGroup::load(), Digikam::FocusPointGroup::load(), and slotPropertiesAssigned().

◆ showItem

void Digikam::ItemVisibilityController::showItem ( QObject *  item)
slotinherited

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

References Digikam::ItemVisibilityController::setItemVisible().

Referenced by Digikam::FaceGroup::slotAddItemMoving(), and Digikam::FocusPointGroup::slotAddItemMoving().

◆ slotPropertiesAssigned

void Digikam::HidingStateChanger::slotPropertiesAssigned ( bool  visible)
protectedslot

◆ state()

ItemVisibilityController::State Digikam::ItemVisibilityController::state ( ) const
inherited

◆ stateChanged

void Digikam::HidingStateChanger::stateChanged ( )
signal

Emitted when the items were hidden and the target object's property changed

Referenced by Digikam::AssignNameWidgetStates::AssignNameWidgetStates(), and slotPropertiesAssigned().

◆ visibleItems()

QList< QObject * > Digikam::ItemVisibilityController::visibleItems ( IncludeFadingOutMode  mode = IncludeFadingOut) const
inherited

Returns all currently visible items.

References Digikam::ItemVisibilityController::items().

Referenced by Digikam::FaceGroup::itemHoverMoveEvent().

Member Data Documentation

◆ m_object

QObject* Digikam::HidingStateChanger::m_object
protected

◆ m_property

QByteArray Digikam::HidingStateChanger::m_property
protected

◆ m_value

QVariant Digikam::HidingStateChanger::m_value
protected

Property Documentation

◆ shallBeShown

◆ visible


The documentation for this class was generated from the following files: