Show More
@@ -59,7 +59,7 b' class CallTipWidget(QtGui.QLabel):' | |||||
59 | self._hide_timer.stop() |
|
59 | self._hide_timer.stop() | |
60 |
|
60 | |||
61 | elif etype == QtCore.QEvent.Leave: |
|
61 | elif etype == QtCore.QEvent.Leave: | |
62 |
self._ |
|
62 | self._leave_event_hide() | |
63 |
|
63 | |||
64 | return super(CallTipWidget, self).eventFilter(obj, event) |
|
64 | return super(CallTipWidget, self).eventFilter(obj, event) | |
65 |
|
65 | |||
@@ -92,7 +92,7 b' class CallTipWidget(QtGui.QLabel):' | |||||
92 | """ Reimplemented to start the hide timer. |
|
92 | """ Reimplemented to start the hide timer. | |
93 | """ |
|
93 | """ | |
94 | super(CallTipWidget, self).leaveEvent(event) |
|
94 | super(CallTipWidget, self).leaveEvent(event) | |
95 |
self._ |
|
95 | self._leave_event_hide() | |
96 |
|
96 | |||
97 | def paintEvent(self, event): |
|
97 | def paintEvent(self, event): | |
98 | """ Reimplemented to paint the background panel. |
|
98 | """ Reimplemented to paint the background panel. | |
@@ -205,10 +205,15 b' class CallTipWidget(QtGui.QLabel):' | |||||
205 | position = -1 |
|
205 | position = -1 | |
206 | return position, commas |
|
206 | return position, commas | |
207 |
|
207 | |||
208 |
def _ |
|
208 | def _leave_event_hide(self): | |
209 |
""" Hides the tooltip after some time has passed |
|
209 | """ Hides the tooltip after some time has passed (assuming the cursor is | |
|
210 | not over the tooltip). | |||
210 | """ |
|
211 | """ | |
211 |
if not self._hide_timer.isActive() |
|
212 | if (not self._hide_timer.isActive() and | |
|
213 | # If Enter events always came after Leave events, we wouldn't need | |||
|
214 | # this check. But on Mac OS, it sometimes happens the other way | |||
|
215 | # around when the tooltip is created. | |||
|
216 | QtGui.qApp.topLevelAt(QtGui.QCursor.pos()) != self): | |||
212 | self._hide_timer.start(300, self) |
|
217 | self._hide_timer.start(300, self) | |
213 |
|
218 | |||
214 | #------ Signal handlers ---------------------------------------------------- |
|
219 | #------ Signal handlers ---------------------------------------------------- |
General Comments 0
You need to be logged in to leave comments.
Login now