Important: Please read the Qt Code of Conduct -

QTableWidget headerview stylesheet

  • Hello!!

    I have a little doubt about the QTableWidget stylesheet. I want to set a qlinergradient background color for the header but not for each section, I want it for all header.

    I have this:


    with this code:

    QTableView QHeaderView::section {
        background: qlineargradient(...);

    and I need this:


    How can I do it? Thank you very much!

  • Lifetime Qt Champion


    You should add the Qt version you are using, the OS you are running your application on as well as a minimal compilable example that shows this behaviour.

Log in to reply