Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to insert QPushButton into TableView?

I am implementing QAbstractTableModel and I would like to insert a QPushButton in the last column of each row. When users click on this button, a new window is shown with more information about this row.

Do you have any idea how to insert the button? I know about delegating system but all examples are only about "how to edit color with the combo box"...

like image 666
izidor Avatar asked Dec 13 '22 22:12

izidor


1 Answers

You can use

QPushButton* viewButton = new QPushButton("View");    
tableView->setIndexWidget(model->index(counter,2), viewButton);
like image 188
PDH Avatar answered Dec 28 '22 08:12

PDH