python - How to add a linear gradient to a QTableWidget? - Stack Overflow

admin2025-04-30  0

self.ui.tbl_temperatur.setStyleSheet("background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #fbf9e3, stop: 1 #E2FCF8);")

it shouldn't be like that

The gradient repeats itself in each cell. but it should be the background for the entire QTableWidget without repeating itself:

the goal:

How can I implement this?

Unfortunately, using a style.css doesn't bring any success either:

QTableWidget#tbl_temperatur{ background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #fbf9e3, stop: 1 #E2FCF8); }

转载请注明原文地址:http://www.anycun.com/QandA/1746023658a91486.html