Skip to main content

PyQt widget consists of svg icon label and text label side by side

Project description

pyqt-svg-icon-text-widget

PyQt widget consists of textless QLabel which has svg image as an icon on the left and text included QLabel on the right.

This module is useful to set the icon included title bar.

Requirements

  • PyQt5 >= 5.8

Setup

python -m pip install pyqt-svg-icon-text-widget

Included Package

Usage

  • setSvgFile(filename: str) to set svg file

  • setText(text: str) to set text

Note

Svg icon QLabel's maximum height is set according to text included QLabel's font height.

Example

Code Sample

from PyQt5.QtWidgets import QApplication

from pyqt_svg_icon_text_widget import SvgIconTextWidget





if __name__ == "__main__":

    import sys



    app = QApplication(sys.argv)

    ex = SvgIconTextWidget()

    ex.setSvgFile('ico/dark-notepad.svg')

    ex.setText('Dark Notepad')

    ex.show()

    sys.exit(app.exec_())

Result

image

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-svg-icon-text-widget-0.0.31.tar.gz (2.8 kB view hashes)

Uploaded Source

Built Distribution

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