|
| static int | offset (int itemsPerPage, int currentPage) |
| |
Definition at line 14 of file pagination.h.
◆ Pagination()
| Pagination::Pagination |
( |
int |
numberOfItems, |
|
|
int |
itemsPerPage, |
|
|
int |
currentPage, |
|
|
int |
pageLinks = 10 |
|
) |
| |
Contructs a pagination object
- Parameters
-
| numberOfItems | should be set to the total of items to be displayed |
| itemsPerPage | the desired number of items per page |
| currentPage | the current 1 indexed page (first page is 1) usually from the query url |
| pageLinks | the number of page links that should be generated, for example 3 -> 11, 12, 13 |
Definition at line 13 of file pagination.cpp.
References QVector::append(), and QVariant::fromValue().
◆ ~Pagination()
| Pagination::~Pagination |
( |
| ) |
|
|
virtual |
◆ currentPage()
| int Pagination::currentPage |
( |
| ) |
const |
◆ enableFirst()
| bool Pagination::enableFirst |
( |
| ) |
const |
Returns true if the first page link should be enabled
Definition at line 102 of file pagination.cpp.
◆ enableLast()
| bool Pagination::enableLast |
( |
| ) |
const |
Returns true if the last page link should be enabled
Definition at line 107 of file pagination.cpp.
◆ lastPage()
| int Pagination::lastPage |
( |
| ) |
const |
Returns the number of the last page
Definition at line 92 of file pagination.cpp.
◆ limit()
| int Pagination::limit |
( |
| ) |
const |
Returns the number os items per page
Definition at line 63 of file pagination.cpp.
◆ numberOfItems()
| int Pagination::numberOfItems |
( |
| ) |
const |
◆ offset() [1/2]
| int Pagination::offset |
( |
| ) |
const |
Returns the current page offset for use in SQL
Definition at line 68 of file pagination.cpp.
◆ offset() [2/2]
| int Pagination::offset |
( |
int |
itemsPerPage, |
|
|
int |
currentPage |
|
) |
| |
|
static |
Returns the current page offset for use in SQL taking the number of items per page and the current page
Definition at line 73 of file pagination.cpp.
◆ pages()
| QVector< int > Pagination::pages |
( |
| ) |
const |
Returns the list of pages, with each page number as the integer
Definition at line 112 of file pagination.cpp.
◆ currentPage
| int Cutelyst::Pagination::currentPage |
|
read |
◆ enableFirst
| bool Cutelyst::Pagination::enableFirst |
|
read |
◆ enableLast
| bool Cutelyst::Pagination::enableLast |
|
read |
◆ lastPage
| int Cutelyst::Pagination::lastPage |
|
read |
◆ limit
| int Cutelyst::Pagination::limit |
|
read |
◆ numberOfItems
| int Cutelyst::Pagination::numberOfItems |
|
read |
◆ offset
| int Cutelyst::Pagination::offset |
|
read |
◆ pages
| QVector<int> Cutelyst::Pagination::pages |
|
read |