# eric4.E4Gui.E4SideBar

Module implementing a sidebar class.

### Global Attributes

None

### Classes

E4SideBar | Class implementing a sidebar with a widget area, that is hidden or shown, if the current tab is clicked again.

### Functions

None

## E4SideBar

Class implementing a sidebar with a widget area, that is hidden or shown, if the current tab is clicked again.

### Derived from

QWidget

### Class Attributes

East
North
South
Version
West

### Methods

E4SideBar | Constructor
__appFocusChanged | Private slot to handle a change of the focus.
__autoHideToggled | Private slot to handle the toggling of the autohide button.
__splitterMoved | Private slot to react on splitter moves.
addTab | Public method to add a tab to the sidebar.
clear | Public method to remove all tabs.
count | Public method to get the number of tabs.
currentIndex | Public method to get the index of the current tab.
currentWidget | Public method to get a reference to the current widget.
enterEvent | Protected method to handle the mouse entering this widget.
eventFilter | Protected method to handle some events for the tabbar.
expand | Public method to expand the sidebar.
indexOf | Public method to get the index of the given widget.
insertTab | Public method to insert a tab into the sidebar.
isAutoHiding | Public method to check, if the auto hide function is active.
isMinimized | Public method to check the minimized state.
isTabEnabled | Public method to check, if a tab is enabled.
leaveEvent | Protected method to handle the mouse leaving this widget.
nextTab | Public slot used to show the next tab.
orientation | Public method to get the orientation of the sidebar.
prevTab | Public slot used to show the previous tab.
removeTab | Public method to remove a tab.
restoreState | Public method to restore the state of the sidebar.
saveState | Public method to save the state of the sidebar.
setCurrentIndex | Public slot to set the current index.
setCurrentWidget | Public slot to set the current widget.
setOrientation | Public method to set the orientation of the sidebar.
setSplitter | Public method to set the splitter managing the sidebar.
setTabEnabled | Public method to set the enabled state of a tab.
setTabIcon | Public method to set the icon of a tab.
setTabText | Public method to set the text of a tab.
setTabToolTip | Public method to set the tooltip text of a tab.
setTabWhatsThis | Public method to set the WhatsThis text of a tab.
shrink | Public method to shrink the sidebar.
tabIcon | Public method to get the icon of a tab.
tabText | Public method to get the text of a tab.
tabToolTip | Public method to get the tooltip text of a tab.
tabWhatsThis | Public method to get the WhatsThis text of a tab.
widget | Public method to get a reference to the widget associated with a tab.

#### E4SideBar (Constructor)

E4SideBar(orientation = None, parent = None)

Constructor

orientation
  orientation of the sidebar widget (North, East, South, West)
parent
  parent widget (QWidget)

#### E4SideBar.__appFocusChanged

__appFocusChanged(old, now)

Private slot to handle a change of the focus.

old
  reference to the widget, that lost focus (QWidget or None)
now
  reference to the widget having the focus (QWidget or None)

#### E4SideBar.__autoHideToggled

__autoHideToggled(checked)

Private slot to handle the toggling of the autohide button.

checked
  flag indicating the checked state of the button (boolean)

#### E4SideBar.__splitterMoved

__splitterMoved(pos, index)

Private slot to react on splitter moves.

pos
  new position of the splitter handle (integer)
index
  index of the splitter handle (integer)

#### E4SideBar.addTab

addTab(widget, iconOrLabel, label = None)

Public method to add a tab to the sidebar.

widget
  reference to the widget to add (QWidget)
iconOrLabel
  reference to the icon or the labeltext of the tab (QIcon, string or QString)
label
  the labeltext of the tab (string or QString) (only to be used, if the second parameter is a QIcon)

#### E4SideBar.clear

clear()

Public method to remove all tabs.

#### E4SideBar.count

count()

Public method to get the number of tabs.

Returns:
  number of tabs in the sidebar (integer)

#### E4SideBar.currentIndex

currentIndex()

Public method to get the index of the current tab.

Returns:
  index of the current tab (integer)

#### E4SideBar.currentWidget

currentWidget()

Public method to get a reference to the current widget.

Returns:
  reference to the current widget (QWidget)

#### E4SideBar.enterEvent

enterEvent(event)

Protected method to handle the mouse entering this widget.

event
  reference to the event (QEvent)

#### E4SideBar.eventFilter

eventFilter(obj, evt)

Protected method to handle some events for the tabbar.

obj
  reference to the object (QObject)
evt
  reference to the event object (QEvent)

Returns:
  flag indicating, if the event was handled (boolean)

#### E4SideBar.expand

expand()

Public method to expand the sidebar.

#### E4SideBar.indexOf

indexOf(widget)

Public method to get the index of the given widget.

widget
  reference to the widget to get the index of (QWidget)

Returns:
  index of the given widget (integer)

#### E4SideBar.insertTab

insertTab(index, widget, iconOrLabel, label = None)

Public method to insert a tab into the sidebar.

index
  the index to insert the tab at (integer)
widget
  reference to the widget to insert (QWidget)
iconOrLabel
  reference to the icon or the labeltext of the tab (QIcon, string or QString)
label
  the labeltext of the tab (string or QString) (only to be used, if the second parameter is a QIcon)

#### E4SideBar.isAutoHiding

isAutoHiding()

Public method to check, if the auto hide function is active.

Returns:
  flag indicating the state of auto hiding (boolean)

#### E4SideBar.isMinimized

isMinimized()

Public method to check the minimized state.

Returns:
  flag indicating the minimized state (boolean)

#### E4SideBar.isTabEnabled

isTabEnabled(index)

Public method to check, if a tab is enabled.

index
  index of the tab to check (integer)

Returns:
  flag indicating the enabled state (boolean)

#### E4SideBar.leaveEvent

leaveEvent(event)

Protected method to handle the mouse leaving this widget.

event
  reference to the event (QEvent)

#### E4SideBar.nextTab

nextTab()

Public slot used to show the next tab.

#### E4SideBar.orientation

orientation()

Public method to get the orientation of the sidebar.

Returns:
  orientation of the sidebar (North, East, South, West)

#### E4SideBar.prevTab

prevTab()

Public slot used to show the previous tab.

#### E4SideBar.removeTab

removeTab(index)

Public method to remove a tab.

index
  the index of the tab to remove (integer)

#### E4SideBar.restoreState

restoreState(state)

Public method to restore the state of the sidebar.

state
  byte array containing the saved state (QByteArray)

Returns:
  flag indicating success (boolean)

#### E4SideBar.saveState

saveState()

Public method to save the state of the sidebar.

Returns:
  saved state as a byte array (QByteArray)

#### E4SideBar.setCurrentIndex

setCurrentIndex(index)

Public slot to set the current index.

index
  the index to set as the current index (integer)

#### E4SideBar.setCurrentWidget

setCurrentWidget(widget)

Public slot to set the current widget.

widget
  reference to the widget to become the current widget (QWidget)

#### E4SideBar.setOrientation

setOrientation(orient)

Public method to set the orientation of the sidebar.

orient
  orientation of the sidebar (North, East, South, West)

#### E4SideBar.setSplitter

setSplitter(splitter)

Public method to set the splitter managing the sidebar.

splitter
  reference to the splitter (QSplitter)

#### E4SideBar.setTabEnabled

setTabEnabled(index, enabled)

Public method to set the enabled state of a tab.

index
  index of the tab to set (integer)
enabled
  enabled state to set (boolean)

#### E4SideBar.setTabIcon

setTabIcon(index, icon)

Public method to set the icon of a tab.

index
  index of the tab (integer)
icon
  icon to be set (QIcon)

#### E4SideBar.setTabText

setTabText(index, text)

Public method to set the text of a tab.

index
  index of the tab (integer)
text
  text to set (QString)

#### E4SideBar.setTabToolTip

setTabToolTip(index, tip)

Public method to set the tooltip text of a tab.

index
  index of the tab (integer)
tooltip
  text text to set (QString)

#### E4SideBar.setTabWhatsThis

setTabWhatsThis(index, text)

Public method to set the WhatsThis text of a tab.

index
  index of the tab (integer)
WhatsThis
  text text to set (QString)

#### E4SideBar.shrink

shrink()

Public method to shrink the sidebar.

#### E4SideBar.tabIcon

tabIcon(index)

Public method to get the icon of a tab.

index
  index of the tab (integer)

Returns:
  icon of the tab (QIcon)

#### E4SideBar.tabText

tabText(index)

Public method to get the text of a tab.

index
  index of the tab (integer)

Returns:
  text of the tab (QString)

#### E4SideBar.tabToolTip

tabToolTip(index)

Public method to get the tooltip text of a tab.

index
  index of the tab (integer)

Returns:
  tooltip text of the tab (QString)

#### E4SideBar.tabWhatsThis

tabWhatsThis(index)

Public method to get the WhatsThis text of a tab.

index
  index of the tab (integer)

Returns:
  WhatsThis text of the tab (QString)

#### E4SideBar.widget

widget(index)

Public method to get a reference to the widget associated with a tab.

index
  index of the tab (integer)

Returns:
  reference to the widget (QWidget)

Up