def __init__(self, parent): super(XScriptView, self).__init__(parent) # define custom properties self._edit = XCodeEdit(self) self._edit.setLanguage('Python') layout = QtGui.QHBoxLayout() layout.setContentsMargins(0, 0, 0, 0) layout.addWidget(self._edit) self.setLayout(layout)