https://github.com/yjg30737/pyqt-description-tooltip
PyQt QToolTip that user can add description and so on.
https://github.com/yjg30737/pyqt-description-tooltip
pyqt pyqt5 pyqt5-examples qt qt5 qtooltip
Last synced: 2 months ago
JSON representation
PyQt QToolTip that user can add description and so on.
- Host: GitHub
- URL: https://github.com/yjg30737/pyqt-description-tooltip
- Owner: yjg30737
- License: mit
- Created: 2022-03-23T11:07:08.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-05-13T22:14:43.000Z (about 3 years ago)
- Last Synced: 2025-02-22T02:34:43.318Z (3 months ago)
- Topics: pyqt, pyqt5, pyqt5-examples, qt, qt5, qtooltip
- Language: Python
- Homepage:
- Size: 12.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pyqt-description-tooltip
PyQt QToolTip that user can add description and so on.## Setup
`python -m pip install pyqt-description-tooltip`## Usage
You can get the qt tooltip text using static method below.
```python
DescriptionToolTipGetter.getToolTip(title: str = '', shortcut: str = '', description: str = '',
shortcut_color: str = '#AAA', description_color: str = '#AAA')
```## Example
Code Sample
```python
from PyQt5.QtWidgets import QMainWindow, QPushButton, QApplication
from pyqt_description_tooltip import DescriptionToolTipGetter
from pyqt_style_setter import StyleSetterclass MainWindow(QMainWindow):
def __init__(self):
super().__init__()
self.__initUi()def __initUi(self):
btn = QPushButton('ToolTip Button')btn.setToolTip(DescriptionToolTipGetter.getToolTip(title='ToolTip Title', shortcut='Ctrl+T',
description='ToolTip Description.',))
self.setCentralWidget(btn)if __name__ == "__main__":
import sysapp = QApplication(sys.argv)
example = MainWindow()
StyleSetter.setWindowStyle(example)
# https://github.com/yjg30737/pyqt-style-setter.git
example.show()
app.exec_()
```Result
