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. QGraphicsDropShadowEffect and Retina
Qt 6.11 is out! See what's new in the release blog

QGraphicsDropShadowEffect and Retina

Scheduled Pinned Locked Moved General and Desktop
11 Posts 2 Posters 5.2k 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.
  • R Offline
    R Offline
    rianquinn
    wrote on last edited by
    #1

    I need to create a label that is visible on both dark and light backgrounds. The normal trick to doing this is to add a drop shadow to your text. For example, the text might be black, so you add a white drop shadow. This allows the text to be visible regardless of the background.

    So.... I decided to use QGraphicsDropShadowEffect. The problem is, when I use this on a label, the text becomes fuzzy on my Mac (i.e. no Retina support). Looks fine on Windows and Linux because they do not have HDPI needs. How do I work around this? It looks absolutely terrible on a Mac.

    Any other tricks to create a shadow around the text that might not need QGraphicsDropShadowEffect? I am open to that too.

    P.S. When does Qt plan to fully support Retina?

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

      Hi and welcome to devnet,

      I don't have an answer to first question, that you should bring on the interest mailing list, you'll find Qt's developers/maintainers there (this forum is more user oriented)

      As for the second question, AFAIK, it's already supported on OS X and iOS, and currently in progress for the other platforms.

      By the way what version of Qt are you using ?

      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
      • R Offline
        R Offline
        rianquinn
        wrote on last edited by
        #3

        I am using 5.3, but its an issue with all of 5.X.

        Another issue that is really annoying, is that the @2x syntax doesn't work in the style sheets. So if you want to theme a widget, it becomes a real pain.

        They really need to think the syntax for HDPI because right now its very finicky. You do anything outside of the norm, and it all gets messed up.

        1 Reply Last reply
        0
        • R Offline
          R Offline
          rianquinn
          wrote on last edited by
          #4

          Ok, so I added a \ to the @ symbol which worked, so you can do that to get the style sheet to load the image, but that image is also fuzzy... even with the @2x. So my guess is there currently is no support for High-DPI images with the style sheets.

          Is there a way to style the widgets manually without having to use the style sheets... because if there is a way, it might be possible to correct the problem that way.

          This also leads me to believe that there is only partial support for High-DPI at the moment... would be nice to know when full support is planned.

          1 Reply Last reply
          0
          • R Offline
            R Offline
            rianquinn
            wrote on last edited by
            #5

            In case anyone else has this issue, I overloaded the QPainEvent for the widget I was trying to theme, did the drawing manually. It works fine that way, but its a lot of work. It would be great if the stylesheets just worked.

            I am going to look into how this would effect the text issue.

            1 Reply Last reply
            0
            • R Offline
              R Offline
              rianquinn
              wrote on last edited by
              #6

              It looks like drawing text also works. Not sure how I am going to manually do the outline yet, but I'm sure I will work out the logic.

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

                Support in the style sheet might indeed be missing it uses a custom QStyle which might not yet be HDPI aware. You should have a look at the "bug report system":http://bugreports.qt-project.org to see if there's already something related. If not you should consider opening a report or feature request for that matter.

                For the discussion related to the HDPI support for all platforms you can have a look at the development mailing list archive from this month.

                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
                • R Offline
                  R Offline
                  rianquinn
                  wrote on last edited by
                  #8

                  Awesome. I just sent out something to the mailing list about this, and I will look at the bug reports.

                  Thanks for the advice.

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

                    Did you register first before sending the email ?

                    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
                    • R Offline
                      R Offline
                      rianquinn
                      wrote on last edited by
                      #10

                      no, so it's being held for review.

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

                        IIRC, you can cancel that one, register and re-send the mail

                        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