2

The answer https://stackoverflow.com/a/24909605/3125006 shows how to add a QPushButton into a QTableWidget cell. This works perfectly.

But then the background area around the PushButton is selectable. (Background turns into selection color when clicked). How can I prevent that?

enter image description here

Codev
  • 1,040
  • 2
  • 14
  • 31

1 Answers1

0

The solution in Pogrammer_ARM's comment is a suitable workaround. With corrected case:

QTableWidget* tblSensors = new QTableWidget();
tblSensors->setStyleSheet("QTableWidget::item{ selection-background-color: rgb(255,255,255)}");
Codev
  • 1,040
  • 2
  • 14
  • 31