简体   繁体   中英

QHeaderView::section:selected

I have following style segment applied to QHeaderView

QHeaderView::section:selected
    {
        padding-left: 16px;
        background-color: #1c1c1c;
    }

for some reason "selected" Pseudo-State for QHeaderView is not working but in the documentation it says it should work. I have tried following and it works:

QHeaderView::section:first
{
    padding-left: 16px;
    background-color: #1c1c1c;
}

My question is, how can apply a different style for the selected Header TIA

It is a bug on Qt4.7. It affects to QHeaderView::section:checked too. You can see:

If you are using Qt4.7 you can try to upgrade to a newer version. Maybe the bug has been fixed in recent versions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM