eye.widgets.tabs module

Tab widget

class eye.widgets.tabs.SplitButton(**kwargs)[source]

Bases: QToolButton, WidgetMixin

Button for splitting

When clicked, the button shows a popup menu to choose between horizontal split and vertical split. The button is suitable for using as cornerWidget of TabWidget.

split_horizontal()[source]

This slot has signature split_horizontal().

split_vertical()[source]

This slot has signature split_vertical().

class eye.widgets.tabs.TabBar(**kwargs)[source]

Bases: QTabBar, BandMixin, CategoryMixin

dragEnterEvent(ev)[source]

Overrides a Qt method.

dragLeaveEvent(ev)[source]

Overrides a Qt method.

dragMoveEvent(ev)[source]

Overrides a Qt method.

dropEvent(ev)[source]

Overrides a Qt method.

mouseMoveEvent(ev)[source]

Overrides a Qt method.

mousePressEvent(ev)[source]

Overrides a Qt method.

class eye.widgets.tabs.TabWidget(**kwargs)[source]

Bases: DropAreaMixin, QTabWidget, WidgetMixin, BandMixin

Tab widget class

By default, instances of this class have the category “tabwidget” (see eye.connector module).

add_widget(widget)[source]

Add a new tab with the specified widget

can_close()[source]

Returns True if all sub-widgets can be closed

closeEvent(ev)[source]

Overrides a Qt method.

close_tab(ed)[source]

Close the tab containing the specified widget and return True if it can be

The tab can’t be closed if the widget has a close_file() method which returns True when it is called. This method allows a tab content to reject closing if a file wasn’t saved.

current_buffer()[source]

Return the widget from the current tab

dragEnterEvent(ev)[source]

Overrides a Qt method.

dragLeaveEvent(ev)[source]

Overrides a Qt method.

dragMoveEvent(ev)[source]

Overrides a Qt method.

dropEvent(ev)[source]

Overrides a Qt method.

file_dropped = Signal(str)
insert_widget(idx, widget)[source]
last_tab_closed = Signal()

Signal last_tab_closed()

This signal is emitted when the last tab of this tab widget has been closed.

refocus()[source]

Give focus to the widget inside the current tab

This slot has signature refocus().

remove_widget(ed)

Close the tab containing the specified widget and return True if it can be

The tab can’t be closed if the widget has a close_file() method which returns True when it is called. This method allows a tab content to reject closing if a file wasn’t saved.

select_next_tab(rotate=False)[source]

Select next tab

Parameters:

rotate (bool) – if True and the current tab is the last tab, the first tab is selected.

This slot has signature select_next_tab().

select_next_tab_rotate()[source]

Select next tab or first tab if current is the last tab

This slot has signature select_next_tab_rotate().

select_prev_tab(rotate=False)[source]

Select previous tab.

Parameters:

rotate (bool) – if True and the current tab is the first tab, the last tab is selected.

This slot has signature select_prev_tab().

select_prev_tab_rotate()[source]

Select previous tab or last if current is the first tab

This slot has signature select_prev_tab_rotate().

setCurrentWidget(widget)[source]

Select the tab containing the specified widget

Overrides a Qt method.

set_hide_bar_if_single_tab(b)[source]

Set whether the tab bar should be hidden if there’s only one tab.

swap_next_tab()[source]

This slot has signature swap_next_tab().

swap_prev_tab()[source]

This slot has signature swap_prev_tab().

tabInserted(idx)[source]

Overrides a Qt method.

tabRemoved(idx)[source]

Overrides a Qt method.

widgets()[source]

Return widgets contained in tabs

eye.widgets.tabs.auto_create_corner_splitter(tw)[source]

When enabled, will create a corner popup button for splitting.

This handler is disabled by default.

This handler is registered as setup for categories ['tabwidget'].