Skip to main content

PyQt QLabel which can resize the font responsively accordance with window's size change

Project description

pyqt-responsive-label

PyQt QLabel which can resize the font responsively accordance with window's size change

Requirements

  • PyQt5 >= 5.8

Setup

python -m pip install pyqt-responsive-label

Method Overview

  • setAcceptTextChange(f: bool) - Choose the option that this should accept text change(paintEvent) or not.

Example

from PyQt5.QtWidgets import QApplication, QVBoxLayout, QWidget

from pyqt_responsive_label import ResponsiveLabel





class Widget(QWidget):

    def __init__(self):

        super().__init__()

        self.__initUi()



    def __initUi(self):

        responsiveLabel = ResponsiveLabel(self)

        responsiveLabel.setText('ABC')



        lay = QVBoxLayout()

        lay.addWidget(responsiveLabel)



        self.setMinimumSize(responsiveLabel.sizeHint())

        self.setLayout(lay)





if __name__ == "__main__":

    import sys



    app = QApplication(sys.argv)

    widget = Widget()

    widget.show()

    app.exec_()

Result

Like below, label font size is changing accordance with window's size.

image

image

See Also

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

pyqt-responsive-label-0.0.2.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

pyqt_responsive_label-0.0.2-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file pyqt-responsive-label-0.0.2.tar.gz.

File metadata

  • Download URL: pyqt-responsive-label-0.0.2.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/0.0.0 CPython/3.7.6

File hashes

Hashes for pyqt-responsive-label-0.0.2.tar.gz
Algorithm Hash digest
SHA256 1563adfb529f92228ccd2d3254993b28f2aad3780ff5c3546e92115b6aa5c6b8
MD5 78124afabb3205a838d4e0971975d3f5
BLAKE2b-256 9f6e5067c993505252d48c6321aaccbd7e0c0560017cfb384a4b8a5709ac2dc4

See more details on using hashes here.

File details

Details for the file pyqt_responsive_label-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for pyqt_responsive_label-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0f8e130914ef65890c177569ee55b72d98902171caaafb81d48e05013740365c
MD5 4fa681c5508b0c1fd0d750dbbeac59c5
BLAKE2b-256 48b4fd31326bfb476fe902be3e2d094dd14c165f3acd91db6303ab0fe9ad570c

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