Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. [BUG] Some styles does not work (background-color, background-image)
QtWS25 Last Chance

[BUG] Some styles does not work (background-color, background-image)

Scheduled Pinned Locked Moved QML and Qt Quick
7 Posts 2 Posters 1.5k 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.
  • Q Offline
    Q Offline
    QtYury
    wrote on last edited by
    #1

    Works:
    @
    Label {
    text: "<span style="color: red">Del</span>"
    textFormat: Text.RichText
    }
    @

    Does not work:
    @
    Label {
    text: "<span style="background-color: red">Del</span>"
    textFormat: Text.RichText
    }
    @
    @
    Label {
    text: "<span style="background-image: some_url">Del</span>"
    textFormat: Text.RichText
    }
    @

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      Hi,

      This is a bug. See "QTBUG-34219":https://bugreports.qt-project.org/browse/QTBUG-34219

      157

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        QtYury
        wrote on last edited by
        #3

        Thanks, p3c0! Are there any workarounds?

        1 Reply Last reply
        0
        • p3c0P Offline
          p3c0P Offline
          p3c0
          Moderators
          wrote on last edited by
          #4

          You could use a Rectangle and Image elements and place it behind the Text and setting width and height of those to that of Text element.

          157

          1 Reply Last reply
          0
          • Q Offline
            Q Offline
            QtYury
            wrote on last edited by
            #5

            border-color and border-style don't work too
            @
            Label {
            text: "<span style="border-color:red; border-style:solid">Del</span>"
            textFormat: Text.RichText
            }
            @

            1 Reply Last reply
            0
            • p3c0P Offline
              p3c0P Offline
              p3c0
              Moderators
              wrote on last edited by
              #6

              Yes I think "many of these":https://qt-project.org/doc/qt-5/richtext-html-subset.html#css-properties may not be working.

              157

              1 Reply Last reply
              0
              • Q Offline
                Q Offline
                QtYury
                wrote on last edited by
                #7

                Please vote for bug "QTBUG-34219":https://bugreports.qt-project.org/browse/QTBUG-34219. Thanks!

                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