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 clip QPainterPath/QRect, hiding the outline?
Forum Updated to NodeBB v4.3 + New Features

How to clip QPainterPath/QRect, hiding the outline?

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

    Is there a way to clip one painter object by overlaying it with another object, hiding the outline as well as the fill area? If you render text in QPainter then it gets clipped by the bounding box. Is there a way to do the same with the shapes or paths? Something similar to Photoshop clipping mask.

    raven-worxR 1 Reply Last reply
    0
    • P ptitz

      Is there a way to clip one painter object by overlaying it with another object, hiding the outline as well as the fill area? If you render text in QPainter then it gets clipped by the bounding box. Is there a way to do the same with the shapes or paths? Something similar to Photoshop clipping mask.

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @ptitz
      QPainter::setClipRegion()

      A QRegion can be constructed from a QPolygon (which can be created from a QPainterPath) for example.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      P 1 Reply Last reply
      1
      • raven-worxR raven-worx

        @ptitz
        QPainter::setClipRegion()

        A QRegion can be constructed from a QPolygon (which can be created from a QPainterPath) for example.

        P Offline
        P Offline
        ptitz
        wrote on last edited by
        #3

        @raven-worx Super, thanks a lot! I've been looking all over docs for shape objects to find this this thing, but couldn't find it. Didn't think about looking at the QPainter.

        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