How to make background of cell widget inside QTableWidget not selectable?

Codev

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

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)}");

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Flutter how to make a selectable / focusable widget

How to make text selectable on a QListView custom widget?

Java. How to make Jtable specific cell not selectable?

How to put a TextEdit inside a cell in QTableWidget - Pyqt5?

How to make textflow selectable

How to make a grid inside a cell?

Cell is not selectable embed UItableView inside main View?

How to make a widget inside a widget transparent so that the third widget is visible

Make JTable cell editor value be selectable, but not editable?

How to make invisible button on widget with background image?

How to set a background color for a widget inside a main widget in Flutter?

How can I make the leading flutter date icon clickable and selectable widget?

How to get the row number of widget placed in a cell of Qtablewidget when it get clicked?

How to automatically make a calculation in a cell in the same row using the data of another cell that is changed in QtableWidget?

How to make disabled TextBoxes selectable?

How to make label selectable with pug?

How to make text in QTextBrowser selectable?

Get state from QCheckBox inside QTableWidget cell

How to select a cell in QTableWidget programmatically

Flutter How to set any widget selectable

How to connect a QRadioButton of a QTableWidget cell with another QTableWidget cell using an arrow?

How to change background color of selected or clicked cell in a pyqt5 QTableWidget?

pyqt5 qtablewidget cell background while editing cell

how do I make selectable or not selectable a kendo grid by a button

get row index of signal sender emitted from cell widget in QTableWidget

Retrieving parent QTableWidget from its cell widget item

QTableWidget's cell widget not displaying correctly when last row deleted

How do i make background images in container widget change in flutter

How to make list item selectable in Input Tag