ZToolTip 2.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ztooltip-2.0.0/LICENSE +21 -0
- ztooltip-2.0.0/PKG-INFO +249 -0
- ztooltip-2.0.0/README.md +231 -0
- ztooltip-2.0.0/pyproject.toml +30 -0
- ztooltip-2.0.0/setup.cfg +4 -0
- ztooltip-2.0.0/src/ZToolTip.egg-info/PKG-INFO +249 -0
- ztooltip-2.0.0/src/ZToolTip.egg-info/SOURCES.txt +22 -0
- ztooltip-2.0.0/src/ZToolTip.egg-info/dependency_links.txt +1 -0
- ztooltip-2.0.0/src/ZToolTip.egg-info/requires.txt +2 -0
- ztooltip-2.0.0/src/ZToolTip.egg-info/top_level.txt +1 -0
- ztooltip-2.0.0/src/ztooltip/__init__.py +1 -0
- ztooltip-2.0.0/src/ztooltip/constants.py +3 -0
- ztooltip-2.0.0/src/ztooltip/drop_shadow.py +59 -0
- ztooltip-2.0.0/src/ztooltip/enums.py +9 -0
- ztooltip-2.0.0/src/ztooltip/placement_utils.py +58 -0
- ztooltip-2.0.0/src/ztooltip/tooltip.py +990 -0
- ztooltip-2.0.0/src/ztooltip/tooltip_interface.py +27 -0
- ztooltip-2.0.0/src/ztooltip/tooltip_triangle.py +125 -0
- ztooltip-2.0.0/src/ztooltip/utils.py +37 -0
ztooltip-2.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 FaBuLuZz
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
ztooltip-2.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ZToolTip
|
|
3
|
+
Version: 2.0.0
|
|
4
|
+
Summary: A modern and fully customizable tooltip library for PyQt and PySide
|
|
5
|
+
Author: FaBuLuZz
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/FaBuLuZz/ZToolTip
|
|
8
|
+
Keywords: python,qt,pyqt,pyside,tooltip,modern
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Requires-Python: >=3.7
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
License-File: LICENSE
|
|
15
|
+
Requires-Dist: pywin32>=311
|
|
16
|
+
Requires-Dist: QtPy>=2.4.1
|
|
17
|
+
Dynamic: license-file
|
|
18
|
+
|
|
19
|
+
# ZToolTip
|
|
20
|
+
|
|
21
|
+
[](https://pypi.org/project/ZToolTip/)
|
|
22
|
+
[](https://github.com/FaBuLuZz/ZToolTip)
|
|
23
|
+
[](https://github.com/FaBuLuZz/ZToolTip)
|
|
24
|
+
[](https://github.com/FaBuLuZz/ZToolTip)
|
|
25
|
+
[](https://github.com/FaBuLuZz/ZToolTip/blob/master/LICENSE)
|
|
26
|
+
|
|
27
|
+
Forked from [pyqttooltip](https://github.com/niklashenning/pyqttooltip) by [Niklas Henning](https://github.com/niklashenning)
|
|
28
|
+
|
|
29
|
+
A modern and fully customizable tooltip library for PyQt and PySide
|
|
30
|
+
|
|
31
|
+

|
|
32
|
+
|
|
33
|
+
## Features
|
|
34
|
+
|
|
35
|
+
- Fixed and automatic placement
|
|
36
|
+
- Customizable triangle
|
|
37
|
+
- Customizable animations and delays
|
|
38
|
+
- Fully customizable and modern UI
|
|
39
|
+
- Works with `PyQt5`, `PyQt6`, `PySide2`, and `PySide6`
|
|
40
|
+
|
|
41
|
+
## Installation
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
pip install ztooltip
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Usage
|
|
48
|
+
|
|
49
|
+
```python
|
|
50
|
+
from PyQt6.QtWidgets import QMainWindow, QPushButton
|
|
51
|
+
from ztooltip import Tooltip, TooltipPlacement
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class Window(QMainWindow):
|
|
55
|
+
def __init__(self):
|
|
56
|
+
super().__init__(parent=None)
|
|
57
|
+
|
|
58
|
+
# Add button
|
|
59
|
+
self.button = QPushButton('Button', self)
|
|
60
|
+
|
|
61
|
+
# Add tooltip to button
|
|
62
|
+
self.tooltip = Tooltip(self.button, 'This is a tooltip')
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
The tooltip will automatically be shown while hovering the widget. If you want to manually
|
|
66
|
+
show and hide the tooltip, you can use the `show()` and `hide()` methods:
|
|
67
|
+
|
|
68
|
+
```python
|
|
69
|
+
tooltip.show()
|
|
70
|
+
tooltip.hide()
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
To delete a tooltip, you can use the `deleteLater()` method:
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
tooltip.deleteLater()
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
To get notified when a tooltip gets shown or hidden, you can subscribe to the `shown` and `hidden` signals:
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
tooltip.shown.connect(lambda: print('shown'))
|
|
83
|
+
tooltip.hidden.connect(lambda: print('hidden'))
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Customization
|
|
87
|
+
|
|
88
|
+
* **Setting the widget:**
|
|
89
|
+
|
|
90
|
+
```python
|
|
91
|
+
tooltip.setWidget(widget) # Default: None
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
* **Setting the text:**
|
|
95
|
+
|
|
96
|
+
```python
|
|
97
|
+
tooltip.setText('Text of the tooltip') # Default: ''
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
* **Setting the placement:**
|
|
101
|
+
|
|
102
|
+
```python
|
|
103
|
+
tooltip.setPlacement(TooltipPlacement.RIGHT) # Default: TooltipPlacement.AUTO
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
> **AVAILABLE PLACEMENTS:** <br> `AUTO`, `LEFT`, `RIGHT`, `TOP`, `BOTTOM`
|
|
107
|
+
|
|
108
|
+
* **Enabling or disabling the triangle:**
|
|
109
|
+
|
|
110
|
+
```python
|
|
111
|
+
tooltip.setTriangleEnabled(False) # Default: True
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
* **Setting the size of the triangle:**
|
|
115
|
+
|
|
116
|
+
```python
|
|
117
|
+
tooltip.setTriangleSize(7) # Default: 5
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
* **Setting a duration:**
|
|
121
|
+
|
|
122
|
+
```python
|
|
123
|
+
tooltip.setDuration(1000) # Default: 0
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
> The duration is the time in milliseconds after which the tooltip will start fading out again.
|
|
127
|
+
> If the duration is set to `0`, the tooltip will stay visible for as long as the widget is hovered.
|
|
128
|
+
|
|
129
|
+
* **Adding delays to the fade in / out animations after hovering the widget:**
|
|
130
|
+
|
|
131
|
+
```python
|
|
132
|
+
tooltip.setShowDelay(500) # Default: 50
|
|
133
|
+
tooltip.setHideDelay(500) # Default: 50
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
* **Setting the durations of the fade in / out animations:**
|
|
137
|
+
|
|
138
|
+
```python
|
|
139
|
+
tooltip.setFadeInDuration(250) # Default: 150
|
|
140
|
+
tooltip.setFadeOutDuration(250) # Default: 150
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
* **Setting the refresh rate in Hz:**
|
|
144
|
+
|
|
145
|
+
```python
|
|
146
|
+
tooltip.setRefreshRate(30) # Default: 60
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
* **Setting the border radius:**
|
|
150
|
+
|
|
151
|
+
```python
|
|
152
|
+
tooltip.setBorderRadius(0) # Default: 8
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
* **Enabling or disabling the border:**
|
|
156
|
+
|
|
157
|
+
```python
|
|
158
|
+
tooltip.setBorderEnabled(False) # Default: True
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
* **Setting custom colors:**
|
|
162
|
+
|
|
163
|
+
```python
|
|
164
|
+
tooltip.setBackgroundColor(QColor('#FCBA03')) # Default: QColor('#FFFFFF')
|
|
165
|
+
tooltip.setTextColor(QColor('#000000')) # Default: QColor('#373737')
|
|
166
|
+
tooltip.setBorderColor(QColor('#A38329')) # Default: QColor('#CDCFD6')
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
* **Setting a custom font:**
|
|
170
|
+
|
|
171
|
+
```python
|
|
172
|
+
tooltip.setFont(QFont('Consolas', 10)) # Default: QFont('Arial', 9, QFont.Weight.Bold)
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
* **Applying margins to the content of the tooltip:**
|
|
176
|
+
|
|
177
|
+
```python
|
|
178
|
+
tooltip.setMargins(QMargins(10, 8, 10, 8)) # Default: QMargins(12, 8, 12, 7)
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
* **Setting a maximum width:**
|
|
182
|
+
|
|
183
|
+
```python
|
|
184
|
+
tooltip.setMaximumWidth(150) # Default: 16777215 (QWIDGETSIZE_MAX)
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
* **Enabling or disabling text centering for wrapped text:**
|
|
188
|
+
|
|
189
|
+
```python
|
|
190
|
+
tooltip.setTextCenteringEnabled(False) # Default: True
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
* **Enabling or disabling the drop shadow:**
|
|
194
|
+
|
|
195
|
+
```python
|
|
196
|
+
tooltip.setDropShadowEnabled(False) # Default: True
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
* **Changing the drop shadow strength:**
|
|
200
|
+
|
|
201
|
+
```python
|
|
202
|
+
tooltip.setDropShadowStrength(3.5) # Default: 2.0
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
* **Making the tooltip translucent:**
|
|
206
|
+
|
|
207
|
+
```python
|
|
208
|
+
tooltip.setOpacity(0.8) # Default: 1.0
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
**<br>Other customization options:**
|
|
212
|
+
|
|
213
|
+
| Option | Description | Default |
|
|
214
|
+
|-----------------------------|---------------------------------------------------------------|----------------------------|
|
|
215
|
+
| `setShowingOnDisabled()` | Whether the tooltips should also be shown on disabled widgets | `False` |
|
|
216
|
+
| `setFadeInEasingCurve()` | The easing curve of the fade in animation | `QEasingCurve.Type.Linear` |
|
|
217
|
+
| `setFadeOutEasingCurve()` | The easing curve of the fade out animation | `QEasingCurve.Type.Linear` |
|
|
218
|
+
| `setMarginLeft()` | Set left margin individually | `12` |
|
|
219
|
+
| `setMarginRight()` | Set right margin individually | `12` |
|
|
220
|
+
| `setMarginTop()` | Set top margin individually | `8` |
|
|
221
|
+
| `setMarginBottom()` | Set bottom margin individually | `7` |
|
|
222
|
+
|
|
223
|
+
## Demo
|
|
224
|
+
|
|
225
|
+
https://github.com/user-attachments/assets/04af0cfc-32fd-4aa7-80e6-6f263e44af67
|
|
226
|
+
|
|
227
|
+
The demos for PyQt5, PyQt6, and PySide6 can be found in the [demo](https://github.com/FaBuLuZz/ztooltip/blob/master/demo) folder.
|
|
228
|
+
|
|
229
|
+
> To keep the demo simple, only the most important features are included.
|
|
230
|
+
> To get an overview of all the customization options, check out the documentation above.
|
|
231
|
+
|
|
232
|
+
## Tests
|
|
233
|
+
|
|
234
|
+
Installing the required test dependencies [PyQt6](https://pypi.org/project/PyQt6/), [pytest](https://github.com/pytest-dev/pytest), and [coveragepy](https://github.com/nedbat/coveragepy):
|
|
235
|
+
|
|
236
|
+
```sh
|
|
237
|
+
pip install PyQt6 pytest coverage
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
To run the tests with coverage, clone this repository, go into the main directory and run:
|
|
241
|
+
|
|
242
|
+
```sh
|
|
243
|
+
coverage run -m pytest
|
|
244
|
+
coverage report --ignore-errors -m
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
## License
|
|
248
|
+
|
|
249
|
+
This software is licensed under the [MIT license](https://github.com/FaBuLuZz/ZToolTip/blob/master/LICENSE).
|
ztooltip-2.0.0/README.md
ADDED
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
# ZToolTip
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/ZToolTip/)
|
|
4
|
+
[](https://github.com/FaBuLuZz/ZToolTip)
|
|
5
|
+
[](https://github.com/FaBuLuZz/ZToolTip)
|
|
6
|
+
[](https://github.com/FaBuLuZz/ZToolTip)
|
|
7
|
+
[](https://github.com/FaBuLuZz/ZToolTip/blob/master/LICENSE)
|
|
8
|
+
|
|
9
|
+
Forked from [pyqttooltip](https://github.com/niklashenning/pyqttooltip) by [Niklas Henning](https://github.com/niklashenning)
|
|
10
|
+
|
|
11
|
+
A modern and fully customizable tooltip library for PyQt and PySide
|
|
12
|
+
|
|
13
|
+

|
|
14
|
+
|
|
15
|
+
## Features
|
|
16
|
+
|
|
17
|
+
- Fixed and automatic placement
|
|
18
|
+
- Customizable triangle
|
|
19
|
+
- Customizable animations and delays
|
|
20
|
+
- Fully customizable and modern UI
|
|
21
|
+
- Works with `PyQt5`, `PyQt6`, `PySide2`, and `PySide6`
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
pip install ztooltip
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Usage
|
|
30
|
+
|
|
31
|
+
```python
|
|
32
|
+
from PyQt6.QtWidgets import QMainWindow, QPushButton
|
|
33
|
+
from ztooltip import Tooltip, TooltipPlacement
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class Window(QMainWindow):
|
|
37
|
+
def __init__(self):
|
|
38
|
+
super().__init__(parent=None)
|
|
39
|
+
|
|
40
|
+
# Add button
|
|
41
|
+
self.button = QPushButton('Button', self)
|
|
42
|
+
|
|
43
|
+
# Add tooltip to button
|
|
44
|
+
self.tooltip = Tooltip(self.button, 'This is a tooltip')
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
The tooltip will automatically be shown while hovering the widget. If you want to manually
|
|
48
|
+
show and hide the tooltip, you can use the `show()` and `hide()` methods:
|
|
49
|
+
|
|
50
|
+
```python
|
|
51
|
+
tooltip.show()
|
|
52
|
+
tooltip.hide()
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
To delete a tooltip, you can use the `deleteLater()` method:
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
tooltip.deleteLater()
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
To get notified when a tooltip gets shown or hidden, you can subscribe to the `shown` and `hidden` signals:
|
|
62
|
+
|
|
63
|
+
```python
|
|
64
|
+
tooltip.shown.connect(lambda: print('shown'))
|
|
65
|
+
tooltip.hidden.connect(lambda: print('hidden'))
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Customization
|
|
69
|
+
|
|
70
|
+
* **Setting the widget:**
|
|
71
|
+
|
|
72
|
+
```python
|
|
73
|
+
tooltip.setWidget(widget) # Default: None
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
* **Setting the text:**
|
|
77
|
+
|
|
78
|
+
```python
|
|
79
|
+
tooltip.setText('Text of the tooltip') # Default: ''
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
* **Setting the placement:**
|
|
83
|
+
|
|
84
|
+
```python
|
|
85
|
+
tooltip.setPlacement(TooltipPlacement.RIGHT) # Default: TooltipPlacement.AUTO
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
> **AVAILABLE PLACEMENTS:** <br> `AUTO`, `LEFT`, `RIGHT`, `TOP`, `BOTTOM`
|
|
89
|
+
|
|
90
|
+
* **Enabling or disabling the triangle:**
|
|
91
|
+
|
|
92
|
+
```python
|
|
93
|
+
tooltip.setTriangleEnabled(False) # Default: True
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
* **Setting the size of the triangle:**
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
tooltip.setTriangleSize(7) # Default: 5
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
* **Setting a duration:**
|
|
103
|
+
|
|
104
|
+
```python
|
|
105
|
+
tooltip.setDuration(1000) # Default: 0
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
> The duration is the time in milliseconds after which the tooltip will start fading out again.
|
|
109
|
+
> If the duration is set to `0`, the tooltip will stay visible for as long as the widget is hovered.
|
|
110
|
+
|
|
111
|
+
* **Adding delays to the fade in / out animations after hovering the widget:**
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
tooltip.setShowDelay(500) # Default: 50
|
|
115
|
+
tooltip.setHideDelay(500) # Default: 50
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
* **Setting the durations of the fade in / out animations:**
|
|
119
|
+
|
|
120
|
+
```python
|
|
121
|
+
tooltip.setFadeInDuration(250) # Default: 150
|
|
122
|
+
tooltip.setFadeOutDuration(250) # Default: 150
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
* **Setting the refresh rate in Hz:**
|
|
126
|
+
|
|
127
|
+
```python
|
|
128
|
+
tooltip.setRefreshRate(30) # Default: 60
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
* **Setting the border radius:**
|
|
132
|
+
|
|
133
|
+
```python
|
|
134
|
+
tooltip.setBorderRadius(0) # Default: 8
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
* **Enabling or disabling the border:**
|
|
138
|
+
|
|
139
|
+
```python
|
|
140
|
+
tooltip.setBorderEnabled(False) # Default: True
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
* **Setting custom colors:**
|
|
144
|
+
|
|
145
|
+
```python
|
|
146
|
+
tooltip.setBackgroundColor(QColor('#FCBA03')) # Default: QColor('#FFFFFF')
|
|
147
|
+
tooltip.setTextColor(QColor('#000000')) # Default: QColor('#373737')
|
|
148
|
+
tooltip.setBorderColor(QColor('#A38329')) # Default: QColor('#CDCFD6')
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
* **Setting a custom font:**
|
|
152
|
+
|
|
153
|
+
```python
|
|
154
|
+
tooltip.setFont(QFont('Consolas', 10)) # Default: QFont('Arial', 9, QFont.Weight.Bold)
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
* **Applying margins to the content of the tooltip:**
|
|
158
|
+
|
|
159
|
+
```python
|
|
160
|
+
tooltip.setMargins(QMargins(10, 8, 10, 8)) # Default: QMargins(12, 8, 12, 7)
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
* **Setting a maximum width:**
|
|
164
|
+
|
|
165
|
+
```python
|
|
166
|
+
tooltip.setMaximumWidth(150) # Default: 16777215 (QWIDGETSIZE_MAX)
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
* **Enabling or disabling text centering for wrapped text:**
|
|
170
|
+
|
|
171
|
+
```python
|
|
172
|
+
tooltip.setTextCenteringEnabled(False) # Default: True
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
* **Enabling or disabling the drop shadow:**
|
|
176
|
+
|
|
177
|
+
```python
|
|
178
|
+
tooltip.setDropShadowEnabled(False) # Default: True
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
* **Changing the drop shadow strength:**
|
|
182
|
+
|
|
183
|
+
```python
|
|
184
|
+
tooltip.setDropShadowStrength(3.5) # Default: 2.0
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
* **Making the tooltip translucent:**
|
|
188
|
+
|
|
189
|
+
```python
|
|
190
|
+
tooltip.setOpacity(0.8) # Default: 1.0
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
**<br>Other customization options:**
|
|
194
|
+
|
|
195
|
+
| Option | Description | Default |
|
|
196
|
+
|-----------------------------|---------------------------------------------------------------|----------------------------|
|
|
197
|
+
| `setShowingOnDisabled()` | Whether the tooltips should also be shown on disabled widgets | `False` |
|
|
198
|
+
| `setFadeInEasingCurve()` | The easing curve of the fade in animation | `QEasingCurve.Type.Linear` |
|
|
199
|
+
| `setFadeOutEasingCurve()` | The easing curve of the fade out animation | `QEasingCurve.Type.Linear` |
|
|
200
|
+
| `setMarginLeft()` | Set left margin individually | `12` |
|
|
201
|
+
| `setMarginRight()` | Set right margin individually | `12` |
|
|
202
|
+
| `setMarginTop()` | Set top margin individually | `8` |
|
|
203
|
+
| `setMarginBottom()` | Set bottom margin individually | `7` |
|
|
204
|
+
|
|
205
|
+
## Demo
|
|
206
|
+
|
|
207
|
+
https://github.com/user-attachments/assets/04af0cfc-32fd-4aa7-80e6-6f263e44af67
|
|
208
|
+
|
|
209
|
+
The demos for PyQt5, PyQt6, and PySide6 can be found in the [demo](https://github.com/FaBuLuZz/ztooltip/blob/master/demo) folder.
|
|
210
|
+
|
|
211
|
+
> To keep the demo simple, only the most important features are included.
|
|
212
|
+
> To get an overview of all the customization options, check out the documentation above.
|
|
213
|
+
|
|
214
|
+
## Tests
|
|
215
|
+
|
|
216
|
+
Installing the required test dependencies [PyQt6](https://pypi.org/project/PyQt6/), [pytest](https://github.com/pytest-dev/pytest), and [coveragepy](https://github.com/nedbat/coveragepy):
|
|
217
|
+
|
|
218
|
+
```sh
|
|
219
|
+
pip install PyQt6 pytest coverage
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
To run the tests with coverage, clone this repository, go into the main directory and run:
|
|
223
|
+
|
|
224
|
+
```sh
|
|
225
|
+
coverage run -m pytest
|
|
226
|
+
coverage report --ignore-errors -m
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
## License
|
|
230
|
+
|
|
231
|
+
This software is licensed under the [MIT license](https://github.com/FaBuLuZz/ZToolTip/blob/master/LICENSE).
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=45", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "ZToolTip"
|
|
7
|
+
version = "2.0.0"
|
|
8
|
+
description = "A modern and fully customizable tooltip library for PyQt and PySide"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = {text = "MIT"}
|
|
11
|
+
authors = [
|
|
12
|
+
{name = "FaBuLuZz"}
|
|
13
|
+
]
|
|
14
|
+
keywords = ["python", "qt", "pyqt", "pyside", "tooltip", "modern"]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Programming Language :: Python :: 3",
|
|
17
|
+
"Operating System :: OS Independent",
|
|
18
|
+
"License :: OSI Approved :: MIT License"
|
|
19
|
+
]
|
|
20
|
+
requires-python = ">=3.7"
|
|
21
|
+
dependencies = [
|
|
22
|
+
"pywin32>=311",
|
|
23
|
+
"QtPy>=2.4.1"
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
[project.urls]
|
|
27
|
+
Homepage = "https://github.com/FaBuLuZz/ZToolTip"
|
|
28
|
+
|
|
29
|
+
[tool.setuptools.packages.find]
|
|
30
|
+
where = ["src"]
|
ztooltip-2.0.0/setup.cfg
ADDED