diff --git a/aqt/utils.py b/aqt/utils.py index 10fc07096..5d22f7f5a 100644 --- a/aqt/utils.py +++ b/aqt/utils.py @@ -344,3 +344,46 @@ def limitedCount(count): if count >= 1000: return "1000+" return str(count) + +# Tooltips +###################################################################### + +_tooltipTimer = None +_tooltipLabel = None + +def tooltip(msg, period=3000): + global _tooltipTimer, _tooltipLabel + class CustomLabel(QLabel): + def mousePressEvent(self, evt): + evt.accept() + self.hide() + closeTooltip() + aw = aqt.mw.app.activeWindow() + lab = CustomLabel("""\ +
![]() |
+%s | +