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 use the outline option in stylesheet?
Qt 6.11 is out! See what's new in the release blog

How to use the outline option in stylesheet?

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 2.6k Views 2 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.
  • N Offline
    N Offline
    n34rt
    wrote on last edited by
    #1

    I tried this:

    border-image: url(:/tv.png);
    outline-color: rgb(0, 255, 255);
    outline-style: solid;
    

    But nothing were drawn into the image. I tested on a QWidget.

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

      Outline is a weird one. Seems to be only used by buttons to indicate focus.

      1 Reply Last reply
      1
      • Axel SpoerlA Offline
        Axel SpoerlA Offline
        Axel Spoerl
        Moderators
        wrote on last edited by
        #3

        What exactly is the problem?
        The missing image or the missing frame around it?

        Software Engineer
        The Qt Company, Oslo

        N 1 Reply Last reply
        0
        • Axel SpoerlA Axel Spoerl

          What exactly is the problem?
          The missing image or the missing frame around it?

          N Offline
          N Offline
          n34rt
          wrote on last edited by
          #4

          @Axel-Spoerl missing frame, only the image is painted, the outline dont.

          1 Reply Last reply
          0
          • Axel SpoerlA Offline
            Axel SpoerlA Offline
            Axel Spoerl
            Moderators
            wrote on last edited by
            #5

            Ah. You initially said that „nothing were drawn into the image“….
            A style sheet is meant to design existing elements of a widget, not to create such elements. In your case, a QWidget doesn’t have a frame. So the outline property is ignored. A QFrame or a QPushButton has such elements and thus reacts to outline styling.

            Software Engineer
            The Qt Company, Oslo

            1 Reply Last reply
            3

            • Login

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