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. Does the QLabel use the parents StyleSheet for formatting its rich text (html subset)?
Forum Updated to NodeBB v4.3 + New Features

Does the QLabel use the parents StyleSheet for formatting its rich text (html subset)?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.6k Views 1 Watching
  • 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.
  • P Offline
    P Offline
    philk
    wrote on last edited by
    #1

    I have a label with this text
    @
    "<h1>Hello</h1>"
    @

    and on the labels parent window I have a stylesheet:
    @
    "h1 { font: 89px }"
    @

    However, the h1 style in the label is not affected by it. Any ideas?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      AFAIK the style sheet affects the widgets not it's content

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • P Offline
        P Offline
        philk
        wrote on last edited by
        #3

        I guessed something like that. I feel the whole css integration is not finished yet. too many places you still have to hardcode style values in c++ and cannot put everything in css.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Are you maybe mixing two different concepts ?
          You can reuse the widget's font when building your html content but styling a widget is clearly independent of the generated content (i.e the html you put in the label).

          Using a QSS is not the same as using a css to style a web page or html content, it's really only intended to modify the widget's appearance

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

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