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. problem in using QPainterPath class??

problem in using QPainterPath class??

Scheduled Pinned Locked Moved Unsolved General and Desktop
qpainterpathproblemextralines
5 Posts 2 Posters 1.8k 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.
  • S Offline
    S Offline
    stackprogramer
    wrote on 13 Feb 2016, 16:46 last edited by stackprogramer
    #1

    i use QPainterPath class, a part of my source is:

       case Conditional: { path.addRect(0,0,200, 200);
                  path.addRect(90,0,20,20);
                  path.addRect(0,90,20,20);
                  path.addRect(180,90,20,20);
                  path.addRect(90,180,20,20);
    
    
    
                   myPolygon = path.toFillPolygon();
        setPolygon(myPolygon);
    
    }
    
    

    but the image of shape is in below:
    http://www.mediafire.com/view/9e7jdvt3a5ek3rb/QPainterPathImages.png
    my question is why the internal line is created,i want to delete lines,i showed them in below images:
    http://www.mediafire.com/view/5p4fy1r6z6a3ycc/QPainterPathImages2.png
    please help me,thanks for reply.

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on 13 Feb 2016, 18:52 last edited by
      #2

      Hi! The documentation for toFillPolygon says:

      The polygon is created by first converting all subpaths to polygons, then using a rewinding technique to make sure that overlapping subpaths can be filled using the correct fill rule.
      Note that rewinding inserts addition lines in the polygon so the outline of the fill polygon does not match the outline of the path.

      S 1 Reply Last reply 14 Feb 2016, 06:43
      1
      • ? A Former User
        13 Feb 2016, 18:52

        Hi! The documentation for toFillPolygon says:

        The polygon is created by first converting all subpaths to polygons, then using a rewinding technique to make sure that overlapping subpaths can be filled using the correct fill rule.
        Note that rewinding inserts addition lines in the polygon so the outline of the fill polygon does not match the outline of the path.

        S Offline
        S Offline
        stackprogramer
        wrote on 14 Feb 2016, 06:43 last edited by
        #3

        hi @Wieland whats solution for me?how i can overcome this problem,thanks for reply

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on 14 Feb 2016, 13:11 last edited by
          #4

          Why do you convert the path to a filled polygon?

          S 1 Reply Last reply 14 Feb 2016, 20:23
          0
          • ? A Former User
            14 Feb 2016, 13:11

            Why do you convert the path to a filled polygon?

            S Offline
            S Offline
            stackprogramer
            wrote on 14 Feb 2016, 20:23 last edited by stackprogramer
            #5

            @Wieland it is example of Qt ,its name diagramscene thanks for reply

            1 Reply Last reply
            0

            1/5

            13 Feb 2016, 16:46

            • Login

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