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. How to set a shadow effect for fonts?

How to set a shadow effect for fonts?

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 3.9k 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.
  • Qt_crazyerQ Offline
    Qt_crazyerQ Offline
    Qt_crazyer
    wrote on last edited by Qt_crazyer
    #1

    I want to set a shadow effect on my text, but I don't know how to achieve it. The text is on my QLabel.
    Thanks in advance!

    Y 1 Reply Last reply
    0
    • Qt_crazyerQ Qt_crazyer

      I want to set a shadow effect on my text, but I don't know how to achieve it. The text is on my QLabel.
      Thanks in advance!

      Y Offline
      Y Offline
      yugosonegi
      wrote on last edited by
      #2

      @Qt_crazyer Text where? On a QPainter, QLabel, where? :D

      1 Reply Last reply
      1
      • Qt_crazyerQ Offline
        Qt_crazyerQ Offline
        Qt_crazyer
        wrote on last edited by
        #3

        Sorry, I didn't say it clearly. It's on my QLabel.

        1 Reply Last reply
        0
        • Chris KawaC Offline
          Chris KawaC Offline
          Chris Kawa
          Lifetime Qt Champion
          wrote on last edited by
          #4

          For a label you could use a graphics effect:

          auto effect = new QGraphicsDropShadowEffect(label);
          label->setGraphicsEffect(effect);
          

          You can play around with the effect's properties like offset, color and blur radius.

          1 Reply Last reply
          2

          • Login

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