Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Text decoration color in Qt Style Sheet



  • I want my QLabel text to be crossed off with line-through text decoration in QStyleSheet but I want the line to be colored.
    Simple text-decoration-color does not work in QTStyleSheets. Is there any way to color text-decoration in Qt?


  • Lifetime Qt Champion

    Hi and Welcome to the forums.
    As far as I know its not possible with stylesheets as text-decoration-color or
    text-decoration-xxxx is not support currently. its based loosely on CSS3 but
    its not a goal to follow it.

    Can I ask the exact use case as it would be quite easy to make a custom label that can have line-through
    one line of text if the goal is just that.

    ONE LINE OF TEXT
    where you can set the color.


Log in to reply