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, WidgetMixin

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

SplitterClass

alias of Splitter

all_children()[source]

Get all non-splitter children widgets (recursive)

Takes all children eye.widgets.splitter.Splitter widgets (recursively) and return their direct children (the children that are not Splitter themselves).

Return type:

list

balance_splits(spl)[source]
balance_splits_recursive(start_at=None)[source]

This slot has signature balance_splits_recursive().

can_close()[source]

Returns True if all sub-widgets can be closed.

child_id(widget)[source]
child_rect(widget)[source]
closeEvent(ev)[source]

Overrides a Qt method.

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:

QWidget

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.

neighbour(widget, direction)[source]
remove_widget(widget)[source]
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, WidgetMixin

Splitter widget for a single splitting level

Splitter objects are handled by the SplitManager widget.

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.

Parameters:

pos (QPoint) – relative to the top-left corner of this Splitter (which is at (0, 0)).

Returns:

the direct child at pos, a Py_qt5.Qt_widgets.QSplitter_handle if pos is on a handle, or None if pos is outside self’s geometry

Return type:

QWidget

children()

Return all direct children widgets

Children returned by this method may be Splitter widgets if there are sub-splitters.

Return type:

list

parent_manager()[source]

Returns the Split_manager managing this splitter

Return type:

SplitManager

remove_child(widget)[source]
replace_child(child, new)[source]
widgets()[source]

Return all direct children widgets

Children returned by this method may be Splitter widgets if there are sub-splitters.

Return type:

list