QVBoxLayout对象没有属性'setMargin'


AttributeError:'PySide.QtGui.QVBoxLayout'对象没有属性'setMargin'
解答:自Qt 4.4 IIRC起,setMargin是Qt的弃用方法,使用setContentsMargin
代替。

no Attrbuide centralwidget
创建窗口是,父类是QMainWindow还是QWidget 一定要区分

def maya_mainwindow():
    maya_main_window_name = pm.language.melGlobals['gMainWindow']
    maya_main_window = OpenMayaUI.MQtUtil.findControl(maya_main_window_name)
    widget = shiboken2.wrapInstance(long(maya_main_window), QtWidgets.QWidget)
    return widget
    
class ShowWindow(QtWidgets.QMainWindow, msv.Ui_MainWindow):
    def __init__(self, data_all):
        self.maya_mainwindow = maya_mainwindow()
        super(ShowWindow, self).__init__(self.maya_mainwindow)

        self.data = data_all
        self.setupUi(self)
        self.setupUi2()
        self.singal_connect()

评论
  目录