<div dir="ltr"><div>See the documentation.<br></div><div><a href="https://doc.qt.io/qt-5/stylesheet-reference.html#qheaderview-widget">https://doc.qt.io/qt-5/stylesheet-reference.html#qheaderview-widget</a></div><div><a href="https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qheaderview">https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qheaderview</a><br><br></div><div>Note that you may prefer to set a proper QPalette on the tablewidget (or the window, or the whole app), which would be more accurate, even though it may not work on some styles.<br></div><div>In any case, consider the following roles:</div><div>- Window and Button for "widget background" (scroll bars, header background, etc.);<br></div><div>- WindowText and ButtonText for the foreground/text color of the above;<br></div><div>- Base for the view's background (and AlternateBase if you use alternate row colors); it normally is white-ish;<br></div><div>- Text for the view text colors; it normally is dark/black;</div><div><br></div><div>Remember that stylesheets are not compatible with custom palettes (they completely override the widget palette), but *can* be used together with proper awareness.</div><div><br></div><div>Cheers,<br></div><div>Maurizio<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno gio 4 lug 2024 alle ore 18:12 Luca Bertolotti <<a href="mailto:luca72.bertolotti@gmail.com">luca72.bertolotti@gmail.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello i change some colors in my tablewidget in this way:<div> self.tableWidget_2.setStyleSheet(".QTableWidget#tableWidget_2 {background-color: rgb(0, 0, 0); gridline-color: rgb(255, 255, 255); color: rgb(255, 255, 255);}")<br></div><div><br></div><div>there is a way to change the color of the header text because the default color is the one of the main form text ( white because the background color is black) so I don't see the header text</div><div><br></div><div>I don't know how to change the header color or how to make all the table black</div><div><br></div><div>Thanks</div><div>Luca</div></div>
</blockquote></div><br clear="all"><br><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature">È difficile avere una convinzione precisa quando si parla delle ragioni del cuore. - "Sostiene Pereira", Antonio Tabucchi<br><a href="http://www.jidesk.net" target="_blank">http://www.jidesk.net</a></div>