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. QQuickPaintedItem gradients do not align

QQuickPaintedItem gradients do not align

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 322 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.
  • M Offline
    M Offline
    M.Steinhilber
    wrote on last edited by M.Steinhilber
    #1

    Hello.
    I'm currently creating a custom item for QML. In order to do so I use a QQuickPaintedItem. To draw the background of my item I want to use 2 linear gradients and one radial to get a half circle open to the right. Please see the attached image for reference.

    The problem I have is that although the base points for the gradients are the same (All start at half hight and end at the outside border), the bottom of the radial and bottom linear gradients do not line up at all heights. At many heights I get an offset at the bottom like seen in the image. The top works fine though everytime and at any resolution.

    Can anybody tell me if I do something wrong or if this a bug? I tried a lot of different things (like offsets if height is odd/even) but I didn't find a way, where it works with all resolutions.

    I'm using Qt 5.8 on Windows 10. The QQuickPaintItem is using QImage render target.

    The code of a small sample program can be found here.

    Image

    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