从子类PyQT5调用父类

时间:2019-03-09 07:02:25

标签: python pyqt5

人。 我再次在这里试图解决问题。 我的所有代码都可以在这里查看:

https://gitlab.com/zoiobnu/comissiosystem

我有一个带有MainWindow的Main.py,其中包含菜单,工具栏。然后工具栏用表单调用Widget。此表单具有一个搜索按钮(Pesquisar),可打开一个对话框并关闭小部件。

ItemForm.py

    def search(self):
        item_search = ItemSearch(self)
        item_search.show()
        self.close()

enter image description here

通过这个新的搜索对话框,我可以在数据库中搜索并获取ID。

ItemSearch.py​​

        @pyqtSlot()
        def on_click(self):
            item_form = ItemForm(codigo=self.grdPesquisaCliente.item(self.grdPesquisaCliente.currentRow(), 0).text())
            item_form.show()
            ItemSearch.close()

enter image description here

我现在可以双击行并获取单元格ID,但是我想返回具有该单元格ID的第一个表单,并用db数据填充字段。

但是我不知道该如何做。

0 个答案:

没有答案
相关问题