I have a couple of QLineEdit in my GUI, created using the Qt Designer. For example, I have 3 QLineEdits in which they are connect to a node's translateX, translateY and translateZ. These line edits are working as what I have expected but currently I am trying to replicate the what Maya has where the channel box fields will turns red if the time slider is right on a particular keyed frame/ticks, pinkish if in-between of 2 animated frames.
However, for me to update these QLineEdits with color, it seems that in almost all of my methods (eg. update_tx(), update_ty() etc) I will need to write something as follows: def update_tx(node): palette = QtGui.QPalette() palette.setColor(QtGui.QPalette.Base, QtGui.QColor()) all_frames = cmds.keyframe(node, attribute=attr_name, selected=False, query=True, timeChange=True) or [] current_frame = cmds.currentTime(query=True) if current_frame in all_frames: palette.setColor(QtGui.QPalette.Base, QtGui.QColor("red")) else: palette.setColor(QtGui.QPalette.Base, QtGui.QColor("pink")) self.ui.transX_lineedit.setPalette(palette) Adding on, as I have also created some custom events too, some of the involved methods may also needs to be implemented in the same manner. As such, is there a better way that I can attempt this? -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/d74766d2-29df-496c-9ccc-cd8d72ef81ad%40googlegroups.com.