KDE 4.9 PyKDE API Reference

- KDE's Python API

# ViewBarContainer Class Reference

`from PyKDE4.ktexteditor import *`

Namespace: KTextEditor

## Detailed Description

An application providing a centralized place for horizontal view bar containers (eg search bars) has to implement this

Since:
  4.2

## Enumerations
Position | { LeftBar, TopBar, RightBar, BottomBar }
## Methods
| __init__ (self)
| addViewBarToLayout (self, KTextEditor.View view, QWidget bar, KTextEditor.ViewBarContainer.Position position)
| deleteViewBarForView (self, KTextEditor.View view, KTextEditor.ViewBarContainer.Position position)
QWidget | getViewBarParent (self, KTextEditor.View view, KTextEditor.ViewBarContainer.Position position)
| hideViewBarForView (self, KTextEditor.View view, KTextEditor.ViewBarContainer.Position position)
| showViewBarForView (self, KTextEditor.View view, KTextEditor.ViewBarContainer.Position position)

## Method Documentation

__init__ | ( |  | self ) |

Constructor

addViewBarToLayout | ( | self, |
|  | KTextEditor.View | view,
|  | QWidget | bar,
|  | KTextEditor.ViewBarContainer.Position | position
| ) |  |  |

Abstract method:
  This method is abstract and can be overridden but not called directly.

It is advisable to store only QPointers to the bar and its children in the caller after this point. The container may at any point delete the bar, eg if the container is destroyed The caller has to ensure that bar->parentWidget() is the widget returned by the previous function

deleteViewBarForView | ( | self, |
|  | KTextEditor.View | view,
|  | KTextEditor.ViewBarContainer.Position | position
| ) |  |  |

Abstract method:
  This method is abstract and can be overridden but not called directly.

The view should not delete the bar by itself, but tell the container to delete the bar. This is for instance useful, in the destructor of the view. The bar must not life longer than the view.

QWidget getViewBarParent | ( | self, |
|  | KTextEditor.View | view,
|  | KTextEditor.ViewBarContainer.Position | position
| ) |  |  |

Abstract method:
  This method is abstract and can be overridden but not called directly.

At this point the views parent window has to be already set, so this has to be called after any reparentings eg.: The implementation in Kate uses view->window() to determine where to place of the container if 0 is returned, the view has to handle the bar internally

hideViewBarForView | ( | self, |
|  | KTextEditor.View | view,
|  | KTextEditor.ViewBarContainer.Position | position
| ) |  |  |

Abstract method:
  This method is abstract and can be overridden but not called directly.

showViewBarForView | ( | self, |
|  | KTextEditor.View | view,
|  | KTextEditor.ViewBarContainer.Position | position
| ) |  |  |

Abstract method:
  This method is abstract and can be overridden but not called directly.

## Enumeration Documentation

Position

Enumerator:

  LeftBar = 0 |
  TopBar = 1 |
  RightBar = 2 |
  BottomBar = 3 |