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)--
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_m...@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.
my_icon="full_keyed.png" #this is the red color label that we see in maya
self.ui.transX_lineedit.addAction(my_icon,QLineEdit.LeadingPosition)
Maybe try a stylesheet instead.
from PySide2 import QtWidgets
channelbox = QtWidgets.QWidget()
layout = QtWidgets.QVBoxLayout(channelbox)
layout.setSpacing(0)
for row in range(15):
layout.addWidget(QtWidgets.QLineEdit())
channelbox.setStyleSheet("""\
QLineEdit {
border: 0px;
border-left: 13px solid red;
padding-left: 3px;
}
""")
channelbox.show()
# border: (Somehow) required for border-left to work
# border-left: Red colouring
# padding-left: Spacing between color and value

Bear in mind pixel values need to be multiplied by your display DPI scaling. E.g. a width of 5 px would get half as wide on a Retina display with a scaling of 2x. You can get scaling from Qt. Also might be able to vanquish the spacing between line edits with some more CSS. For the colour you could use CSS names like red, hex like #FF0000 or rgb(127, 0, 255).
--
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_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/eefc3480-e450-47cd-a61f-2d345be1be2d%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.