161 xB = rectB.x() + rectB.width() / 2.0 |
161 xB = rectB.x() + rectB.width() / 2.0 |
162 yB = rectB.y() + rectB.height() / 2.0 |
162 yB = rectB.y() + rectB.height() / 2.0 |
163 |
163 |
164 # find itemA region |
164 # find itemA region |
165 rc = QRectF(xA, yA, rectA.width(), rectA.height()) |
165 rc = QRectF(xA, yA, rectA.width(), rectA.height()) |
166 oldRegionA = self.regionA |
|
167 self.regionA = self.__findPointRegion(rc, xB, yB) |
166 self.regionA = self.__findPointRegion(rc, xB, yB) |
168 # move some regions to the standard ones |
167 # move some regions to the standard ones |
169 if self.regionA == NorthWest: |
168 if self.regionA == NorthWest: |
170 self.regionA = North |
169 self.regionA = North |
171 elif self.regionA == NorthEast: |
170 elif self.regionA == NorthEast: |
179 |
178 |
180 self.__updateEndPoint(self.regionA, True) |
179 self.__updateEndPoint(self.regionA, True) |
181 |
180 |
182 # now do the same for itemB |
181 # now do the same for itemB |
183 rc = QRectF(xB, yB, rectB.width(), rectB.height()) |
182 rc = QRectF(xB, yB, rectB.width(), rectB.height()) |
184 oldRegionB = self.regionB |
|
185 self.regionB = self.__findPointRegion(rc, xA, yA) |
183 self.regionB = self.__findPointRegion(rc, xA, yA) |
186 # move some regions to the standard ones |
184 # move some regions to the standard ones |
187 if self.regionB == NorthWest: |
185 if self.regionB == NorthWest: |
188 self.regionB = North |
186 self.regionB = North |
189 elif self.regionB == NorthEast: |
187 elif self.regionB == NorthEast: |