PySide6.QtGui.QPageRanges¶
- class QPageRanges¶
The
QPageRangesclass represents a collection of page ranges.Details
Use
pageRanges()to access the collection of page ranges associated with a paged device.Synopsis¶
Methods¶
def
__init__()def
addPage()def
addRange()def
clear()def
contains()def
firstPage()def
isEmpty()def
lastPage()def
__ne__()def
__eq__()def
swap()def
toRangeList()def
toString()
Static functions¶
def
fromString()
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
- __init__()¶
Constructs an empty
QPageRangesobject.- __init__(other)
- Parameters:
other –
QPageRanges
Constructs a
QPageRangesobject by copyingother.- addPage(pageNumber)¶
- Parameters:
pageNumber – int
Adds the single page
pageNumberto the ranges.Note
Page numbers start with 1. Attempts to add page numbers smaller than 1 will be ignored with a warning.
- addRange(from, to)¶
- Parameters:
from – int
to – int
Adds the range specified with
fromandtoto the ranges.Note
Page numbers start with 1. Attempts to add page numbers smaller than 1 will be ignored with a warning.
- clear()¶
Removes all page ranges.
- contains(pageNumber)¶
- Parameters:
pageNumber – int
- Return type:
bool
Returns
trueif the ranges include the pagepageNumber; otherwise returnsfalse.- firstPage()¶
- Return type:
int
Returns the index of the first page covered by the page ranges, or 0 if the page ranges are empty.
- static fromString(ranges)¶
- Parameters:
ranges – str
- Return type:
Constructs and returns a
QPageRangesobject populated with therangesfrom the string representation.QPrinter printer; QPageRanges ranges = QPageRanges::fromString("1-3,6-7"); printer.setPageRanges(ranges);
In case of parsing error, returns an empty
QPageRangesobject.See also
- isEmpty()¶
- Return type:
bool
Returns
trueif the ranges are empty; otherwise returnsfalse.- lastPage()¶
- Return type:
int
Returns the index of the last page covered by the page ranges, or 0 if the page ranges are empty.
- __ne__(rhs)¶
- Parameters:
rhs –
QPageRanges- Return type:
bool
- __eq__(rhs)¶
- Parameters:
rhs –
QPageRanges- Return type:
bool
- swap(other)¶
- Parameters:
other –
QPageRanges
- toRangeList()¶
- Return type:
.list of QPageRanges.Range
Returns a list with the values of the ranges.
- toString()¶
- Return type:
str
Returns the string representation of the page ranges.
- class Range¶
The
Rangestruct holds thefromandtoendpoints of a range.Details
See also
Synopsis¶
Methods¶
def
contains()def
__ne__()def
__lt__()def
__eq__()
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
- PySide6.QtGui.QPageRanges.Range.from¶
- PySide6.QtGui.QPageRanges.Range.to¶
- contains(pageNumber)¶
- Parameters:
pageNumber – int
- Return type:
bool
Returns
trueifpageNumberis within the interval[from, to]; otherwise returnsfalse.