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. Create only outside path using QPainterPathStroker
Forum Updated to NodeBB v4.3 + New Features

Create only outside path using QPainterPathStroker

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

    I have a triangle outline. I need to implement a logic where some QGraphicsItem lying outside the triangle within some range is allowed to rotate. QPainterPathStroker draws a path inside and outside the boundary of triangle. Is there any way to just construct the outside path?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      AFAIK, you can't do with default items. You'll have build it yourself to add support for only painting the outline.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • D Offline
        D Offline
        djasmine
        wrote on last edited by
        #3

        Thanks for the quick reply..
        I also tried using QPainterPath .conatins API to identify if a given point lies within the closed shape but no success. Can you guide as how to figure out if a given point just lies within the shape() or say the opposite that a given point lies outside or on the shape() ?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Take a look at the sources of QPainterPathStroker. That should give you a good overview on how to do it.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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