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. QPainter::drawStaticText text border

QPainter::drawStaticText text border

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

    Hi, is there a way do draw a text border with drawStaticText? I need rich text support and a font outline. Using QPainterPath is not an option, because it doesn't support rich text.

    Thanks

    1 Reply Last reply
    0
    • T Offline
      T Offline
      Tectu
      wrote on last edited by
      #2

      Just create a custom class that is derived from QGraphicsTextItem and implement a custom paint() method. Call the default paint() in it first and then simply draw a rectangle over/around it.

      ~ Tectu

      1 Reply Last reply
      0
      • L Offline
        L Offline
        levelxxl
        wrote on last edited by
        #3

        Thanks for the reply, but I think I didn't made clear what I'm searching for.

        I don't want a rectangle behind or around the text. I want a font outline.

        Like this:
        !https://dl.dropboxusercontent.com/u/20141415/Text_Border.png(Text Border)!

        Thanks

        1 Reply Last reply
        0
        • T Offline
          T Offline
          Tectu
          wrote on last edited by
          #4

          Oh sorry, no idea how to do that properly.

          Hopefully somebody else can help you.

          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