T
T
Tian2018-05-25 22:45:22
Qt
Tian, 2018-05-25 22:45:22

Why is the style not being applied to QTableWidjet?

In the designer itself, everything looks good, but after compilation, the style does not work. Very strange for a newbie in QT, can someone explain? Thank you.
5b0867a851024343354169.jpeg
On the left is the compiled application, and on the right is the designer.
Of course, the style does not change anywhere in the code, and I tried to create a new project - the same thing.
The style code itself:
QHeaderView::section {
background-color: transparent;
color: #97A7BF;
font-size: 11px;
font-weight: bold;
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ighor July, 2018-05-25
@Tian

What if you ask it like that?

tableWidget->horizontalHeader()->setStyleSheet(styleSheet);
tableWidget->verticalHeader()->setStyleSheet(styleSheet);

PS: QTableWidget is slow, learn to use QTableView with models

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question