pyqt_reactive.widgets.shared.tear_off_tab_widget
TearOffTabWidget - Chrome-style detachable tabs for PyQt6.
Allows users to drag tabs out to create floating windows, and drag them into other windows to dock them.
Classes
|
Floating window for torn-off tabs. |
|
Drag-state projection for a floating torn-off tab window. |
|
Data container for tab drag operations. |
|
Custom tab bar that supports tear-off drag operations. |
|
QTabWidget with Chrome-style tear-off tab support. |
- class pyqt_reactive.widgets.shared.tear_off_tab_widget.FloatingWindowDragState(start_pos: QPoint | None = None, active: bool = False)[source]
Drag-state projection for a floating torn-off tab window.
- classmethod begin(start_pos: QPoint) → FloatingWindowDragState[source]
- activate_if_threshold_met(current_pos: QPoint, threshold: int) → FloatingWindowDragState[source]
- moved_to(current_pos: QPoint) → FloatingWindowDragState[source]
- class pyqt_reactive.widgets.shared.tear_off_tab_widget.TabDragData(source_widget: TearOffTabWidget, tab_index: int, tab_text: str, tab_widget: QWidget)[source]
Data container for tab drag operations.
- __init__(source_widget: TearOffTabWidget, tab_index: int, tab_text: str, tab_widget: QWidget)[source]
- class pyqt_reactive.widgets.shared.tear_off_tab_widget.TearOffTabBar(parent=None)[source]
Custom tab bar that supports tear-off drag operations.
- tab_tear_off_requested
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- class pyqt_reactive.widgets.shared.tear_off_tab_widget.TearOffTabWidget(parent=None)[source]
QTabWidget with Chrome-style tear-off tab support.
Allows dragging tabs out to create floating windows, and dragging them into other TearOffTabWidgets to dock.
Features: - Drag tab out to create floating window - Drag tab into another TearOffTabWidget to dock - Visual feedback during drag (preview pixmap) - Automatic cleanup of empty floating windows
- Usage:
tab_widget = TearOffTabWidget() tab_widget.addTab(widget, “Tab 1”) tab_widget.addTab(widget2, “Tab 2”)
# Optional: Set callback when tab is torn off tab_widget.on_tab_torn_off = lambda tab_widget, tab_text: print(f”Torn off: {tab_text}”)
- tab_torn_off
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- tab_docked
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- class pyqt_reactive.widgets.shared.tear_off_tab_widget.FloatingTabWindow(content_widget: QWidget, title: str, source_tab_widget: TearOffTabWidget, parent=None)[source]
Floating window for torn-off tabs.
Contains a single tab’s content and can be dragged to dock into other TearOffTabWidgets.
- __init__(content_widget: QWidget, title: str, source_tab_widget: TearOffTabWidget, parent=None)[source]