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

Public Types

enum  Labels { Ratings = 0 , Picks , Colors }
 
enum  StateSavingDepth { INSTANCE , DIRECT_CHILDREN , RECURSIVE }
 

Signals

void signalSetCurrentAlbum ()
 

Public Member Functions

QPixmap colorRectPixmap (const QColor &color) const
 Creates a 30*30 rectangular pixmap with specific color. More...
 
void doLoadState () override
 Loading and saving state function inherited from StateSavingObject. More...
 
void doSaveState () override
 
StateSavingDepth getStateSavingDepth () const
 
QPixmap goldenStarPixmap (bool fillin=true) const
 
bool isCheckable () const
 
bool isLoadingState () const
 
 LabelsTreeView (QWidget *const parent=nullptr, bool setCheckable=false)
 
void loadState ()
 
void restoreSelectionFromHistory (QHash< Labels, QList< int > > neededLabels)
 Restores the selection state from the AlbumHistory class. More...
 
void saveState ()
 
QHash< Labels, QList< int > > selectedLabels ()
 Provide the current selection from the tree-view hierarchy. More...
 
virtual void setConfigGroup (const KConfigGroup &group)
 
void setCurrentAlbum ()
 Emits a signal to the search handler to set the Current album from currently selected labels. More...
 
virtual void setEntryPrefix (const QString &prefix)
 
void setStateSavingDepth (const StateSavingDepth depth)
 
 ~LabelsTreeView () override
 

Protected Member Functions

QString entryName (const QString &base) const
 
KConfigGroup getConfigGroup () const
 

Member Enumeration Documentation

◆ Labels

Enumerator
Ratings 
Picks 
Colors 

◆ StateSavingDepth

This enum defines the "depth" of the StateSavingObject::loadState() and StateSavingObject::saveState() methods.

Enumerator
INSTANCE 

Only the instance the saving / restoring was invoked on is saved / restored.

DIRECT_CHILDREN 

The instance itself and all direct children of this instance implementing StateSavingObject are saved / restored.

RECURSIVE 

The instance and all children in the complete hierarchy are saved / restored.

Constructor & Destructor Documentation

◆ LabelsTreeView()

Digikam::LabelsTreeView::LabelsTreeView ( QWidget *const  parent = nullptr,
bool  setCheckable = false 
)
explicit

◆ ~LabelsTreeView()

Digikam::LabelsTreeView::~LabelsTreeView ( )
override

Member Function Documentation

◆ colorRectPixmap()

QPixmap Digikam::LabelsTreeView::colorRectPixmap ( const QColor &  color) const

Creates a 30*30 rectangular pixmap with specific color.

Parameters
colorwanted to be set
Returns
pixmap has a rectangle filled with the color

◆ doLoadState()

void Digikam::LabelsTreeView::doLoadState ( )
overridevirtual

Loading and saving state function inherited from StateSavingObject.

Implements Digikam::StateSavingObject.

References Digikam::StateSavingObject::entryName(), and Digikam::StateSavingObject::getConfigGroup().

◆ doSaveState()

void Digikam::LabelsTreeView::doSaveState ( )
overridevirtual

Implement this hook method for state saving. Use getConfigGroup() and entryName() for the implementation.

Implements Digikam::StateSavingObject.

References Colors, Digikam::StateSavingObject::entryName(), Digikam::StateSavingObject::getConfigGroup(), Picks, Ratings, and selectedLabels().

◆ entryName()

QString Digikam::StateSavingObject::entryName ( const QString &  base) const
protectedinherited

Always use this method to create config group entry names. This allows to manipulate the entry keys externally by eg. setting a prefix.

Parameters
baseoriginal name planned for the config group entry
Returns
entry name after manipulating it with externally set parameters

Referenced by Digikam::FilterSideBarWidget::doLoadState(), Digikam::AbstractAlbumTreeView::doLoadState(), Digikam::AbstractCheckableAlbumTreeView::doLoadState(), doLoadState(), Digikam::ImportItemPropertiesSideBarImport::doLoadState(), Digikam::ItemPropertiesSideBar::doLoadState(), Digikam::ItemPropertiesSideBarDB::doLoadState(), Digikam::TagCheckView::doLoadState(), Digikam::Sidebar::doLoadState(), Digikam::SearchTextBar::doLoadState(), ShowFoto::ShowfotoFolderViewSideBar::doLoadState(), ShowFoto::ShowfotoStackViewSideBar::doLoadState(), Digikam::FaceScanWidget::doLoadState(), Digikam::FuzzySearchView::doLoadState(), Digikam::GPSSearchView::doLoadState(), Digikam::FilterSideBarWidget::doSaveState(), Digikam::AbstractAlbumTreeView::doSaveState(), Digikam::AbstractCheckableAlbumTreeView::doSaveState(), doSaveState(), Digikam::ImportItemPropertiesSideBarImport::doSaveState(), Digikam::ItemPropertiesSideBar::doSaveState(), Digikam::ItemPropertiesSideBarDB::doSaveState(), Digikam::TagCheckView::doSaveState(), Digikam::Sidebar::doSaveState(), Digikam::SearchTextBar::doSaveState(), ShowFoto::ShowfotoFolderViewSideBar::doSaveState(), ShowFoto::ShowfotoStackViewSideBar::doSaveState(), Digikam::FaceScanWidget::doSaveState(), Digikam::FuzzySearchView::doSaveState(), and Digikam::GPSSearchView::doSaveState().

◆ getConfigGroup()

KConfigGroup Digikam::StateSavingObject::getConfigGroup ( ) const
protectedinherited

Returns the config group that must be used for state saving and loading.

Returns
config group for state saving and loading

Referenced by Digikam::AlbumFolderViewSideBarWidget::AlbumFolderViewSideBarWidget(), Digikam::DateFolderViewSideBarWidget::DateFolderViewSideBarWidget(), Digikam::FilterSideBarWidget::doLoadState(), Digikam::TagViewSideBarWidget::doLoadState(), Digikam::TimelineSideBarWidget::doLoadState(), Digikam::MapWidgetView::doLoadState(), Digikam::TableView::doLoadState(), Digikam::AbstractAlbumTreeView::doLoadState(), Digikam::AbstractCheckableAlbumTreeView::doLoadState(), doLoadState(), Digikam::ImportItemPropertiesSideBarImport::doLoadState(), Digikam::ItemPropertiesSideBar::doLoadState(), Digikam::ItemPropertiesSideBarDB::doLoadState(), Digikam::TagsManager::doLoadState(), Digikam::TagCheckView::doLoadState(), Digikam::Sidebar::doLoadState(), Digikam::SearchTextBar::doLoadState(), ShowFoto::ShowfotoFolderViewSideBar::doLoadState(), ShowFoto::ShowfotoStackViewSideBar::doLoadState(), Digikam::FaceScanWidget::doLoadState(), Digikam::FuzzySearchView::doLoadState(), Digikam::GPSSearchView::doLoadState(), Digikam::FilterSideBarWidget::doSaveState(), Digikam::TagViewSideBarWidget::doSaveState(), Digikam::TimelineSideBarWidget::doSaveState(), Digikam::MapWidgetView::doSaveState(), Digikam::TableView::doSaveState(), Digikam::AbstractAlbumTreeView::doSaveState(), Digikam::AbstractCheckableAlbumTreeView::doSaveState(), doSaveState(), Digikam::ImportItemPropertiesSideBarImport::doSaveState(), Digikam::ItemPropertiesSideBar::doSaveState(), Digikam::ItemPropertiesSideBarDB::doSaveState(), Digikam::TagsManager::doSaveState(), Digikam::TagCheckView::doSaveState(), Digikam::Sidebar::doSaveState(), Digikam::SearchTextBar::doSaveState(), ShowFoto::ShowfotoFolderViewSideBar::doSaveState(), ShowFoto::ShowfotoStackViewSideBar::doSaveState(), Digikam::FaceScanWidget::doSaveState(), Digikam::FuzzySearchView::doSaveState(), Digikam::GPSSearchView::doSaveState(), Digikam::FuzzySearchSideBarWidget::FuzzySearchSideBarWidget(), Digikam::GPSSearchSideBarWidget::GPSSearchSideBarWidget(), Digikam::LabelsSideBarWidget::LabelsSideBarWidget(), Digikam::PeopleSideBarWidget::PeopleSideBarWidget(), Digikam::SearchSideBarWidget::SearchSideBarWidget(), Digikam::TagsManager::setupUi(), Digikam::TagViewSideBarWidget::TagViewSideBarWidget(), and Digikam::TimelineSideBarWidget::TimelineSideBarWidget().

◆ getStateSavingDepth()

StateSavingObject::StateSavingDepth Digikam::StateSavingObject::getStateSavingDepth ( ) const
inherited

Returns the depth used for state saving or loading. Default is StateSavingDepth::INSTANCE.

Returns
state saving / restoring depth

◆ goldenStarPixmap()

QPixmap Digikam::LabelsTreeView::goldenStarPixmap ( bool  fillin = true) const
Returns
a Pixmap of a 30*30 pixels golden star used for rating and widget icon

References Digikam::RatingWidget::starPolygon().

◆ isCheckable()

bool Digikam::LabelsTreeView::isCheckable ( ) const
Returns
true if the tree widget is checkable and false if not

◆ isLoadingState()

bool Digikam::LabelsTreeView::isLoadingState ( ) const
Returns
true if Loading state function is running

◆ loadState()

void Digikam::StateSavingObject::loadState ( )
inherited

◆ restoreSelectionFromHistory()

void Digikam::LabelsTreeView::restoreSelectionFromHistory ( QHash< Labels, QList< int > >  neededLabels)

Restores the selection state from the AlbumHistory class.

Parameters
neededLabelsis a QHash to restore the selection from it, the hash is formatted just like the hash generated from
See also
selectedLabels()

References Colors, Picks, and Ratings.

◆ saveState()

◆ selectedLabels()

QHash< LabelsTreeView::Labels, QList< int > > Digikam::LabelsTreeView::selectedLabels ( )

Provide the current selection from the tree-view hierarchy.

Returns
a QHash with three keys: "Ratings", "Picks", and "Colors", every key dedicated to an int list which holds the rows selected

References Colors, Picks, and Ratings.

Referenced by doSaveState().

◆ setConfigGroup()

void Digikam::StateSavingObject::setConfigGroup ( const KConfigGroup &  group)
virtualinherited

Sets a dedicated config group that will be used to store and reload the state from. If this method is not called, a group based on the object name is used.

You can re-implement this method to pass the group set here to child objects. Don't forget to call this method in your implementation.

Parameters
groupconfig group to use for state saving and restoring

Reimplemented in Digikam::GPSSearchView, Digikam::FuzzySearchView, Digikam::FilterSideBarWidget, and Digikam::DateFolderView.

Referenced by Digikam::ImageWindow::closeEvent(), Digikam::DateFolderView::setConfigGroup(), Digikam::FilterSideBarWidget::setConfigGroup(), Digikam::FuzzySearchView::setConfigGroup(), and Digikam::GPSSearchView::setConfigGroup().

◆ setCurrentAlbum()

void Digikam::LabelsTreeView::setCurrentAlbum ( )

Emits a signal to the search handler to set the Current album from currently selected labels.

References signalSetCurrentAlbum().

◆ setEntryPrefix()

void Digikam::StateSavingObject::setEntryPrefix ( const QString &  prefix)
virtualinherited

Define a prefix that will be used for every entry in the config group. The default prefix is empty.

You can re-implement this method to pass the prefix set here to child objects. Don't forget to call this method in your implementation.

Parameters
prefixthe prefix to use for the config entries

References prefix.

◆ setStateSavingDepth()

void Digikam::StateSavingObject::setStateSavingDepth ( const StateSavingDepth  depth)
inherited

Sets the depth used for state saving or loading.

Parameters
depthnew depth to use

◆ signalSetCurrentAlbum

void Digikam::LabelsTreeView::signalSetCurrentAlbum ( )
signal

Referenced by setCurrentAlbum().


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