Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. CSS + QTableView/QHeaderView: font-weight ignored?

CSS + QTableView/QHeaderView: font-weight ignored?

Scheduled Pinned Locked Moved Solved General and Desktop
stylesheetqheaderviewqtableview
3 Posts 2 Posters 3.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    the_
    wrote on 4 Jul 2016, 08:18 last edited by the_ 7 Apr 2016, 08:23
    #1

    Hi all,

    As the title says...
    When selecting a table row the default behaviour is to set the vertical and horizontal header(s) to bold.

    My attempt was to force the font to be "normal" weight, but that did not work, but other properties could be set without problems using css.

    Example:

    QHeaderView::section:checked {font: 19px; color:blue;}
    QHeaderView::section {font: 19px; color:green;}
    

    works as expected and sets the text color to blue when clicking a row, green if not.

    Trying with

    QHeaderView::section:checked {font: normal 19px; color:blue;}
    QHeaderView::section {font: 19px; color:green;}
    

    does the same...
    screenshot
    Any ideas what I did wrong?

    -- No support in PM --

    R 1 Reply Last reply 4 Jul 2016, 08:41
    0
    • T the_
      4 Jul 2016, 08:18

      Hi all,

      As the title says...
      When selecting a table row the default behaviour is to set the vertical and horizontal header(s) to bold.

      My attempt was to force the font to be "normal" weight, but that did not work, but other properties could be set without problems using css.

      Example:

      QHeaderView::section:checked {font: 19px; color:blue;}
      QHeaderView::section {font: 19px; color:green;}
      

      works as expected and sets the text color to blue when clicking a row, green if not.

      Trying with

      QHeaderView::section:checked {font: normal 19px; color:blue;}
      QHeaderView::section {font: 19px; color:green;}
      

      does the same...
      screenshot
      Any ideas what I did wrong?

      R Offline
      R Offline
      raven-worx
      Moderators
      wrote on 4 Jul 2016, 08:41 last edited by
      #2

      @the_ said:

      Any ideas what I did wrong?

      probably nothing. Some stuff is simply overwritten by the QStyle implementation.
      i can't tell you for sure that this is the case here. Would have to step through QStyle methods to see what happens with the font during painting.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      T 1 Reply Last reply 4 Jul 2016, 09:46
      0
      • R raven-worx
        4 Jul 2016, 08:41

        @the_ said:

        Any ideas what I did wrong?

        probably nothing. Some stuff is simply overwritten by the QStyle implementation.
        i can't tell you for sure that this is the case here. Would have to step through QStyle methods to see what happens with the font during painting.

        T Offline
        T Offline
        the_
        wrote on 4 Jul 2016, 09:46 last edited by the_ 7 Apr 2016, 09:47
        #3

        @raven-worx
        Hi,

        thanks for your reply and information.
        Will mark it as "solved", as it is only a minor but interesting styling "issue" :)

        -- No support in PM --

        1 Reply Last reply
        0

        1/3

        4 Jul 2016, 08:18

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved