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

Classes

class  Private
 

Public Types

enum  StateSavingDepth { INSTANCE , DIRECT_CHILDREN , RECURSIVE }
 
enum  TextStyle { ActiveIconText = 0 , AllIconsText = 2 }
 

Signals

void signalChangedTab (QWidget *w)
 
void signalViewChanged ()
 

Public Member Functions

void activeNextTab ()
 
void activePreviousTab ()
 
void appendButton (const QPixmap &pic, int id=-1, QMenu *const popup=nullptr, const QString &not_used_yet=QString())
 
void appendTab (const QPixmap &pic, int id=-1, const QString &text=QString())
 
void appendTab (QWidget *const w, const QIcon &pic, const QString &title)
 
void backup ()
 
void backup (const QList< QWidget * > &thirdWidgetsToBackup, QList< int > *const sizes)
 
DMultiTabBarButtonbutton (int id) const
 
void deleteTab (QWidget *const w)
 
void expand ()
 
QWidget * getActiveTab () const
 
StateSavingDepth getStateSavingDepth () const
 
bool isExpanded () const
 
bool isTabRaised (int id) const
 
void loadState ()
 
Qt::Edge position () const
 
void removeButton (int id)
 
void removeTab (int id)
 
void restore ()
 
void restore (const QList< QWidget * > &thirdWidgetsToRestore, const QList< int > &sizes)
 
void saveState ()
 
void setActiveTab (QWidget *const w)
 
virtual void setConfigGroup (const KConfigGroup &group)
 
virtual void setEntryPrefix (const QString &prefix)
 
void setPosition (Qt::Edge pos)
 
void setStateSavingDepth (const StateSavingDepth depth)
 
void setStyle (TextStyle style)
 
void setTab (int id, bool state)
 
void shrink ()
 
 Sidebar (QWidget *const parent, SidebarSplitter *const sp, Qt::Edge side=Qt::LeftEdge, bool minimizedDefault=false)
 
SidebarSplittersplitter () const
 
DMultiTabBarTabtab (int id) const
 
TextStyle tabStyle () const
 
 ~Sidebar () override
 

Protected Member Functions

void doLoadState () override
 
void doSaveState () override
 
QString entryName (const QString &base) const
 
virtual void fontChange (const QFont &)
 
KConfigGroup getConfigGroup () const
 
void updateSeparator ()
 

Friends

class SidebarSplitter
 

Detailed Description

This class handles a sidebar view

Since this class derives from StateSavingObject, you can call StateSavingObject::loadState() and StateSavingObject::saveState() for loading/saving of settings. However, if you use multiple sidebar instances in your program, you have to remember to either call QObject::setObjectName(), StateSavingObject::setEntryPrefix() or StateSavingObject::setConfigGroup() first.

Member Enumeration Documentation

◆ 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.

◆ TextStyle

The list of available styles for DMultiTabBar

Enumerator
ActiveIconText 

Always shows icon, only show the text of active tabs.

AllIconsText 

Always shows the text and icons.

Constructor & Destructor Documentation

◆ Sidebar()

Digikam::Sidebar::Sidebar ( QWidget *const  parent,
SidebarSplitter *const  sp,
Qt::Edge  side = Qt::LeftEdge,
bool  minimizedDefault = false 
)
explicit

Creates a new sidebar

Parameters
parentsidebar's parent
spsets the splitter, which should handle the width. The splitter normally is part of the main view. Internally, the width of the widget stack can be changed by a QSplitter.
sidewhere the sidebar should be displayed. At the left or right border. Use Qt::LeftEdge or Qt::RightEdge.
minimizedDefaulthide the sidebar when the program is started the first time.

References Digikam::DMultiTabBar::ActiveIconText, Digikam::Sidebar::Private::dragSwitchTimer, Digikam::Sidebar::Private::minimizedDefault, Digikam::DMultiTabBar::setStyle(), Digikam::Sidebar::Private::splitter, and Digikam::Sidebar::Private::stack.

◆ ~Sidebar()

Digikam::Sidebar::~Sidebar ( )
override

Member Function Documentation

◆ activeNextTab()

void Digikam::Sidebar::activeNextTab ( )

Activates a next tab from current one. If current one is last, first one is activated.

References setActiveTab(), Digikam::Sidebar::Private::stack, Digikam::DMultiTabBar::tab(), and Digikam::Sidebar::Private::tabs.

Referenced by Digikam::ItemIconView::nextLeftSideBarTab(), and Digikam::ItemIconView::nextRightSideBarTab().

◆ activePreviousTab()

void Digikam::Sidebar::activePreviousTab ( )

Activates a previous tab from current one. If current one is first, last one is activated.

References setActiveTab(), Digikam::Sidebar::Private::stack, Digikam::DMultiTabBar::tab(), and Digikam::Sidebar::Private::tabs.

Referenced by Digikam::ItemIconView::previousLeftSideBarTab(), and Digikam::ItemIconView::previousRightSideBarTab().

◆ appendButton()

void Digikam::DMultiTabBar::appendButton ( const QPixmap &  pic,
int  id = -1,
QMenu *const  popup = nullptr,
const QString &  not_used_yet = QString() 
)
inherited

append a new button to the button area. The button can later on be accessed with button(ID) eg for connecting signals to it

Parameters
pica pixmap for the button
idan arbitrary ID value. It will be emitted in the clicked signal for identifying the button if more than one button is connected to a signals.
popupA popup menu which should be displayed if the button is clicked
not_used_yetwill be used for a popup text in the future

References Digikam::DMultiTabBar::Private::btnTabSep, Digikam::DMultiTabBar::Private::buttons, Digikam::DMultiTabBar::DMultiTabBarButton, and Digikam::DMultiTabBar::Private::layout.

◆ appendTab() [1/2]

void Digikam::DMultiTabBar::appendTab ( const QPixmap &  pic,
int  id = -1,
const QString &  text = QString() 
)
inherited

append a new tab to the tab area. It can be accessed later on with tabb(id);

Parameters
pica bitmap for the tab
idan arbitrary ID which can be used later on to identify the tab
textif a mode with text is used it will be the tab text, otherwise a mouse over hint

References Digikam::DMultiTabBarFrame::appendTab(), and Digikam::DMultiTabBar::Private::internal.

Referenced by appendTab().

◆ appendTab() [2/2]

◆ backup() [1/2]

void Digikam::Sidebar::backup ( )

Hide sidebar and backup minimized state.

References Digikam::Sidebar::Private::isMinimized, Digikam::Sidebar::Private::minimized, and shrink().

Referenced by backup(), and Digikam::ItemIconView::hideSideBars().

◆ backup() [2/2]

void Digikam::Sidebar::backup ( const QList< QWidget * > &  thirdWidgetsToBackup,
QList< int > *const  sizes 
)

Hide sidebar and backup minimized state. If there are other widgets in this splitter, stores their sizes in the provided list.

References backup(), Digikam::SidebarSplitter::size(), and Digikam::Sidebar::Private::splitter.

◆ button()

DMultiTabBarButton * Digikam::DMultiTabBar::button ( int  id) const
inherited

get a pointer to a button within the button area identified by its ID

References Digikam::DMultiTabBar::Private::buttons, and Digikam::DMultiTabBarButton::id().

◆ deleteTab()

◆ doLoadState()

◆ doSaveState()

◆ 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(), Digikam::LabelsTreeView::doLoadState(), Digikam::ImportItemPropertiesSideBarImport::doLoadState(), Digikam::ItemPropertiesSideBar::doLoadState(), Digikam::ItemPropertiesSideBarDB::doLoadState(), Digikam::TagCheckView::doLoadState(), 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(), Digikam::LabelsTreeView::doSaveState(), Digikam::ImportItemPropertiesSideBarImport::doSaveState(), Digikam::ItemPropertiesSideBar::doSaveState(), Digikam::ItemPropertiesSideBarDB::doSaveState(), Digikam::TagCheckView::doSaveState(), doSaveState(), Digikam::SearchTextBar::doSaveState(), ShowFoto::ShowfotoFolderViewSideBar::doSaveState(), ShowFoto::ShowfotoStackViewSideBar::doSaveState(), Digikam::FaceScanWidget::doSaveState(), Digikam::FuzzySearchView::doSaveState(), and Digikam::GPSSearchView::doSaveState().

◆ expand()

◆ fontChange()

void Digikam::DMultiTabBar::fontChange ( const QFont &  )
protectedvirtualinherited

◆ getActiveTab()

◆ 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(), Digikam::LabelsTreeView::doLoadState(), Digikam::ImportItemPropertiesSideBarImport::doLoadState(), Digikam::ItemPropertiesSideBar::doLoadState(), Digikam::ItemPropertiesSideBarDB::doLoadState(), Digikam::TagsManager::doLoadState(), Digikam::TagCheckView::doLoadState(), 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(), Digikam::LabelsTreeView::doSaveState(), Digikam::ImportItemPropertiesSideBarImport::doSaveState(), Digikam::ItemPropertiesSideBar::doSaveState(), Digikam::ItemPropertiesSideBarDB::doSaveState(), Digikam::TagsManager::doSaveState(), Digikam::TagCheckView::doSaveState(), 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

◆ isExpanded()

bool Digikam::Sidebar::isExpanded ( ) const

Return the visible status of current sidebar tab.

References Digikam::Sidebar::Private::minimized.

Referenced by Digikam::ItemIconView::toggleLeftSidebar(), and Digikam::ItemIconView::toggleRightSidebar().

◆ isTabRaised()

bool Digikam::DMultiTabBar::isTabRaised ( int  id) const
inherited

return the state of a tab, identified by its ID

References Digikam::DMultiTabBar::tab().

◆ loadState()

void Digikam::StateSavingObject::loadState ( )
inherited

◆ position()

Qt::Edge Digikam::DMultiTabBar::position ( ) const
inherited

get the tabbar position.

Returns
position

References Digikam::DMultiTabBar::Private::position.

◆ removeButton()

void Digikam::DMultiTabBar::removeButton ( int  id)
inherited

remove a button with the given ID

References Digikam::DMultiTabBar::Private::btnTabSep, and Digikam::DMultiTabBar::Private::buttons.

◆ removeTab()

void Digikam::DMultiTabBar::removeTab ( int  id)
inherited

remove a tab with a given ID

References Digikam::DMultiTabBar::Private::internal, and Digikam::DMultiTabBarFrame::removeTab().

Referenced by deleteTab().

◆ restore() [1/2]

void Digikam::Sidebar::restore ( )

Show sidebar and restore minimized state.

References expand(), and Digikam::Sidebar::Private::isMinimized.

Referenced by restore(), and Digikam::ItemIconView::showSideBars().

◆ restore() [2/2]

void Digikam::Sidebar::restore ( const QList< QWidget * > &  thirdWidgetsToRestore,
const QList< int > &  sizes 
)

Show sidebar and restore minimized state. Restores other widgets' sizes in splitter.

References restore(), Digikam::SidebarSplitter::setSize(), and Digikam::Sidebar::Private::splitter.

◆ saveState()

◆ setActiveTab()

◆ 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().

◆ 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.

◆ setPosition()

void Digikam::DMultiTabBar::setPosition ( Qt::Edge  pos)
inherited

set the real position of the widget.

Parameters
posif the mode is horizontal, only use top, bottom, if it is vertical use left or right

References Digikam::DMultiTabBar::Private::internal, Digikam::DMultiTabBar::Private::position, and Digikam::DMultiTabBarFrame::setPosition().

Referenced by Digikam::DMultiTabBar::DMultiTabBar().

◆ setStateSavingDepth()

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

Sets the depth used for state saving or loading.

Parameters
depthnew depth to use

◆ setStyle()

◆ setTab()

void Digikam::DMultiTabBar::setTab ( int  id,
bool  state 
)
inherited

set a tab to "raised"

Parameters
idThe ID of the tab to manipulate
statetrue == activated/raised, false == not active

References Digikam::DMultiTabBarTab::setState(), and Digikam::DMultiTabBar::tab().

Referenced by deleteTab(), and doLoadState().

◆ shrink()

◆ signalChangedTab

◆ signalViewChanged

void Digikam::Sidebar::signalViewChanged ( )
signal

Is emitted, when tab is shrink or expanded

Referenced by shrink().

◆ splitter()

SidebarSplitter * Digikam::Sidebar::splitter ( ) const

◆ tab()

◆ tabStyle()

DMultiTabBar::TextStyle Digikam::DMultiTabBar::tabStyle ( ) const
inherited

get the display style of the tabs

Returns
display style

References Digikam::DMultiTabBar::Private::internal.

◆ updateSeparator()

void Digikam::DMultiTabBar::updateSeparator ( )
protectedinherited

Friends And Related Function Documentation

◆ SidebarSplitter

friend class SidebarSplitter
friend

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