def change_palette(self, color): '''Sets the global tooltip background to the given color and initializes reset''' p = QPalette(self.default_palette) p.setColor(QPalette.All, QPalette.ToolTipBase, color) QToolTip.setPalette(p) self.timer = QTimer() self.timer.timeout.connect(self.try_reset_palette) self.timer.start(300) #short enough not to flicker a wrongly colored tooltip
def change_palette(self, color): """Sets the global tooltip background to the given color and initializes reset""" self.old_palette = QToolTip.palette() p = QPalette(self.old_palette) p.setColor(QPalette.All, QPalette.ToolTipBase, color) QToolTip.setPalette(p) self.timer = QTimer() self.timer.timeout.connect(self.try_reset_palette) self.timer.start( 300) #short enough not to flicker a wrongly colored tooltip
def try_reset_palette(self): """Resets the global tooltip background color as soon as the swatch is hidden""" if self.old_palette is not None and not QToolTip.isVisible(): QToolTip.setPalette(self.old_palette) self.old_palette = None
def try_reset_palette(self): '''Resets the global tooltip background color as soon as the swatch is hidden''' if self.old_palette is not None and not QToolTip.isVisible(): QToolTip.setPalette(self.old_palette) self.old_palette = None
def try_reset_palette(self): '''Resets the global tooltip background color as soon as the swatch is hidden''' if not QToolTip.isVisible(): QToolTip.setPalette(self.default_palette)