pyqt / python-qt5

Unofficial PyQt5 via PyPI for Python 2.7 64-bit on Windows
GNU General Public License v3.0
280 stars 77 forks source link

stateChanged is not being called when moving PolyLineROI #53

Open TammeWollweber opened 4 years ago

TammeWollweber commented 4 years ago

I tried to print the new coordinates of the handles of a PolyLineROI when I drag it to a new positions. The signal sigRegionChangeFinished signal is emitted but the stateChanged function is not called such that the positions of the handles are not updated:

self.grid_box = pg.PolyLineROI(pos, closed=True, movable=True)
self.grid_box.sigRegionChangeFinished.connect(self._print_points)
self.refine_btn.setEnabled(True)
def _print_points(self):
     points_obj = self.grid_box.getState()['points']
     points = np.array([list((point[0], point[1])) for point in points_obj])
     print('Points: \n', points)

Points: [[2127.82468485 34.86386885] [2472.39864298 412.93394575] [ 552.62944768 469.88173976] [ 257.28034072 106.04861136]] Points: [[2127.82468485 34.86386885] [2472.39864298 412.93394575] [ 552.62944768 469.88173976] [ 257.28034072 106.04861136]]

If I move each handle independently the positions are updated correctly...

TammeWollweber commented 4 years ago

When this function is called manually, it raises Recursion Error: RecursionError: maximum recursion depth exceeded while calling a Python object