def showMessage(self, msg, color='black'): '''Show the message in the label area.''' try: fg = QtGui.QColor(color) except Exception: fg = QtGui.QColor('black') pal = QtGui.QPalette(self.UI.label.palette()) pal.setColor(QtGui.QPalette.WindowText, fg) self.UI.label.setPalette(pal) self.UI.label.setText(msg)
def showMessage(self, msg, color): """Show the message in the label area.""" ui = self.UI fg = QtGui.QColor(color) pal = QtGui.QPalette(ui.label.palette()) if isQt6: pal.setColor(pal.ColorRole.Window, fg) # #2197 else: pal.setColor(QtGui.QPalette.WindowText, fg) ui.label.setPalette(pal) ui.label.setText(msg)