PySide6.QtWidgets.QHeaderView¶
- class QHeaderView¶
- The - QHeaderViewclass provides a header row or header column for item views. More…- Synopsis¶- Properties¶- cascadingSectionResizesᅟ- Whether interactive resizing will be cascaded to the following sections once the section being resized by the user has reached its minimum size
- defaultAlignmentᅟ- The default alignment of the text in each header section
- defaultSectionSizeᅟ- The default size of the header sections before resizing
- firstSectionMovableᅟ- Whether the first column can be moved by the user
- highlightSectionsᅟ- Whether the sections containing selected items are highlighted
- maximumSectionSizeᅟ- The maximum size of the header sections
- minimumSectionSizeᅟ- The minimum size of the header sections
- showSortIndicatorᅟ- Whether the sort indicator is shown
- sortIndicatorClearableᅟ- Whether the sort indicator can be cleared by clicking on a section multiple times
- stretchLastSectionᅟ- Whether the last visible section in the header takes up all the available space
 - Methods¶- def - __init__()
- def - count()
- def - hideSection()
- def - initialize()
- def - length()
- def - logicalIndex()
- def - logicalIndexAt()
- def - moveSection()
- def - offset()
- def - orientation()
- def - resizeSection()
- def - resizeSections()
- def - restoreState()
- def - saveState()
- def - sectionSize()
- def - sectionsHidden()
- def - sectionsMoved()
- def - showSection()
- def - swapSections()
- def - visualIndex()
- def - visualIndexAt()
 - Virtual methods¶- Slots¶- Signals¶- Note - This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE - Detailed Description¶- A - QHeaderViewdisplays the headers used in item views such as the- QTableViewand- QTreeViewclasses. It takes the place of Qt3’s- QHeaderclass previously used for the same purpose, but uses the Qt’s model/view architecture for consistency with the item view classes.- The - QHeaderViewclass is one of the Model/View Classes and is part of Qt’s model/view framework .- The header gets the data for each section from the model using the QAbstractItemModel::headerData() function. You can set the data by using QAbstractItemModel::setHeaderData(). - Each header has an - orientation()and a number of sections, given by the- count()function. A section refers to a part of the header - either a row or a column, depending on the orientation.- Sections can be moved and resized using - moveSection()and- resizeSection(); they can also be hidden and shown with- hideSection()and- showSection().- Each section of a header is described by a section ID, specified by its section(), and can be located at a particular - visualIndex()in the header. A section can have a sort indicator set with- setSortIndicator(); this indicates whether the items in the associated item view will be sorted in the order given by the section.- For a horizontal header the section is equivalent to a column in the model, and for a vertical header the section is equivalent to a row in the model. - Moving Header Sections¶- A header can be fixed in place, or made movable with - setSectionsMovable(). It can be made clickable with- setSectionsClickable(), and has resizing behavior in accordance with- setSectionResizeMode().- Note - Double-clicking on a header to resize a section only applies for visible rows. - A header will emit - sectionMoved()if the user moves a section,- sectionResized()if the user resizes a section, and- sectionClicked()as well as- sectionHandleDoubleClicked()in response to mouse clicks. A header will also emit- sectionCountChanged().- You can identify a section using the - logicalIndex()and- logicalIndexAt()functions, or by its index position, using the- visualIndex()and- visualIndexAt()functions. The visual index will change if a section is moved, but the logical index will not change.- Appearance¶- QTableWidgetand- QTableViewcreate default headers. If you want the headers to be visible, you can use- setVisible().- Not all ItemDataRoles will have an effect on a - QHeaderView. If you need to draw other roles, you can subclass- QHeaderViewand reimplement- paintEvent().- QHeaderViewrespects the following item data roles, unless they are in conflict with the style (which can happen for styles that follow the desktop theme):- TextAlignmentRole, DisplayRole, FontRole, DecorationRole, ForegroundRole, and BackgroundRole. - Note - Each header renders the data for each section itself, and does not rely on a delegate. As a result, calling a header’s - setItemDelegate()function will have no effect.- Special consideration for huge models¶- The headerview uses 8 to 16 bytes of memory per section. However, since Qt 6.9 this section memory is only used if one or more sections are resized or reordered. This means that it’s possible for a model to have millions of sections without - QHeaderViewconsuming a proportional, and therefore huge, amount of memory, as long as there are no calls to- swapSections,- resizeSection,- hideSection,- moveSection, and- stretchLastSection(enabling it). In order to avoid such calls by user actions the- resize modeshould be- Fixed(without specifying it for any indexes, as that will do the opposite). The user should also be prevented from moving sections by keeping- sectionsMovabledisabled.- class ResizeMode¶
- The resize mode specifies the behavior of the header sections. It can be set on the entire header view or on individual sections using - setSectionResizeMode().- Constant - Description - QHeaderView.ResizeMode.Interactive - The user can resize the section. The section can also be resized programmatically using - resizeSection(). The section size defaults to- defaultSectionSize. (See also- cascadingSectionResizes.)- QHeaderView.ResizeMode.Fixed - The user cannot resize the section. The section can only be resized programmatically using - resizeSection(). The section size defaults to- defaultSectionSize.- QHeaderView.ResizeMode.Stretch - QHeaderViewwill automatically resize the section to fill the available space. The size cannot be changed by the user or programmatically.- QHeaderView.ResizeMode.ResizeToContents - QHeaderViewwill automatically resize the section to its optimal size based on the contents of the entire column or row. The size cannot be changed by the user or programmatically. (This value was introduced in 4.2)- The following values are obsolete: - Constant - Description - QHeaderView.ResizeMode.Custom - Use Fixed instead. 
 - Note - Properties can be used directly when - from __feature__ import true_propertyis used or via accessor functions otherwise.- property cascadingSectionResizesᅟ: bool¶
 - This property holds whether interactive resizing will be cascaded to the following sections once the section being resized by the user has reached its minimum size. - This property only affects sections that have - Interactiveas their resize mode.- The default value is false. - See also - Access functions:
 - property defaultAlignmentᅟ: Combination of Qt.AlignmentFlag¶
 - This property holds the default alignment of the text in each header section. - Access functions:
 - property defaultSectionSizeᅟ: int¶
 - This property holds the default size of the header sections before resizing.. - This property only affects sections that have - Interactiveor- Fixedas their resize mode.- By default, the value of this property is style dependent. Thus, when the style changes, this property updates from it. Calling setDefaultSectionSize() stops the updates, calling resetDefaultSectionSize() will restore default behavior. - See also - Access functions:
 - property firstSectionMovableᅟ: bool¶
 - This property holds Whether the first column can be moved by the user. - This property controls whether the first column can be moved by the user. In a - QTreeView, the first column holds the tree structure and is therefore non-movable by default, even after- setSectionsMovable(true).- It can be made movable again, for instance in the case of flat lists without a tree structure, by calling this method. In such a scenario, it is recommended to call - setRootIsDecorated(false) as well.- treeView->setRootIsDecorated(false); treeView->header()->setFirstSectionMovable(true); - Setting it to true has no effect unless - setSectionsMovable(true) is called as well.- See also - Access functions:
 - property highlightSectionsᅟ: bool¶
 - This property holds whether the sections containing selected items are highlighted. - By default, this property is - false.- Access functions:
 - property maximumSectionSizeᅟ: int¶
 - This property holds the maximum size of the header sections.. - The maximum section size is the largest section size allowed. The default value for this property is 1048575, which is also the largest possible size for a section. Setting maximum to -1 will reset the value to the largest section size. - With exception of stretch this property is honored by all - resize modes- See also - Access functions:
 - property minimumSectionSizeᅟ: int¶
 - This property holds the minimum size of the header sections.. - The minimum section size is the smallest section size allowed. If the minimum section size is set to -1, - QHeaderViewwill use the- font metricssize.- This property is honored by all - resize modes.- See also - Access functions:
 - property sectionsClickableᅟ: bool¶
 - Holds - trueif the header is clickable; otherwise- false. A clickable header could be set up to allow the user to change the representation of the data in the view related to the header.- See also - Access functions:
 - property sectionsMovableᅟ: bool¶
 - If - sectionsMovableis true, the header sections may be moved by the user; otherwise they are fixed in place.- When used in combination with - QTreeView, the first column is not movable (since it contains the tree structure), by default. You can make it movable with- setFirstSectionMovable(true).- See also - Access functions:
 - property showSortIndicatorᅟ: bool¶
 - This property holds whether the sort indicator is shown. - By default, this property is - false.- See also - Access functions:
 - property sortIndicatorClearableᅟ: bool¶
 - This property holds Whether the sort indicator can be cleared by clicking on a section multiple times. - This property controls whether the user is able to remove the sorting indicator on a given section by clicking on the section multiple times. Normally, clicking on a section will simply change the sorting order for that section. By setting this property to true, the sorting indicator will be cleared after alternating to ascending and descending; this will typically restore the original sorting of a model. - Setting this property to true has no effect unless - sectionsClickable()is also true (which is the default for certain views, for instance- QTableView, or is automatically set when making a view sortable, for instance by calling- setSortingEnabled).- Access functions:
 - property stretchLastSectionᅟ: bool¶
 - This property holds whether the last visible section in the header takes up all the available space. - The default value is false. - Note - The horizontal headers provided by - QTreeVieware configured with this property set to true, ensuring that the view does not waste any of the space assigned to it for its header. If this value is set to true, this property will override the resize mode set on the last section in the header.- See also - Access functions:
 - __init__(orientation[, parent=None])¶
- Parameters:
- orientation – - Orientation
- parent – - QWidget
 
 
 - Creates a new generic header with the given - orientationand- parent.- cascadingSectionResizes()¶
- Return type:
- bool 
 - See also 
 - Getter of property - cascadingSectionResizesᅟ.- count()¶
- Return type:
- int 
 
 - Returns the number of sections in the header. - See also - defaultAlignment()¶
- Return type:
- Combination of - AlignmentFlag
 - See also 
 - Getter of property - defaultAlignmentᅟ.- defaultSectionSize()¶
- Return type:
- int 
 - See also 
 - Getter of property - defaultSectionSizeᅟ.- geometriesChanged()¶
 - This signal is emitted when the header’s geometries have changed. - headerDataChanged(orientation, logicalFirst, logicalLast)¶
- Parameters:
- orientation – - Orientation
- logicalFirst – int 
- logicalLast – int 
 
 
 - Updates the changed header sections with the given - orientation, from- logicalFirstto- logicalLastinclusive.- Return type:
- int 
 
 - Returns the number of sections in the header that has been hidden. - See also - hideSection(logicalIndex)¶
- Parameters:
- logicalIndex – int 
 
 - Hides the section specified by - logicalIndex.- highlightSections()¶
- Return type:
- bool 
 - See also 
 - Getter of property - highlightSectionsᅟ.- initStyleOption(option)¶
- Parameters:
- option – - QStyleOptionHeader
 
 - Initialize - optionwith the values from this- QHeaderView. This method is useful for subclasses when they need a- QStyleOptionHeader, but do not want to fill in all the information themselves.- See also - initStyleOptionForIndex(option, logicalIndex)¶
- Parameters:
- option – - QStyleOptionHeader
- logicalIndex – int 
 
 
 - Initializes the style - optionfrom the specified- logicalIndex. This function is called by the default implementation of- paintSectionafter- initStyleOptionhas been called.- See also - initialize()¶
 - initializeSections()¶
 - initializeSections(start, end)
- Parameters:
- start – int 
- end – int 
 
 
 - isFirstSectionMovable()¶
- Return type:
- bool 
 
 - Getter of property - firstSectionMovableᅟ.- isSectionHidden(logicalIndex)¶
- Parameters:
- logicalIndex – int 
- Return type:
- bool 
 
 - Returns - trueif the section specified by- logicalIndexis explicitly hidden from the user; otherwise returns- false.- isSortIndicatorClearable()¶
- Return type:
- bool 
 
 - Getter of property - sortIndicatorClearableᅟ.- isSortIndicatorShown()¶
- Return type:
- bool 
 
 - Getter of property - showSortIndicatorᅟ.- length()¶
- Return type:
- int 
 
 - Returns the length along the orientation of the header. - See also - sizeHint()- setSectionResizeMode()- offset()- logicalIndex(visualIndex)¶
- Parameters:
- visualIndex – int 
- Return type:
- int 
 
 - Returns the logicalIndex for the section at the given - visualIndexposition, or -1 if- visualIndex< 0 or- visualIndex>=- count().- Note that the - visualIndexis not affected by hidden sections.- See also - Returns the logical index of the section at the position given in - pos. If the header is horizontal the x-coordinate will be used, otherwise the y-coordinate will be used to find the logical index.- See also - logicalIndexAt(position)
- Parameters:
- position – int 
- Return type:
- int 
 
 - Returns the section that covers the given - positionin the viewport.- See also - logicalIndexAt(x, y)
- Parameters:
- x – int 
- y – int 
 
- Return type:
- int 
 
 - Returns the logical index of the section at the given coordinate. If the header is horizontal - xwill be used, otherwise- ywill be used to find the logical index.- maximumSectionSize()¶
- Return type:
- int 
 - See also 
 - Getter of property - maximumSectionSizeᅟ.- minimumSectionSize()¶
- Return type:
- int 
 - See also 
 - Getter of property - minimumSectionSizeᅟ.- moveSection(from, to)¶
- Parameters:
- from – int 
- to – int 
 
 
 - Moves the section at visual index - fromto occupy visual index- to.- See also - offset()¶
- Return type:
- int 
 
 - Returns the offset of the header: this is the header’s left-most (or top-most for vertical headers) visible pixel. - See also - orientation()¶
- Return type:
 
 - Returns the orientation of the header. - See also - Orientation- paintSection(painter, rect, logicalIndex)¶
 - Paints the section specified by the given - logicalIndex, using the given- painterand- rect.- Normally, you do not have to call this function. - resetDefaultSectionSize()¶
 - Reset function of property - defaultSectionSizeᅟ.- resizeContentsPrecision()¶
- Return type:
- int 
 
 - Returns how precise - QHeaderViewwill calculate on- ResizeToContents.- resizeSection(logicalIndex, size)¶
- Parameters:
- logicalIndex – int 
- size – int 
 
 
 - Resizes the section specified by - logicalIndexto- sizemeasured in pixels. The size parameter must be a value larger or equal to zero. A size equal to zero is however not recommended. In that situation- hideSectionshould be used instead.- See also - resizeSections()¶
 - Resizes the sections according to their size hints. Normally, you do not have to call this function. - resizeSections(mode)
- Parameters:
- mode – - ResizeMode
 
 - Resizes the sections according to the given - mode, ignoring the current resize mode.- See also - restoreState(state)¶
- Parameters:
- state – - QByteArray
- Return type:
- bool 
 
 - Restores the - stateof this header view. This function returns- trueif the state was restored; otherwise returns false.- See also - saveState()¶
- Return type:
 
 - Saves the current state of this header view. - To restore the saved state, pass the return value to - restoreState().- See also - sectionClicked(logicalIndex)¶
- Parameters:
- logicalIndex – int 
 
 - This signal is emitted when a section is clicked. The section’s logical index is specified by - logicalIndex.- Note that the - sectionPressedsignal will also be emitted.- See also - sectionCountChanged(oldCount, newCount)¶
- Parameters:
- oldCount – int 
- newCount – int 
 
 
 - This signal is emitted when the number of sections changes, i.e., when sections are added or deleted. The original count is specified by - oldCount, and the new count by- newCount.- See also - sectionDoubleClicked(logicalIndex)¶
- Parameters:
- logicalIndex – int 
 
 - This signal is emitted when a section is double-clicked. The section’s logical index is specified by - logicalIndex.- See also - sectionEntered(logicalIndex)¶
- Parameters:
- logicalIndex – int 
 
 - This signal is emitted when the cursor moves over the section and the left mouse button is pressed. The section’s logical index is specified by - logicalIndex.- See also - sectionHandleDoubleClicked(logicalIndex)¶
- Parameters:
- logicalIndex – int 
 
 - This signal is emitted when a section is double-clicked. The section’s logical index is specified by - logicalIndex.- See also - sectionMoved(logicalIndex, oldVisualIndex, newVisualIndex)¶
- Parameters:
- logicalIndex – int 
- oldVisualIndex – int 
- newVisualIndex – int 
 
 
 - This signal is emitted when a section is moved. The section’s logical index is specified by - logicalIndex, the old index by- oldVisualIndex, and the new index position by- newVisualIndex.- See also - sectionPosition(logicalIndex)¶
- Parameters:
- logicalIndex – int 
- Return type:
- int 
 
 - Returns the section position of the given - logicalIndex, or -1 if the section is hidden. The position is measured in pixels from the first visible item’s top-left corner to the top-left corner of the item with- logicalIndex. The measurement is along the x-axis for horizontal headers and along the y-axis for vertical headers.- See also - sectionPressed(logicalIndex)¶
- Parameters:
- logicalIndex – int 
 
 - This signal is emitted when a section is pressed. The section’s logical index is specified by - logicalIndex.- See also - sectionResizeMode(logicalIndex)¶
- Parameters:
- logicalIndex – int 
- Return type:
 
 - Returns the resize mode that applies to the section specified by the given - logicalIndex.- See also - sectionResized(logicalIndex, oldSize, newSize)¶
- Parameters:
- logicalIndex – int 
- oldSize – int 
- newSize – int 
 
 
 - This signal is emitted when a section is resized. The section’s logical number is specified by - logicalIndex, the old size by- oldSize, and the new size by- newSize.- See also - sectionSize(logicalIndex)¶
- Parameters:
- logicalIndex – int 
- Return type:
- int 
 
 - Returns the width (or height for vertical headers) of the given - logicalIndex.- Returns the size of the contents of the section specified by the given - logicalIndex.- See also - sectionSizeHint(logicalIndex)¶
- Parameters:
- logicalIndex – int 
- Return type:
- int 
 
 - Returns a suitable size hint for the section specified by - logicalIndex.- Qt::SizeHintRole - See also - sizeHint()- defaultSectionSize()- minimumSectionSize()- maximumSectionSize()- sectionViewportPosition(logicalIndex)¶
- Parameters:
- logicalIndex – int 
- Return type:
- int 
 
 - Returns the section viewport position of the given - logicalIndex.- If the section is hidden, the return value is undefined. - See also - sectionsAboutToBeRemoved(parent, logicalFirst, logicalLast)¶
- Parameters:
- parent – - QModelIndex
- logicalFirst – int 
- logicalLast – int 
 
 
 - This slot is called when sections are removed from the - parent.- logicalFirstand- logicalLastsignify where the sections were removed.- If only one section is removed, - logicalFirstand- logicalLastwill be the same.- sectionsClickable()¶
- Return type:
- bool 
 
 - Returns sectionsClickable. - See also - Getter of property - sectionsClickableᅟ.- sectionsHidden()¶
- Return type:
- bool 
 
 - Returns - trueif sections in the header has been hidden; otherwise returns false;- See also - sectionsInserted(parent, logicalFirst, logicalLast)¶
- Parameters:
- parent – - QModelIndex
- logicalFirst – int 
- logicalLast – int 
 
 
 - This slot is called when sections are inserted into the - parent.- logicalFirstand- logicalLastindices signify where the new sections were inserted.- If only one section is inserted, - logicalFirstand- logicalLastwill be the same.- sectionsMovable()¶
- Return type:
- bool 
 
 - Returns sectionsMovable. - See also - Getter of property - sectionsMovableᅟ.- sectionsMoved()¶
- Return type:
- bool 
 
 - Returns - trueif sections in the header has been moved; otherwise returns false;- See also - setCascadingSectionResizes(enable)¶
- Parameters:
- enable – bool 
 - See also 
 - Setter of property - cascadingSectionResizesᅟ.- setDefaultAlignment(alignment)¶
- Parameters:
- alignment – Combination of - AlignmentFlag
 - See also 
 - Setter of property - defaultAlignmentᅟ.- setDefaultSectionSize(size)¶
- Parameters:
- size – int 
 - See also 
 - Setter of property - defaultSectionSizeᅟ.- setFirstSectionMovable(movable)¶
- Parameters:
- movable – bool 
 - See also 
 - Setter of property - firstSectionMovableᅟ.- setHighlightSections(highlight)¶
- Parameters:
- highlight – bool 
 - See also 
 - Setter of property - highlightSectionsᅟ.- setMaximumSectionSize(size)¶
- Parameters:
- size – int 
 - See also 
 - Setter of property - maximumSectionSizeᅟ.- setMinimumSectionSize(size)¶
- Parameters:
- size – int 
 - See also 
 - Setter of property - minimumSectionSizeᅟ.- setOffset(offset)¶
- Parameters:
- offset – int 
 
 - Sets the header’s offset to - offset.- setOffsetToLastSection()¶
 - Sets the offset to make the last section visible. - setOffsetToSectionPosition(visualIndex)¶
- Parameters:
- visualIndex – int 
 
 - Sets the offset to the start of the section at the given - visualSectionNumber.- visualSectionNumberis the actual visible section when hiddenSections are not considered. That is not always the same as- visualIndex().- See also - setResizeContentsPrecision(precision)¶
- Parameters:
- precision – int 
 
 - Sets how precise - QHeaderViewshould calculate the size when- ResizeToContentsis used. A low value will provide a less accurate but fast auto resize while a higher value will provide a more accurate resize that however can be slow.- The number - precisionspecifies how many sections that should be consider when calculating the preferred size.- The default value is 1000 meaning that a horizontal column with auto-resize will look at maximum 1000 rows on calculating when doing an auto resize. - Special value 0 means that it will look at only the visible area. Special value -1 will imply looking at all elements. - This value is used in - sizeHintForColumn(),- sizeHintForRow()and- sizeHintForColumn(). Reimplementing these functions can make this function not having an effect.- See also - resizeContentsPrecision()- setSectionResizeMode()- resizeSections()- sizeHintForColumn()- sizeHintForRow()- sizeHintForColumn()- setSectionHidden(logicalIndex, hide)¶
- Parameters:
- logicalIndex – int 
- hide – bool 
 
 
 - If - hideis true the section specified by- logicalIndexis hidden; otherwise the section is shown.- See also - setSectionResizeMode(mode)¶
- Parameters:
- mode – - ResizeMode
 
 - Sets the constraints on how the header can be resized to those described by the given - mode.- See also - setSectionResizeMode(logicalIndex, mode)
- Parameters:
- logicalIndex – int 
- mode – - ResizeMode
 
 
 - Sets the constraints on how the section specified by - logicalIndexin the header can be resized to those described by the given- mode. The logical index should exist at the time this function is called.- Note - This setting will be ignored for the last section if the - stretchLastSectionproperty is set to true. This is the default for the horizontal headers provided by- QTreeView.- setSectionsClickable(clickable)¶
- Parameters:
- clickable – bool 
 
 - Set - sectionsClickableto- clickable.- See also - Setter of property - sectionsClickableᅟ.- setSectionsMovable(movable)¶
- Parameters:
- movable – bool 
 
 - Sets - sectionsMovableto- movable.- See also - Setter of property - sectionsMovableᅟ.- Sets the sort indicator for the section specified by the given - logicalIndexin the direction specified by- order, and removes the sort indicator from any other section that was showing it.- logicalIndexmay be -1, in which case no sort indicator will be shown and the model will return to its natural, unsorted order. Note that not all models support this and may even crash in this case.- setSortIndicatorClearable(clearable)¶
- Parameters:
- clearable – bool 
 - See also 
 - Setter of property - sortIndicatorClearableᅟ.- setSortIndicatorShown(show)¶
- Parameters:
- show – bool 
 - See also 
 - Setter of property - showSortIndicatorᅟ.- setStretchLastSection(stretch)¶
- Parameters:
- stretch – bool 
 - See also 
 - Setter of property - stretchLastSectionᅟ.- showSection(logicalIndex)¶
- Parameters:
- logicalIndex – int 
 
 - Shows the section specified by - logicalIndex.- This signal is emitted when the section containing the sort indicator or the order indicated is changed. The section’s logical index is specified by - logicalIndexand the sort order is specified by- order.- See also - sortIndicatorClearableChanged(clearable)¶
- Parameters:
- clearable – bool 
 
 - Notification signal of property - sortIndicatorClearableᅟ.- Returns the order for the sort indicator. If no section has a sort indicator the return value of this function is undefined. - See also - sortIndicatorSection()¶
- Return type:
- int 
 
 - Returns the logical index of the section that has a sort indicator. By default this is section 0. - stretchLastSection()¶
- Return type:
- bool 
 - See also 
 - Getter of property - stretchLastSectionᅟ.- stretchSectionCount()¶
- Return type:
- int 
 
 - Returns the number of sections that are set to resize mode stretch. In views, this can be used to see if the headerview needs to resize the sections when the view’s geometry changes. - See also - swapSections(first, second)¶
- Parameters:
- first – int 
- second – int 
 
 
 - Swaps the section at visual index - firstwith the section at visual index- second.- See also - updateSection(logicalIndex)¶
- Parameters:
- logicalIndex – int 
 
 - visualIndex(logicalIndex)¶
- Parameters:
- logicalIndex – int 
- Return type:
- int 
 
 - Returns the visual index position of the section specified by the given - logicalIndex, or -1 otherwise.- Hidden sections still have valid visual indexes. - See also - visualIndexAt(position)¶
- Parameters:
- position – int 
- Return type:
- int 
 
 - Returns the visual index of the section that covers the given - positionin the viewport.- See also