I am developing an app in which I am using QTableWidgets, and I need to set its background transparent, I have tried to setStyleSheet "background:transparent;"
from form, but nothing happened, is there any other way to do it? I am posting a screenshot
You're on the right track. Try:
setStyleSheet("QTableWidget {background-color: transparent;}"
"QHeaderView::section {background-color: transparent;}"
"QHeaderView {background-color: transparent;}"
"QTableCornerButton::section {background-color: transparent;}");
QTableWidget *table = new QTableWidget(latticeView);
table->setRowCount(2);
table->setColumnCount(2);
Note that I'm setting the style sheet before creating the table widget. I don't know why, but that seems to be necessary.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With