【发布时间】:2018-02-24 01:48:03
【问题描述】:
我是新手,很难将一行代码从 PyQT4 更改为 PyQT5,这与信号和插槽有关。我怀疑它是因为参数正在传递给插槽。
原行是:
self.connect(self.assetView.selectionModel(), SIGNAL(("currentRowChanged(QModelIndex,QModelIndex)")),self.assetChanged)
我试过了:
self.assetView.selectionModel.currentRowChanged(QModelIndex,QModelIndex).connect(self.assetChanged)
我得到:AttributeError: 'builtin_function_or_method' object has no attribute 'currentRowChanged'
self.assetView 是一个 QTableView 并且 self.assetChanged 有定义:
def assetChanged(self, index):
感谢任何帮助
【问题讨论】: