Skip to main content

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

Note: Since v0.0.3, text is smaller than result image above for avoiding excessive width problem.

See Also

Metadata

Release files for pyqt-responsive-label 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyqt-responsive-label 0.0.3
File Size Uploaded
pyqt-responsive-label-0.0.3.tar.gz 3.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyqt-responsive-label 0.0.3
File Interpreter ABI Platform
pyqt_responsive_label-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 7.0 kB

Release files / pyqt-responsive-label-0.0.3.tar.gz

Download URL pyqt-responsive-label-0.0.3.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4d4f9fa6989437ad08ba64352163f88f8e3808caa05102c851f4386ed87615ca
BLAKE2b-256 checksum
How to use checksums
7a53a9422b7a02724dd340a0d06aad24df0ebeb7bad18452da6395320b41efcd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/0.0.0 CPython/3.7.6

Release files / pyqt_responsive_label-0.0.3-py3-none-any.whl

Download URL pyqt_responsive_label-0.0.3-py3-none-any.whl
Size 3.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cc3079022e5ab7c207be6ae9c07c5d03a1e67d9e03ba4af88d7c0ad1e980833f
BLAKE2b-256 checksum
How to use checksums
1d448d8c28e20d50ddb1a84215f2e8ee27e6c96d0132b1adf24d4a9c930a8332
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/0.0.0 CPython/3.7.6

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page