|
cutelyst
3.9.1
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
|

Public Member Functions | |
| Pagination (int numberOfItems, int itemsPerPage, int currentPage, int pageLinks=10) | |
| int | currentPage () const |
| bool | enableFirst () const |
| bool | enableLast () const |
| int | lastPage () const |
| int | limit () const |
| int | numberOfItems () const |
| int | offset () const |
| QVector< int > | pages () const |
Static Public Member Functions | |
| static int | offset (int itemsPerPage, int currentPage) |
Properties | |
| int | currentPage |
| bool | enableFirst |
| bool | enableLast |
| int | lastPage |
| int | limit |
| int | numberOfItems |
| int | offset |
| QVector< int > | pages |
Definition at line 14 of file pagination.h.
| Pagination::Pagination | ( | int | numberOfItems, |
| int | itemsPerPage, | ||
| int | currentPage, | ||
| int | pageLinks = 10 |
||
| ) |
Contructs a pagination object
| 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 QList::append(), and QVariant::fromValue().
| int Cutelyst::Pagination::currentPage | ( | ) | const |
Returns the current page number
Referenced by offset().
| bool Cutelyst::Pagination::enableFirst | ( | ) | const |
Returns true if the first page link should be enabled
| bool Cutelyst::Pagination::enableLast | ( | ) | const |
Returns true if the last page link should be enabled
| int Cutelyst::Pagination::lastPage | ( | ) | const |
Returns the number of the last page
| int Cutelyst::Pagination::limit | ( | ) | const |
Returns the number os items per page
| int Cutelyst::Pagination::numberOfItems | ( | ) | const |
Returns the total number of items
| int Cutelyst::Pagination::offset | ( | ) | const |
Returns the current page offset for use in SQL
|
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.
References currentPage().
| QVector<int> Cutelyst::Pagination::pages | ( | ) | const |
Returns the list of pages, with each page number as the integer
1.8.14