TabWidget
Qt Base Class: QTabWidget
Signature: QTabWidget(self, parent: Optional[PySide6.QtWidgets.QWidget] = None) -> None
Base classes
Name | Children | Inherits |
---|---|---|
WidgetMixin prettyqt.widgets.widget |
||
QTabWidget PySide6.QtWidgets QTabWidget(self, parent: Optional[PySide6.QtWidgets.QWidget] \= None) -> None |
⋔ Inheritance diagram
graph TD
1473296226608["widgets.TabWidget"]
1473293688240["widgets.WidgetMixin"]
1473299815024["core.ObjectMixin"]
140713234304496["builtins.object"]
1473245548480["gui.PaintDeviceMixin"]
1473290864320["QtWidgets.QTabWidget"]
1473290849680["QtWidgets.QWidget"]
1473288842240["QtCore.QObject"]
1473291690208["Shiboken.Object"]
1473300082368["QtGui.QPaintDevice"]
1473293688240 --> 1473296226608
1473299815024 --> 1473293688240
140713234304496 --> 1473299815024
1473245548480 --> 1473293688240
140713234304496 --> 1473245548480
1473290864320 --> 1473296226608
1473290849680 --> 1473290864320
1473288842240 --> 1473290849680
1473291690208 --> 1473288842240
140713234304496 --> 1473291690208
1473300082368 --> 1473290849680
1473291690208 --> 1473300082368
🛈 DocStrings
Bases: WidgetMixin
, QTabWidget
Stack of tabbed widgets.
Source code in prettyqt\widgets\tabwidget.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 |
|
add(widget: widgets.QWidget | widgets.QLayout)
Add widget / layout to TabWidget.
Tab label is chosen based on following order: windowTitle -> objectName -> className
Source code in prettyqt\widgets\tabwidget.py
attach_tab(widget: widgets.QWidget | widgets.QLayout, name: str, icon: datatypes.IconType = None, insert_at: int | None = None)
Re-attach tab.
Re-attach the tab by removing the content from the DetachedTab window, closing it, and placing the content back into the DetachableTabWidget.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
widget |
Union[QWidget, QLayout]
|
the content widget from the DetachedTab window |
required |
name |
str
|
the name of the detached tab |
required |
icon |
IconType
|
the window icon for the detached tab |
None
|
insert_at |
Optional[int]
|
insert the re-attached tab at the given index |
None
|
Source code in prettyqt\widgets\tabwidget.py
close_detached_tabs()
detach_tab(index: int, point: datatypes.PointType)
Detach tab by removing its contents and placing them in a DetachedTab window.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
index |
int
|
index location of the tab to be detached |
required |
point |
QPoint
|
screen pos for creating the new DetachedTab window |
required |
Source code in prettyqt\widgets\tabwidget.py
get_tab_position() -> TabPositionStr
get_tab_shape() -> TabShapeStr
open_widget(widget: widgets.QWidget, title: str = 'Unnamed')
Create a tab containing delivered widget.
set_icon_size(size: datatypes.SizeType)
set_tab_position(position: TabPositionStr | widgets.QTabWidget.TabPosition)
Set tab position for the tabwidget.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
position |
TabPositionStr | TabPosition
|
tab position to use |
required |
set_tab_shape(shape: TabShapeStr | widgets.QTabWidget.TabShape)
Set tab shape for the tabwidget.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
shape |
TabShapeStr | TabShape
|
tab shape to use |
required |
update_tab_bar_visibility()
Update visibility of the tabBar depending of the number of tabs.
0 or 1 tab -> tabBar hidden, 2+ tabs - >tabBar visible need to be called explicitly, or be connected to tabInserted/tabRemoved
Source code in prettyqt\widgets\tabwidget.py
⌗ Property table
Qt Property | Type | Doc |
---|---|---|
objectName |
QString | |
modal |
bool | |
windowModality |
Qt::WindowModality | |
enabled |
bool | |
geometry |
QRect | |
frameGeometry |
QRect | |
normalGeometry |
QRect | |
x |
int | |
y |
int | |
pos |
QPoint | |
frameSize |
QSize | |
size |
QSize | |
width |
int | |
height |
int | |
rect |
QRect | |
childrenRect |
QRect | |
childrenRegion |
QRegion | |
sizePolicy |
QSizePolicy | |
minimumSize |
QSize | |
maximumSize |
QSize | |
minimumWidth |
int | |
minimumHeight |
int | |
maximumWidth |
int | |
maximumHeight |
int | |
sizeIncrement |
QSize | |
baseSize |
QSize | |
palette |
QPalette | |
font |
QFont | |
cursor |
QCursor | |
mouseTracking |
bool | |
tabletTracking |
bool | |
isActiveWindow |
bool | |
focusPolicy |
Qt::FocusPolicy | |
focus |
bool | |
contextMenuPolicy |
Qt::ContextMenuPolicy | |
updatesEnabled |
bool | |
visible |
bool | |
minimized |
bool | |
maximized |
bool | |
fullScreen |
bool | |
sizeHint |
QSize | |
minimumSizeHint |
QSize | |
acceptDrops |
bool | |
windowTitle |
QString | |
windowIcon |
QIcon | |
windowIconText |
QString | |
windowOpacity |
double | |
windowModified |
bool | |
toolTip |
QString | |
toolTipDuration |
int | |
statusTip |
QString | |
whatsThis |
QString | |
accessibleName |
QString | |
accessibleDescription |
QString | |
layoutDirection |
Qt::LayoutDirection | |
autoFillBackground |
bool | |
styleSheet |
QString | |
locale |
QLocale | |
windowFilePath |
QString | |
inputMethodHints |
QFlags |
|
tabPosition |
QTabWidget::TabPosition | |
tabShape |
QTabWidget::TabShape | |
currentIndex |
int | |
count |
int | |
iconSize |
QSize | |
elideMode |
Qt::TextElideMode | |
usesScrollButtons |
bool | |
documentMode |
bool | |
tabsClosable |
bool | |
movable |
bool | |
tabBarAutoHide |
bool |