Skip to main content

PySide2extn is an Open Source Python Programming language extension for PySide2, which greatly enhances the capability of the PySide2 library with extra widgets and more.

Project description

PySide2extn

An extension for the Python PySide2 Qt Framework which expands the scope of the PySide2 package with many different modern widgets. Current release is occupied with two widget which are not natively present in the PySide2 package.

Widget Available:

  • Round Progress Bar
  • Spiral Progress Bar

Go to Home Page of Documentation for further Help

Getting Started

  • Install PySide2extn using pip
pip install PySide2extn
  • Build from source: After cloning the repo, go to the directory and open cmd or terminal
$ python3 setup.py sdist bdist_wheel
  • Install from .whl file.
pip install <PySide2extn------.whl>file

To verify that installation is complete, print out the pip list and search for the PySide2extn package.

For more details go to the Official PySide2extn Documentation Getting Started

Quick Demo

Quick demo help you to check weather you have successfully installed the Python Package. It comes with a UI loaded with all the widgets in this package with its different customized views. Users can easily differentiate the different styling elements used by widgets.

After installing the PySide2extn/PyQt5extn the users can try out quick demo by:

  1. Open the cmd or terminal. Open Python
>> from PySide2extn.demo import demo
>> demo.main()   #PRESS ENTER AND YOU WILL GET A DEMO APPLICATION

For further details go to the Official PySide2extn Documentation Quick Demo

Documentation

Official Documentation for PySide2extn is detailed in: PySide2extn Documentation.

Examples

  • Default Round Progress Bar
import sys
from PySide2 import QtCore, QtWidgets, QtGui

from PySide2extn.RoundProgressBar import roundProgressBar #IMPORT THE EXTENSION LIBRARY

x = 0
p = 1

class MyWidget(QtWidgets.QWidget):
    def __init__(self):
        QtWidgets.QWidget.__init__(self)

        self.hello = 'Round Progress Bar'
        self.button = QtWidgets.QPushButton("Click me to change Value")
        self.text = QtWidgets.QLabel("Round Progress Bar")
        self.text.setAlignment(QtCore.Qt.AlignCenter)

        #CREATING THE ROUND PROGRESS BAR OBJECT
        self.rpb = roundProgressBar()

        self.layout = QtWidgets.QVBoxLayout()
        self.layout.addWidget(self.text)
        self.layout.addWidget(self.button)

        # ADDING THE ROUND PROGRESS BAR OBJECT TO THE                                             # BOTTOM OF THE LAYOUT
        self.layout.addWidget(self.rpb)

        self.setLayout(self.layout)
        self.button.clicked.connect(self.magic) #BUTTON PRESSED EVENT

    def magic(self):
        global x, p
        x = x + 10*p
        if x==100:
            p = -1
        elif x==0:
            p = 1
        self.rpb.rpb_setValue(x)        #CHANGING THE VALUE OF THE PROGRESS BAR
        out_text = 'Round Progress Bar: ' + str(x) + '%'
        self.text.setText(out_text)

if __name__ == "__main__":
    app = QtWidgets.QApplication(sys.argv)
    widget = MyWidget()
    widget.show()
    sys.exit(app.exec_())

In this demo, we first created an object of the Round Progress Bar:

self.rpb = roundProgressBar() #CREATING THE ROUND PROGRESS BAR OBJECT

After that calling the Round Progress Bar object to display the value of progress using:

self.rpb.rpb_setValue(x) #CHANGING THE VALUE OF THE PROGRESS BAR

The rpb_setValue(value) takes an int as an argument and updates to change the value of the progress bar to the value given.

For More examples on Round Progress Bar go to: Official PySide2extn Documentation Examples

  • Default Spiral Progress Bar
import sys
from PySide2 import QtCore, QtWidgets, QtGui

#IMPORT THE EXTENSION  LIBRARY
from PySide2extn.SpiralProgressBar import spiralProgressBar 

x = 0
p = 1

class MyWidget(QtWidgets.QWidget):
    def __init__(self):
        QtWidgets.QWidget.__init__(self)

        self.hello = 'Spiral Progress Bar'
        self.button = QtWidgets.QPushButton("Click me to change Value")
        self.text = QtWidgets.QLabel("Spiral Progress Bar")
        self.text.setAlignment(QtCore.Qt.AlignCenter)

        #CREATING THE SPIRAL PROGRESS BAR OBJECT
        self.spb = spiralProgressBar()    

        #ADDING WIDGETS TO THE VERTICAL LAYOUT
        self.layout = QtWidgets.QVBoxLayout()
        self.layout.addWidget(self.text)
        self.layout.addWidget(self.button)

        # ADDING THE SPIRAL PROGRESS BAR OBJECT TO THE LAYOUT
        self.layout.addWidget(self.spb) 

        self.setLayout(self.layout)
        self.button.clicked.connect(self.magic) #BUTTON PRESSED EVENT

    def magic(self):
        global x, p
        x = x + 10*p
        if x==100:
            p = -1
        elif x==0:
            p = 1

        #CHANGING THE VALUE OF THE 3 DEFAULT PROGRESS BAR
        self.spb.spb_setValue((x, x*2, x*3)) 

        out_text = 'Spiral Progress Bar: '  
        out_text = out_text + str(x) + '%, ' + str(2*x) + '%, ' + str(3*x) + '%'
        self.text.setText(out_text)

if __name__ == "__main__":
    app = QtWidgets.QApplication(sys.argv)
    widget = MyWidget()
    widget.show()
    sys.exit(app.exec_())
  • Here first create a spiralProgressBar object and then add the progress bar to a layout and control the steps of the progress bar by the clicking of the button.

    self.spb = spiralProgressBar()		
    
  • Here we create a spiralProgressBar object instance and then use the self.spb as the spiral progress bar to influence its charactor like:

    self.spb.spb_setValue((x, x*2, x*3))
    
  • Since the default progress bar has 3 individual concentric circle, where each can be controlled individually, we pass a tuple containing the individual value for manipulating each concentric progress bar, to the function spb_setValue() , which only accepts a tuple of length equal to the number of concentric progress bar. Every function which can manipulate the properties of the Spiral Progress Bar uses the same idea. The order of entering the value are shown below:

For More examples on Spiral Progress Bar go to: Official PySide2extn Documentation Examples

Help

Support

  • Please feel free to contribute to the project by sharing the idea you have, which is not natively present in the PySide2/PyQt5 but essential for your workflow.
  • You can fill up the official PySide2extn/PyQt5extn Form where you just Brief the idea you have and also provide an active email address which is required for us to connect you.
  • If your idea worth the use, then definitely it will be available in the next update of the PySide2extn/PyQt5extn.
  • If this package made your life easy, then please share your experience with us Here

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

PySide2extn-1.0.0.tar.gz (21.1 kB view details)

Uploaded Source

Built Distribution

PySide2extn-1.0.0-py3-none-any.whl (20.3 kB view details)

Uploaded Python 3

File details

Details for the file PySide2extn-1.0.0.tar.gz.

File metadata

  • Download URL: PySide2extn-1.0.0.tar.gz
  • Upload date:
  • Size: 21.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.5

File hashes

Hashes for PySide2extn-1.0.0.tar.gz
Algorithm Hash digest
SHA256 dbd83af4e6cd71d6fec597b80048049221434ecfdc671bb49fd4b07b2c79f874
MD5 496a2de2dac74d3c2ae71f39d5039813
BLAKE2b-256 1be43cfcaf3d69e16a3c52f027dd55beff05145ebaa91b8aaab12a6dee4f7665

See more details on using hashes here.

File details

Details for the file PySide2extn-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: PySide2extn-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 20.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.5

File hashes

Hashes for PySide2extn-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ef106e0afa23423e50fb2f9c97674fcfafa9a7351fe15dd79d532b96935f1b26
MD5 59cfc15cdcccc46c98ff6e96dff7995a
BLAKE2b-256 d3b6e1b97eda1be4e13aeb6fd59908bc22de9f4a2955f1c693cb2589accca3cb

See more details on using hashes here.

Supported by

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