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. Applying text-shadow to a QLabel?
Forum Updated to NodeBB v4.3 + New Features

Applying text-shadow to a QLabel?

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

    Hello all,
    is there a way to add a drop-shadow to a text in a QLabel? I have tried using the "text-shadow" attribute in a label-specific style sheet

    @ FirstLabel->setStyleSheet("background-color: rgba(0, 0, 0, 50);"
    "text-shadow: 2px 2px #ff0000;");@

    but that didn't produce anything visible. Did I make an error, or do I have to go about it another way? How can I get shadowed text?

    I'm using Qt 5.2.1 on Ubuntu Linux 14.04 LTS.

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

      Hi and welcome to devnet,

      AFAIK text-shadow is not supported by QSS. However you can try with QGraphicsDropShadowEffect

      Hope it helps

      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