Skip to main content

A lib that let you organise a list of Pyside6.QtWidgets.QWigdet in a pagination view

Project description

widgets_pagination_view

A lib that let you organise a list of inheritance of Pyside6.QtWidgets.QWigdet in a pagination view.

How does it works ?

This package takes a list of objects that inherit from Pyside6.QtWidgets.QWidget and organizes them evenly into pages (which are derived from QtWidgets.QWidget).

Usage

First, create a new instance of a WidgetsPaginationView (this is the widgets which handle your widgets)

from PySide6 import QtWidgets
from widgets_pagination_view import InPageWidget, WidgetsPaginationView

# Creating the Qt App
app = QtWidgets.QApplication()

# Creating a main window
main_window = QtWidgets.QMainWindow()

# Creating the base class of the widgets
class MyButton(InPageWidget):

    def __init__(self, text):
        super().__init__()
        self.lyt = QtWidgets.QHBoxLayout()
        self.setLayout(self.lyt)
        self.button = QtWidgets.QPushButton(text)
        self.lyt.addWidget(self.button)
        self.button.clicked.connect(lambda: print(text, "clicked !"))

# Creating some widgets
buttons = [MyButton(str(i)) for i in range(100)]

# Creating a new instance of WidgetsPaginationView
w_page_view = WidgetsPaginationView(
    parent=None,
    widgets = buttons,
    max_loadables_pages_count=5,
    widgets_by_page_count=10,
    )

# Define w_pages_view as the central widget
main_window.setCentralWidget(w_page_view)

#Showing the window
main_window.show()

#Launching the app
app.exec()

parent: A valid QtWidgets.QWidget parent widget or None.

widgets: The list of widgets to display (as in the example, widgets must inherit from the InPageWidget class of the package).

max_loadables_pages_count: By default, this package loads and unloads widget pages on every page change, which optimizes performance and prevents slowdowns. The max_loadables_pages_count variable defines the maximum number of pages that can be loaded into memory simultaneously.

The widgets_by_pages_count parameter defines the number of widgets that each page can contain.

The result : result screenshot

Installation

pip install widgets_pagination_view

# Or

python -m pip install widgets_pagination_view

Requirements

This project requires the following packages (they will be installed automatically):

  • PySide6

About

This project is developed by SoloEnder under the MIT Licence.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

widgets_pagination_view-1.1.2.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

widgets_pagination_view-1.1.2-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file widgets_pagination_view-1.1.2.tar.gz.

File metadata

  • Download URL: widgets_pagination_view-1.1.2.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for widgets_pagination_view-1.1.2.tar.gz
Algorithm Hash digest
SHA256 30e79010e261e7285db9e5b24a3146664a10b37389e3e6e059fa8c77d84585f5
MD5 529a8a8b4b7729b0fe6961c7fc0f19e5
BLAKE2b-256 a67769bc9f0bd88e408838c1774c407d1f46d27c775a8f2c7ed3ec3a55cd569d

See more details on using hashes here.

File details

Details for the file widgets_pagination_view-1.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for widgets_pagination_view-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5fdbc2371f6ecb29d3ddc33813bcfa31d8691b2226f689b3b2c05f3cdf313e48
MD5 0cc2c30541178a3ab094d39a8ad12a20
BLAKE2b-256 f4989e481728d2a5cc099224498c27e466895c51d59109f5f870c6e471a5c5f8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page