All Projects → daonvshu → Pagination

daonvshu / Pagination

Licence: GPL-3.0 license
a paging widget based on Qt

Programming Languages

C++
36643 projects - #6 most used programming language
QML
638 projects
CMake
9771 projects

Projects that are alternatives of or similar to Pagination

Qtmvvm
A mvvm oriented library for Qt, to create Projects for Widgets and Quick in parallel
Stars: ✭ 205 (+831.82%)
Mutual labels:  widget, qml
CatLearnQt
CatLearnQt,提供QWidget,Quick,网络,串口,基础库和示例。案例软件支持样式切换,与国际化。
Stars: ✭ 63 (+186.36%)
Mutual labels:  widget, qml
widgetci
a Cross-Platform Widget Management App. (Win/Linux/Mac)
Stars: ✭ 36 (+63.64%)
Mutual labels:  widget, qml
Hibiscus.js
Native Angular directives for Bootstrap4
Stars: ✭ 115 (+422.73%)
Mutual labels:  pagination, widget
now-playing-profile
Originally created by github.com/natemoo-re, a small Spotify widget suitable for your profile! Read the "spotify-setup-guide.md" to get started
Stars: ✭ 32 (+45.45%)
Mutual labels:  widget
a11yAccordion
An accessible and easy to use Accordeon widget.
Stars: ✭ 37 (+68.18%)
Mutual labels:  widget
vatsinator-legacy
An open-source Vatsim monitor
Stars: ✭ 12 (-45.45%)
Mutual labels:  qml
flutter signature pad
📦 Flutter widget to allow users to sign with finger and export the result as image data.
Stars: ✭ 95 (+331.82%)
Mutual labels:  widget
nhl-my-team-ios-widget
"NHL-MyTeam" Scriptable iOS widget 🏒
Stars: ✭ 16 (-27.27%)
Mutual labels:  widget
pagination
Пример создания пагинации в Vue.js
Stars: ✭ 31 (+40.91%)
Mutual labels:  pagination
stagtools
StagTools is a powerful plugin to extend functionality to your WordPress themes offering shortcodes, FontAwesome icons, and useful widgets.
Stars: ✭ 21 (-4.55%)
Mutual labels:  widget
paginathing
a jQuery plugin to paginate your DOM easily.
Stars: ✭ 23 (+4.55%)
Mutual labels:  pagination
range-slider
Customizable slider (range) component for JavaScript with no dependencies
Stars: ✭ 26 (+18.18%)
Mutual labels:  widget
material
Material Design Widgets for PySide and PyQt4
Stars: ✭ 66 (+200%)
Mutual labels:  widget
herald
Pre-alpha end-to-end encrypted instant messenger.
Stars: ✭ 23 (+4.55%)
Mutual labels:  qml
mini-qml
Minimal Qt deployment for Linux, Windows, macOS and WebAssembly.
Stars: ✭ 44 (+100%)
Mutual labels:  qml
flutter plugins
Flutter插件集合,好用常用的插件.
Stars: ✭ 22 (+0%)
Mutual labels:  widget
AdvancedList-SwiftUI
MOVED to https://github.com/crelies/AdvancedList | Advanced list with empty, error and loading state implemented with SwiftUI
Stars: ✭ 41 (+86.36%)
Mutual labels:  pagination
lampager-laravel
Rapid pagination for Laravel
Stars: ✭ 71 (+222.73%)
Mutual labels:  pagination
SCodes
This project is Qt & Qml wrapper for ZXing-C++ Library that is used for decoding 1D and 2D barcodes.
Stars: ✭ 55 (+150%)
Mutual labels:  qml

Pagination

a paging widget based on Qt

stylesheet demo

Pagination{
	font-size:16px;
	font-family:"Microsoft YaHei UI";
	padding:8px;

	qproperty-spacing: 6;
	qproperty-totalsize: 46;
	qproperty-sizeofperpage: 2;
}

Pagination>QPushButton{
	border-radius:4px;
	color:#666;
	background:white;
}

Pagination>QPushButton:disabled{
	color:#666;
	background:transparent;
}

Pagination>QPushButton:hover{
	color:white;
	background:#86EDD9;
}

Pagination>QPushButton:selected{
	color:white;
	background:#1ABC9C;
}

Pagination>QPushButton:pressed{
	color:white;
	background:#1ABC9C;
}

image

Pagination{
	font-size:16px;
	font-family:"Microsoft YaHei UI";
	padding:8px;

	qproperty-spacing: 6;
	qproperty-totalsize: 46;
	qproperty-sizeofperpage: 2;
	qproperty-pageUpText: "上一页";
	qproperty-pageDownText: "下一页";
}
Pagination>QPushButton{
	border:1px solid #dce0e0;
	color:#666;
	background:white;
}
Pagination>QPushButton:selected{
	color:white;
	background:#0073A9;
}
Pagination>QPushButton:pressed{
	color:white;
	background:#0073A9;
}

image

Pagination{
	font-size:16px;
	font-family:"Microsoft YaHei UI";
	padding:8px;

	qproperty-spacing: 1;
	qproperty-totalsize: 46;
	qproperty-sizeofperpage: 2;
	qproperty-pageUpText: "上一页";
	qproperty-pageDownText: "下一页";
}
Pagination>QPushButton{
	color:#666;
	background:white;
	border:none;
}
Pagination>QPushButton:hover{
	color:#0073A9;
}
Pagination>QPushButton:selected{
	color:white;
	background:#0073A9;
}
Pagination>QPushButton:pressed{
	color:white;
	background:#0073A9;
}

/*your parent widget stylesheet:*/
background:#dce0e0;

image

paging style

pagination->setPagingStyle(new PagingStyle2);

image

customize your own paging style

#include "pagingutil.h"

class MyPagingStyle : public PagingUtil {
public:
	using PagingUtil::PagingUtil;

	void reCacheNumbers() override {
		curCacheNumbers.clear();
		//do your own paging cache here
	}
}

//then..
pagination->setPagingStyle(new MyPagingStyle);

Note: The curCacheNumbers stored numbers for display, or -1 if it's an ellipsis

function

properties

name description getter/setter
spacing spacing between buttons getBoxSpacing/setBoxSpacing
totalsize all of display item size getTotalSize/getTotalSize
sizeofperpage size of one page getSizeofPerPage/setSizeofPerPage
pageUpEnable visibility of left page button isPageUpEnabled/setPageUpEnable
pageUpText left page button display text getPageUpText/setPageUpText
pageDownEnable visibility of right page button isPageDownEnabled/setPageDownEnable
pageDownText right page button display text getPageDownText/setPageDownText

build the plugin(pagination_plugin.dll) project, and use pagination widget in Qt Designer
image

configure properties in Qt Designer property window
image

what's means of this properties:
image

public functions

  • void setPagingStyle(PagingUtil* pagingStyle)
    Change the current page numbers display style.
    By default, use PagingStyle1.
    The ownership of pagingStyle is transferred to the pagination widget, and it's the widget's responsibility to delete it.
  • void setCurrentPage(int number)
    Change the current selected number, the number is used to display instead of index. If the number is different from the current number, pageIndexChanged will be emit.
  • void pageUp()
    Jump to previous page.
  • void pageDown()
    Jump to next page.
  • void pageFirst()
    Jump to the first page.
  • void pageLast()
    Jump to last page.
  • int getCurrentPageIndex() const
    Return current selected page index.

signals

  • void pageIndexChanged(int index)
    will be emit whenever the number changes.

protected

  • virtual QString numberFormat(int number) const
    Can be implemented in subclasses to reformat current display number to string, and -1 if it's an ellipsis.
  • virtual void drawNumber(const QRect& rect, int number, QPainter* painter)
    Draw the number in target rect, can paint your own number display style in subclasses.
    For the hover state, to check 'hoverNumber == number'.
    For the selected state, to check 'pagingStyle->isSelectedNumber(number)'.
  • virtual void drawEllipsis(const QRect& rect, int number, QPainter* painter)
    Draw an ellipsis only.
  • virtual void drawPageUpBtn(const QRect& rect, QPainter* painter)
    Draw previous page button.
    For the hover state, to check 'hoverNumber == -3'.
  • virtual void drawPageDownBtn(const QRect& rect, QPainter* painter)
    Draw next page button.
    For the hover state, to check 'hoverNumber == -2'.

qml

Rectangle {
	width: 600
	height: 60
	color: "#303030"

	Pagination {
		id: pagination
		anchors.right: parent.right
		anchors.rightMargin: 8
		anchors.verticalCenter: parent.verticalCenter
		pageSize: 21

		onCurrentValueChanged: {
			console.log(pagination.currentValue)
		}
	}
}

image

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].