Issue
I used this to set the style for my QTableWidget
. Everything in the table is affected except the horizontalheaderlabels
and the row numbers
.
Table.setStyleSheet("Background-color:rgb(100,100,100);border-radius:15px;")
So I tried this
Table.horizontalHeader().setStyleSheet("Background-color:rgb(190,1,1);border-radius:14px;"
But this doesn't seems to have any affect.
How do i set the style sheet for horizontalheaderlabel
and the row numbers
?
Solution
You should check Qt Sylesheet Reference
You have to do something like
stylesheet = "::section{Background-color:rgb(190,1,1);border-radius:14px;}"
Table.horizontalHeader().setStyleSheet(stylesheet)
That is if you want different horizontal and vertical headers. Otherwise, this should do the job
stylesheet = "QHeaderView::section{Background-color:rgb(190,1,1);
border-radius:14px;}"
Table.setStyleSheet(stylesheet)
Answered By - Yoann Quenach de Quivillic
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.