Adding widgets to qtablewidget pyqt

前端 未结 2 651
南笙
南笙 2020-12-06 16:56

Is there anyway to add like a button in qtablewidget? But the date within the cell would stil have to be displaying, for example if an user double clicked a cell, could i se

2条回答
  •  情深已故
    2020-12-06 17:52

    In PyQt4 add button to qtablewidget :

    btn= QtGui.QPushButton('Hello')
    qtable_name.setCellWidget(0,0, btn) # qtable_name is your qtablewidget name
    

提交回复
热议问题