ADN-DevTech / 3dsMax-Python-HowTos

3ds Max python samples
MIT License
224 stars 49 forks source link

Background covers the border or border dissapear when I set a background color in 3dsMax (PySide2) #28

Closed HatemSelim94 closed 10 months ago

HatemSelim94 commented 1 year ago

I understand that this is not related to the code provided in this repository, but I hope that someone helps. Thank you.

If I set the background color for a QTexeEdit, the border disappears, and the border appears only when I make the background transparent.

Here is a working snippet

from PySide2 import QtGui, QtCore, QtWidgets
from qtmax import GetQMaxMainWindow

def get_textbox(Text="testing", background_color="yellow") :
    vbox = QtWidgets.QVBoxLayout()
    text_edit = QtWidgets.QTextEdit(Text)
    text_edit.setStyleSheet(f"QTextEdit{{background-color: {background_color};border-style:solid;border-color:pink;border-width:2px;}}")
    vbox.addWidget(text_edit)
    return vbox

def build_widget():
    main_window = GetQMaxMainWindow()
    dockable_widget = QtWidgets.QDockWidget(main_window)
    widget = QtWidgets.QWidget()
    dockable_widget.setWidget(widget)
    main_window.addDockWidget(QtCore.Qt.RightDockWidgetArea, dockable_widget)
    widget_layout = QtWidgets.QVBoxLayout()
    widget.setLayout(widget_layout)

    # when the background color is black or any color 
    text_box = get_textbox("any background color", background_color="black")
    widget_layout.addLayout(text_box)

    # when the background color is transparent 
    text_box = get_textbox("transparent", background_color="transparent")
    widget_layout.addLayout(text_box)

    dockable_widget.show()

if __name__ == '__main__':
    build_widget()

This is the output: image

hugow commented 1 year ago

Thanks, I will try it and tell you what I think.

hugow commented 1 year ago

I can definitely repro this in max, and it works in a standalone application. More feedback when available

hugow commented 1 year ago

This issue is internal to 3dsMax. It's been logged. Thanks a lot for reporting it and sorry for the inconvenience! Also, I don't think there is a workaround but if I find one I will post it here.