PyQt5 connection doesn't work: item cannot be converted to PyQt5.QtCore.QObject in this context

后端 未结 1 1681
慢半拍i
慢半拍i 2021-01-05 19:16

I am trying to connect a signal from a created object and am getting an error. Here is a simplified version of my code:

class OverviewWindow(QMainWindow):
          


        
相关标签:
1条回答
  • 2021-01-05 20:02

    QGraphicsItem does not inherit from QObject, therefore it is not possible to emit a signal from an instance of QGraphicsItem. You can solve this by subclassing QGraphicsObject instead of QGraphicsItem: http://doc.qt.io/qt-5/qgraphicsobject.html.

    0 讨论(0)
提交回复
热议问题