digiKam Developer Documentation: Digikam::Sidebar Class Reference

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

Loading...
Searching...
No Matches
Signals | Public Member Functions | Protected Member Functions | Friends | List of all members
Digikam::Sidebar Class Reference

This class handles a sidebar view. More...

Inheritance diagram for Digikam::Sidebar:

## Signals
void | signalChangedTab (QWidget *w)
| Is emitted, when another tab is activated.
void | signalViewChanged ()
| Is emitted, when tab is shrink or expanded.

## Public Member Functions
| Sidebar (QWidget *const parent, SidebarSplitter *const sp, Qt::Edge side=Qt::LeftEdge, bool minimizedDefault=false)
| Creates a new sidebar.
void | activeNextTab ()
| Activates a next tab from current one.
void | activePreviousTab ()
| Activates a previous tab from current one.
void | appendTab (QWidget *const w, const QIcon &pic, const QString &title)
| Appends a new tab to the sidebar.
void | backup ()
| Hide sidebar and backup minimized state.
void | backup (const QList< QWidget * > &thirdWidgetsToBackup, QList< int > *const sizes)
| Hide sidebar and backup minimized state.
void | deleteTab (QWidget *const w)
| Deletes a tab from the tabbar.
void | expand ()
| Redisplays the whole sidebar.
QWidget * | getActiveTab () const
| Returns the currently activated tab, or 0 if no tab is active.
bool | isExpanded () const
| Return the visible status of current sidebar tab.
void | restore ()
| Show sidebar and restore minimized state.
void | restore (const QList< QWidget * > &thirdWidgetsToRestore, const QList< int > &sizes)
| Show sidebar and restore minimized state.
void | setActiveTab (QWidget *const w)
| Activates a tab.
void | shrink ()
| Hides the sidebar (display only the activation buttons)
SidebarSplitter * | splitter () const
Public Member Functions inherited from Digikam::DMultiTabBar
| DMultiTabBar (Qt::Edge pos, QWidget *const parent=nullptr)
void | appendButton (const QIcon &pic, int id=-1, QMenu *const popup=nullptr, const QString &not_used_yet=QString())
| append a new button to the button area.
void | appendTab (const QIcon &pic, int id=-1, const QString &text=QString())
| append a new tab to the tab area.
DMultiTabBarButton * | button (int id) const
| get a pointer to a button within the button area identified by its ID
bool | isTabRaised (int id) const
| return the state of a tab, identified by its ID
Qt::Edge | position () const
| get the tabbar position.
void | removeButton (int id)
| remove a button with the given ID
void | removeTab (int id)
| remove a tab with a given ID
void | setPosition (Qt::Edge pos)
| set the real position of the widget.
void | setStyle (TextStyle style)
| set the display style of the tabs
void | setTab (int id, bool state)
| set a tab to "raised"
DMultiTabBarTab * | tab (int id) const
| get a pointer to a tab within the tab area, identified by its ID
TextStyle | tabStyle () const
| get the display style of the tabs
Public Member Functions inherited from Digikam::StateSavingObject
| StateSavingObject (QObject *const host)
| Constructor.
virtual | ~StateSavingObject ()
| Destructor.
StateSavingDepth | getStateSavingDepth () const
| Returns the depth used for state saving or loading.
void | loadState ()
| Invokes loading the class' state.
void | saveState ()
| Invokes saving the class' state.
virtual void | setConfigGroup (const KConfigGroup &group)
| Sets a dedicated config group that will be used to store and reload the state from.
virtual void | setEntryPrefix (const QString &prefix)
| Define a prefix that will be used for every entry in the config group.
void | setStateSavingDepth (const StateSavingDepth depth)
| Sets the depth used for state saving or loading.

## Protected Member Functions
void | doLoadState () override
| Load the last view state from disk - called by StateSavingObject::loadState()
void | doSaveState () override
| Save the view state to disk - called by StateSavingObject::saveState()
Protected Member Functions inherited from Digikam::DMultiTabBar
virtual void | fontChange (const QFont &)
void | updateSeparator ()
Protected Member Functions inherited from Digikam::StateSavingObject
QString | entryName (const QString &base) const
| Always use this method to create config group entry names.
KConfigGroup | getConfigGroup () const
| Returns the config group that must be used for state saving and loading.

## Friends
class | SidebarSplitter

## Additional Inherited Members
Public Types inherited from Digikam::DMultiTabBar
enum | TextStyle { ActiveIconText = 0 , AllIconsText = 2 }
| The list of available styles for DMultiTabBar. More...
Public Types inherited from Digikam::StateSavingObject
enum | StateSavingDepth { INSTANCE , DIRECT_CHILDREN , RECURSIVE }
| This enum defines the "depth" of the StateSavingObject::loadState() and StateSavingObject::saveState() methods. More...

## Detailed Description

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.

## Constructor & Destructor Documentation

## ◆ Sidebar()

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

Parameters

  parent | sidebar's parent
  sp | sets 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.
  side | where the sidebar should be displayed. At the left or right border. Use Qt::LeftEdge or Qt::RightEdge.
  minimizedDefault | hide the sidebar when the program is started the first time.

## Member Function Documentation

## ◆ activeNextTab()

void Digikam::Sidebar::activeNextTab | ( |  | ) |

If current one is last, first one is activated.

## ◆ activePreviousTab()

void Digikam::Sidebar::activePreviousTab | ( |  | ) |

If current one is first, last one is activated.

## ◆ appendTab()

void Digikam::Sidebar::appendTab | ( | QWidget *const | w,
|  | const QIcon & | pic,
|  | const QString & | title
| ) |  |

Parameters

  w | widget which is activated by this tab
  pic | icon which is shown in this tab
  title | text which is shown it this tab

## ◆ backup()

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

If there are other widgets in this splitter, stores their sizes in the provided list.

## ◆ doLoadState()

void Digikam::Sidebar::doLoadState | ( |  | ) |
| overrideprotectedvirtual

Implements Digikam::StateSavingObject.

## ◆ doSaveState()

void Digikam::Sidebar::doSaveState | ( |  | ) |
| overrideprotectedvirtual

Implements Digikam::StateSavingObject.

## ◆ restore()

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

Restores other widgets' sizes in splitter.