QPageRanges 类表示页面范围的集合。 更多...
头: | #include <QPageRanges> |
CMake: |
find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui) |
qmake: | QT += gui |
Since: | Qt 6.0 |
struct | Range |
QPageRanges () | |
QPageRanges (const QPageRanges & other ) | |
QPageRanges (QPageRanges && other ) | |
~QPageRanges () | |
void | addPage (int pageNumber ) |
void | addRange (int from , int to ) |
void | clear () |
bool | contains (int pageNumber ) const |
int | firstPage () const |
bool | isEmpty () const |
int | lastPage () const |
QList<QPageRanges::Range> | toRangeList () const |
QString | toString () const |
QPageRanges & | operator= (const QPageRanges & other ) |
QPageRanges & | operator= (QPageRanges && other ) |
QPageRanges | fromString (const QString & ranges ) |
QDataStream & | operator<< (QDataStream & stream , const QPageRanges & pageRanges ) |
QDataStream & | operator>> (QDataStream & stream , QPageRanges & pageRanges ) |
使用 QPagedPaintDevice::pageRanges () to access the collection of page ranges associated with a paged device.
Constructs an empty QPageRanges object.
Constructs a QPageRanges object by copying other .
Constructs a QPageRanges object by moving from other .
Destroys the page ranges.
Adds the single page pageNumber to the ranges.
注意: Page numbers start with 1. Attempts to add page numbers smaller than 1 will be ignored with a warning.
Adds the range specified with from and to to the ranges.
注意: Page numbers start with 1. Attempts to add page numbers smaller than 1 will be ignored with a warning.
Removes all page ranges.
返回
true
if the ranges include the page
pageNumber
;否则返回
false
.
Returns the index of the first page covered by the page ranges, or 0 if the page ranges are empty.
[static]
QPageRanges
QPageRanges::
fromString
(const
QString
&
ranges
)
Constructs and returns a QPageRanges object populated with the ranges from the string representation.
QPrinter printer; QPageRanges ranges = QPageRanges::fromString("1-3,6-7"); printer.setPageRanges(ranges);
In case of parsing error, returns an empty QPageRanges 对象。
另请参阅 isEmpty ().
返回
true
if the ranges are empty; otherwise returns
false
.
Returns the index of the last page covered by the page ranges, or 0 if the page ranges are empty.
Returns a list with the values of the ranges.
Returns the string representation of the page ranges.
赋值 other 到此 QPageRanges 对象。
移动 other 到此 QPageRanges 对象。
写入 pageRanges to stream as a range string.
另请参阅 QPageRanges::toString .
Reads a page ranges string from stream and stores it in pageRanges .
另请参阅 QPageRanges::fromString .