Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yjg30737/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
https://github.com/yjg30737/pyqt-svg-icon-text-widget
pyqt pyqt-examples pyqt5 pyqt5-examples pyqt5-tutorial python python3 python37 qhboxlayout qlabel qpainter qpaintevent qsvgrenderer qt qwidget
Last synced: 11 days ago
JSON representation
PyQt widget consists of textless QLabel which has svg image as an icon on the left and text included QLabel on the right
- Host: GitHub
- URL: https://github.com/yjg30737/pyqt-svg-icon-text-widget
- Owner: yjg30737
- License: mit
- Created: 2022-02-13T11:05:18.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-18T04:07:09.000Z (about 2 years ago)
- Last Synced: 2024-08-09T05:51:12.178Z (3 months ago)
- Topics: pyqt, pyqt-examples, pyqt5, pyqt5-examples, pyqt5-tutorial, python, python3, python37, qhboxlayout, qlabel, qpainter, qpaintevent, qsvgrenderer, qt, qwidget
- Language: Python
- Homepage:
- Size: 20.5 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
* pyqt-svg-label## 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
```python
from PyQt5.QtWidgets import QApplication
from pyqt_svg_icon_text_widget import SvgIconTextWidgetif __name__ == "__main__":
import sysapp = QApplication(sys.argv)
ex = SvgIconTextWidget()
ex.setSvgFile('ico/dark-notepad.svg')
ex.setText('Dark Notepad')
ex.show()
sys.exit(app.exec_())
```Result
![image](https://user-images.githubusercontent.com/55078043/153750415-c9f99eb7-46be-4703-9751-18578e839f4b.png)