Hi, thank you for getting back. Yes, this looks amazing! I was using `QLineEdit{ border-width: 2px; border-style: solid; border-color: none none none red;` initially but your method works very well for my cause.
Going to try this out to see if I can make this channelbox-replication work. :D On Wednesday, January 22, 2020 at 1:38:25 PM UTC-8, Marcus Ottosson wrote: > > 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 > > [image: image.png] > > 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). > > On Wed, 22 Jan 2020 at 21:07, yann19 <yang...@gmail.com <javascript:>> > wrote: > >> Hi Marcus, sorry for the late reply. >> >> Say I am not going for the technicality/ code changed that is happening >> behind the scene. But rather trying to create a QLineEdit that is the same >> as the one you see in Maya. >> >> I tried the following: >> 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) >> >> As a start, this replication design is somewhat close to the ones we see >> in Maya, however, (see attached), I am having some issues such as: >> * note the 'small' spacing between the left-outermost edge of the >> QLineEdit and the red icon >> * Icon size is wrong - the image is saved with a 10x16 pixel size, I am >> expecting it to be a rectangular than squarish.. >> >> [image: lineedit_test.jpg] >> >> >> Any insights? >> >> -- >> 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 <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/python_inside_maya/eefc3480-e450-47cd-a61f-2d345be1be2d%40googlegroups.com >> >> <https://groups.google.com/d/msgid/python_inside_maya/eefc3480-e450-47cd-a61f-2d345be1be2d%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- 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/f674d98f-9f67-4568-b8ec-3437e774d346%40googlegroups.com.