[PySide] QAbstractTableModel headerData() Qt.BackgroundRole - Ignored?

Ed Lipson edlipsongm at gmail.com
Fri Apr 9 21:43:46 CEST 2021


Then why would there be a background role call to the headerData method?
I'll give the stylesheet a try. Maybe I can understand it.

Thanks,
Ed


On Fri, Apr 9, 2021 at 8:04 AM Hans Jörg Maurer <hjm at pmeonline.net> wrote:

> I think you have to use
>
> .setStyleSheet(QHeaderView:section{background - color: green})
> Take a look at https://doc.qt.io/archives/qt-5.9/stylesheet.html
>
> Regards
> Hans
>
>
>
> Am Freitag, den 09.04.2021 um 13:29 schrieb Ed Lipson:
>
> How would one set the background color of the QTableView (QtHorizontal
> orientation) header? I have tried the 'mail title' action, where I see the
> role being used. I just don't get the color.
>
> I used the same concept in data() and the cells take on the background
> color as appropriate for the state.
>
> PySide2 5.15.2 Python3.9.1
>
> Thanks,
> Ed
>
> PS: Where is it appropriate to ask such questions? JIRA does not have a
> question type defined and doing it there may be too much noise in the bug
> tracking system.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20210409/562b0805/attachment.html>


More information about the PySide mailing list