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
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
Built Distribution
File details
Details for the file pyqt-svg-icon-text-widget-0.0.31.tar.gz
.
File metadata
- Download URL: pyqt-svg-icon-text-widget-0.0.31.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/0.0.0 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | af82e076be25ea6b1519ce08ebcd78a8dd2b24f18281e5d3ce17975117248a90 |
|
MD5 | 6a5ecff8798d9023b7d9231ad47dc164 |
|
BLAKE2b-256 | e1cba30e1bf6834b50f17d9cea7e34bf6f227d7d1aa75d0c7ced9ae357120781 |
File details
Details for the file pyqt_svg_icon_text_widget-0.0.31-py3-none-any.whl
.
File metadata
- Download URL: pyqt_svg_icon_text_widget-0.0.31-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/0.0.0 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e42e2f80bac7cf1eeaa0467b75152364897ec8269ef6e9da6c56cbf4cf6b8969 |
|
MD5 | 3aeaadd4c02a6d391d28dc45a90b2557 |
|
BLAKE2b-256 | 047e529f6cbb120b8b19da47ec2e19b1f67186979d01568f5d5930572b54cfd8 |