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. QLabel: outline text (stroke)
Forum Updated to NodeBB v4.3 + New Features

QLabel: outline text (stroke)

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

    Not sure which keyword is correct, but I am wondering if it is possible to outline the text of a QLabel.
    Something like this:
    !http://pix.wefrag.com/i/4/2/b/8/f/46161f2a7347485e948e5bc1eacefd10.png(outline)!
    Thanks for your help!

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jake007
      wrote on last edited by
      #2

      Hi!

      Everything is possible ;-).

      There would be a way whith CSS, if Qt would supported it ( or any browser)
      @text-outline: 1px 1px #F00;@
      Or, not the ideal solution, but would also work
      @text-shadow: 0 0 3px #F00;@

      Because neither is possible, you will probably need to bake two images, and show it as one.
      You can also try showing two labels one over another, with different font settings.
      Also, another option would be ( at which I didn't succeed), using html and css to add one text over another.


      Code is poetry

      1 Reply Last reply
      0
      • J Offline
        J Offline
        JulienMaille
        wrote on last edited by
        #3

        So I guess by "everything is possible" you mean that this particular case is not?

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mlong
          wrote on last edited by
          #4

          Everything is possible, but not everything is possible right out of the box. There's generally some way to accomplish something, but it might not be clean, easy, or pretty.

          Software Engineer
          My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

          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