eye.widgets.splitter module¶
Multi-splitter widget
The multi-splitter widget allows to have complex splitting layouts, with arbitrary levels of horizontal/vertical splits. For example, it’s possible to have editors layed out this way in a window:
+--+----+----+
| | | |
+--+----+ |
| | |
| +----+
| | |
+-------+----+
Each split may contain a eye.widgets.tabs.TabWidget, containing a single or multiple tabs.
- class eye.widgets.splitter.QSplitter(*args, **kwargs)¶
Bases:
Mock
- class eye.widgets.splitter.SplitManager(**kwargs)[source]¶
Bases:
QWidget,WidgetMixinSplit manager widget
This widget allows to do multiple levels of splitter without having to manage the levels by hand.
Instances of this class have the “splitmanager” category by default.
- all_children()[source]¶
Get all non-splitter children widgets (recursive)
Takes all children
eye.widgets.splitter.Splitterwidgets (recursively) and return their direct children (the children that are not Splitter themselves).- Return type:
list
- balance_splits_recursive(start_at=None)[source]¶
This slot has signature
balance_splits_recursive().
- deep_child_at(pos)[source]¶
Get the non-splitter widget at pos
- Parameters:
pos (QPoint) – the point where to look a widget, in coordinates relative to top-left corner of this SplitManager
- Returns:
the first child at position pos that is not a splitter, unlike
Splitter.child_at.- Return type:
- move_widget(current_widget, direction, new_widget)[source]¶
Move a child widget in another part of the splitting
current_widget, direction and new_widget have the same meaning as for the split_at method, except that new_widget must be already present in the SplitManager.
- split_at(current_widget, direction, new_widget)[source]¶
Insert a widget into the splits
new_widget is inserted next to current_widget, in direction. current_widget size is halved, and the newly created space is used for new_widget.
A new Splitter may be created if current_widget is not in a Splitter of the proper orientation. For example, if current_widget is in horizontal splitter, but new_widget should be inserted below, a new vertical splitter replaces current_widget and both current_widget and new_widget are put in it.
- Parameters:
current_widget – the widget next to which insert a new widget
direction – direction relative to current_widget where to insert new_widget. Possible values are the 4 directions from eye.consts module.
new_widget – the widget to insert
- class eye.widgets.splitter.Splitter(**kwargs)[source]¶
Bases:
QSplitter,WidgetMixinSplitter widget for a single splitting level
Splitter objects are handled by the
SplitManagerwidget.- child_at(pos)[source]¶
Return direct child widget at the given position
The returned child will be a direct child of self. If the real widget at pos is in a sub-Splitter, only the sub-Splitter which is a direct child of self will be returned.
- children()¶
Return all direct children widgets
Children returned by this method may be Splitter widgets if there are sub-splitters.
- Return type:
list