How to get value of a particular cell in QTableWidget on double clicking?

  • I am trying to get the value of a particular cell and store it in a variable, on double clicking a cell (itemdoubleclicked event) in QTableWidget. I know that it should be done by itemdoubleclicked event handler, but not sure how to get value of that cell. It should be something like below:


    But, this shows an error:

    AttributeError: 'PyQt5.QtCore.pyqtBoundSignal' object has no attribute 'values'

    So, values is not an attribute for itemDoubleClicked. Could you please help with the correct way to get the value of particular cell?

  • Qt Champions 2018

    @Piyush Check the documentation
    You get the double clicked item as signal/slot parameter:

    void QTableWidget::itemDoubleClicked(QTableWidgetItem *item)

    This does not make any sense:


    You should have your slot connected to this signal:

    def onItemDoubleClicked(self, item):

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.