0
我对此问题QDataWidgetMapper not working with QLabels有类似的问题。你如何在PYQT5中做到这一点。Pyqt5 qdatawidgetmapper将数据映射到qlabels
我对此问题QDataWidgetMapper not working with QLabels有类似的问题。你如何在PYQT5中做到这一点。Pyqt5 qdatawidgetmapper将数据映射到qlabels
这是由eyllanesc回答。非常感谢。
“如果你没有改善你的问题,那么我不能帮你,花点时间去做,因为我已经采取了建议你改变self._dataMapper.addMapping(self.lable,2,”text“ )self._dataMapper.addMapping(self.lable,2,b“text”)“
我建议不要放置以前答案的链接,您必须为您的问题提供一个上下文。 – eyllanesc
代码:'testMapper = QDataWidgetMapper() testMapper.setOrientation(Qt.Vertical) testMapper.setModel(testModel) testMapper.addMapping(ui.LineEdit1,0) testMapper.addMapping(ui.LineEdit2,1) testMapper.addMapping(ui.label,3, “文本”) testMapper.toFirst()' – eyllanesc
类NodeEditor(nodeBase,nodeForm): DEF __init __(个体,父母=无): 超级(nodeBase,自).__ init __(parent) self.setupUi(self) self._dataMapper = QtWidgets.QDataWidgetMapper( ) DEF则setModel(个体,proxyModel): self._proxyModel = proxyModel self._dataMapper.setModel(proxyModel.sourceModel()) self._dataMapper.addMapping(self.uiName,0) self._dataMapper.addMapping (self.uiType,1)这是一个适用于QLineEdit的代码。我需要映射到一个Qlable –