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. Special QGradient

Special QGradient

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

    I have a circle shape that I want to color/fill with a gradients. The center of the circle should be dark, and how further out you move in circle, the lighter the color gets (something like the sun - dark in the middle, and lighter outside).

    The gradients available are LinearGradient, RadialGradient, ConicalGradient.
    But I can't get it right to use these gradients for my purpose.

    Any idea?

    1 Reply Last reply
    0
    • ? This user is from outside of this forum
      ? This user is from outside of this forum
      Guest
      wrote on last edited by
      #2

      it can be done with the radial gradient with the default pad spread. you can play with the gradient demo that is available with Qt installation and chk this out.

      set the focal points to the center, select pad spread and set the correct stop points .. you will get exactly what you've described above

      1 Reply Last reply
      0
      • ? This user is from outside of this forum
        ? This user is from outside of this forum
        Guest
        wrote on last edited by
        #3

        for your widget you can set a stylesheet like this ...

        @
        background: qradialgradient(cx:0.5, cy:0.5, radius: 1.0,
        fx:0.5, fy:0.5, stop:0 red, stop:1 white)
        @

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goocreations
          wrote on last edited by
          #4

          Thank you very much, I will try that.

          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