FilterHeader
Qt Base Class: QHeaderView
Signature: QHeaderView(self, orientation: PySide6.QtCore.Qt.Orientation, parent: Optional[PySide6.QtWidgets.QWidget] = None) -> None
Base classes
Name | Children | Inherits |
---|---|---|
HeaderView prettyqt.widgets.headerview |
|
⋔ Inheritance diagram
graph TD
1473367134080["custom_widgets.FilterHeader"]
1473296214896["widgets.HeaderView"]
1473296228560["widgets.HeaderViewMixin"]
1473293692144["widgets.AbstractItemViewMixin"]
1473293679456["widgets.AbstractScrollAreaMixin"]
1473293662864["widgets.FrameMixin"]
1473293688240["widgets.WidgetMixin"]
1473299815024["core.ObjectMixin"]
140713234304496["builtins.object"]
1473245548480["gui.PaintDeviceMixin"]
1473241471584["QtWidgets.QHeaderView"]
1473241438400["QtWidgets.QAbstractItemView"]
1473290616416["QtWidgets.QAbstractScrollArea"]
1473290626176["QtWidgets.QFrame"]
1473290849680["QtWidgets.QWidget"]
1473288842240["QtCore.QObject"]
1473291690208["Shiboken.Object"]
1473300082368["QtGui.QPaintDevice"]
1473296214896 --> 1473367134080
1473296228560 --> 1473296214896
1473293692144 --> 1473296228560
1473293679456 --> 1473293692144
1473293662864 --> 1473293679456
1473293688240 --> 1473293662864
1473299815024 --> 1473293688240
140713234304496 --> 1473299815024
1473245548480 --> 1473293688240
140713234304496 --> 1473245548480
1473241471584 --> 1473296214896
1473241438400 --> 1473241471584
1473290616416 --> 1473241438400
1473290626176 --> 1473290616416
1473290849680 --> 1473290626176
1473288842240 --> 1473290849680
1473291690208 --> 1473288842240
140713234304496 --> 1473291690208
1473300082368 --> 1473290849680
1473291690208 --> 1473300082368
🛈 DocStrings
Bases: HeaderView
A HeaderView subclass which includes widgets with filter possibilities.
When setting the header view on an ItemView, a proxy model will be created which is linked to the filter widgets. The correct filter widget is automatically inferred from the content of the columns.
So basically everything that needs to be done is the following:
model = MyModel()
widget = widgets.TableView()
widget.set_model(model)
widget.h_header = custom_widgets.FilterHeader() # same as setHorizontalHeader()
and you will get filter capabilities for your table.
Note
Since the FilterHeader will infer the column content type based on the first few rows, it will only work correctly for tables with homogenous data.
Source code in prettyqt\custom_widgets\itemviews\filterheader.py
17 18 19 20 21 22 23 24 25 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 |
|
⌗ 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 |
|
frameShape |
QFrame::Shape | |
frameShadow |
QFrame::Shadow | |
lineWidth |
int | |
midLineWidth |
int | |
frameWidth |
int | |
frameRect |
QRect | |
verticalScrollBarPolicy |
Qt::ScrollBarPolicy | |
horizontalScrollBarPolicy |
Qt::ScrollBarPolicy | |
sizeAdjustPolicy |
QAbstractScrollArea::SizeAdjustPolicy | |
autoScroll |
bool | |
autoScrollMargin |
int | |
editTriggers |
QFlags |
|
tabKeyNavigation |
bool | |
showDropIndicator |
bool | |
dragEnabled |
bool | |
dragDropOverwriteMode |
bool | |
dragDropMode |
QAbstractItemView::DragDropMode | |
defaultDropAction |
Qt::DropAction | |
alternatingRowColors |
bool | |
selectionMode |
QAbstractItemView::SelectionMode | |
selectionBehavior |
QAbstractItemView::SelectionBehavior | |
iconSize |
QSize | |
textElideMode |
Qt::TextElideMode | |
verticalScrollMode |
QAbstractItemView::ScrollMode | |
horizontalScrollMode |
QAbstractItemView::ScrollMode | |
firstSectionMovable |
bool | |
showSortIndicator |
bool | |
highlightSections |
bool | |
stretchLastSection |
bool | |
cascadingSectionResizes |
bool | |
defaultSectionSize |
int | |
minimumSectionSize |
int | |
maximumSectionSize |
int | |
defaultAlignment |
QFlags |
|
sortIndicatorClearable |
bool | |
editors_visible |
bool | Whether the filter widgets are visible |