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.1.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

pyqt_responsive_label-0.0.1-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for pyqt-responsive-label-0.0.1.tar.gz
Algorithm Hash digest
SHA256 c3337497b774e0e09d0866fb8409c90e88538459205d7f0a76160d8057fbe743
MD5 7a2fa2257523c4508baf497f8614c37c
BLAKE2b-256 46fd75b9d3f3eaac1fbb5be265f945091c86123063191696d1e365c86837aa6e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqt_responsive_label-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9e029b262519120c7f7697c0e21071b46ff6b253562e9d450907d22a13d280e9
MD5 c63d9942b14345e94ff9a6c43468c181
BLAKE2b-256 f4f117d24c1749cf1fd076c4b2f44a86071400ffe009bb34dcaa99215fb26441

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