magic-class icon indicating copy to clipboard operation
magic-class copied to clipboard

move_to_center failing in certain cases

Open tlambert03 opened this issue 3 years ago • 2 comments

just a heads up. the recent move_to_center commit is failing in certain cases (seen in magicgui tests)... will remove the magic-class tests for now:

platform linux -- Python 3.10.6, pytest-7.1.3, pluggy-1.0.0 -- /opt/hostedtoolcache/Python/3.10.6/x64/bin/python
[22](https://github.com/napari/magicgui/actions/runs/3077835365/jobs/4972976813#step:7:23)
cachedir: .pytest_cache
[23](https://github.com/napari/magicgui/actions/runs/3077835365/jobs/4972976813#step:7:24)
PyQt5 5.15.7 -- Qt runtime 5.15.2 -- Qt compiled 5.15.2

_______________________________ test_progressbar _______________________________
[163](https://github.com/napari/magicgui/actions/runs/3077835365/jobs/4972976813#step:7:164)
CALL ERROR: Exceptions caught in Qt event loop:
[164](https://github.com/napari/magicgui/actions/runs/3077835365/jobs/4972976813#step:7:165)
________________________________________________________________________________
[165](https://github.com/napari/magicgui/actions/runs/3077835365/jobs/4972976813#step:7:166)
Traceback (most recent call last):
[166](https://github.com/napari/magicgui/actions/runs/3077835365/jobs/4972976813#step:7:167)
  File "/home/runner/work/magicgui/magicgui/magic-class/magicclass/utils/qthreading.py", line 793, in init_pbar
[167](https://github.com/napari/magicgui/actions/runs/3077835365/jobs/4972976813#step:7:168)
    pbar.show()
[168](https://github.com/napari/magicgui/actions/runs/3077835365/jobs/4972976813#step:7:169)
  File "/home/runner/work/magicgui/magicgui/magic-class/magicclass/utils/qthreading.py", line 330, in show
[169](https://github.com/napari/magicgui/actions/runs/3077835365/jobs/4972976813#step:7:170)
    move_to_screen_center(self._CONTAINER)
[170](https://github.com/napari/magicgui/actions/runs/3077835365/jobs/4972976813#step:7:171)
  File "/home/runner/work/magicgui/magicgui/magic-class/magicclass/utils/qt.py", line 77, in move_to_screen_center
[171](https://github.com/napari/magicgui/actions/runs/3077835365/jobs/4972976813#step:7:172)
    qwidget.move(screen_center() - qwidget.rect().center())
[172](https://github.com/napari/magicgui/actions/runs/3077835365/jobs/4972976813#step:7:173)
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/site-packages/magicgui/widgets/_bases/container_widget.py", line 88, in __getattr__
[173](https://github.com/napari/magicgui/actions/runs/3077835365/jobs/4972976813#step:7:174)
    return object.__getattribute__(self, name)
[174](https://github.com/napari/magicgui/actions/runs/3077835365/jobs/4972976813#step:7:175)
AttributeError: 'ScrollableContainer' object has no attribute 'move'
[175](https://github.com/napari/magicgui/actions/runs/3077835365/jobs/4972976813#step:7:176)
________________________________________________________________________________
[176](https://github.com/napari/magicgui/actions/runs/3077835365/jobs/4972976813#step:7:177)
----------------------------- Captured stderr call -----------------------------
[177](https://github.com/napari/magicgui/actions/runs/3077835365/jobs/4972976813#step:7:178)
Exceptions caught in Qt event loop:
[178](https://github.com/napari/magicgui/actions/runs/3077835365/jobs/4972976813#step:7:179)
________________________________________________________________________________
[179](https://github.com/napari/magicgui/actions/runs/3077835365/jobs/4972976813#step:7:180)
Traceback (most recent call last):
[180](https://github.com/napari/magicgui/actions/runs/3077835365/jobs/4972976813#step:7:181)
  File "/home/runner/work/magicgui/magicgui/magic-class/magicclass/utils/qthreading.py", line 793, in init_pbar
[181](https://github.com/napari/magicgui/actions/runs/3077835365/jobs/4972976813#step:7:182)
    pbar.show()
[182](https://github.com/napari/magicgui/actions/runs/3077835365/jobs/4972976813#step:7:183)
  File "/home/runner/work/magicgui/magicgui/magic-class/magicclass/utils/qthreading.py", line 330, in show
[183](https://github.com/napari/magicgui/actions/runs/3077835365/jobs/4972976813#step:7:184)
    move_to_screen_center(self._CONTAINER)
[184](https://github.com/napari/magicgui/actions/runs/3077835365/jobs/4972976813#step:7:185)
  File "/home/runner/work/magicgui/magicgui/magic-class/magicclass/utils/qt.py", line 77, in move_to_screen_center
[185](https://github.com/napari/magicgui/actions/runs/3077835365/jobs/4972976813#step:7:186)
    qwidget.move(screen_center() - qwidget.rect().center())
[186](https://github.com/napari/magicgui/actions/runs/3077835365/jobs/4972976813#step:7:187)
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/site-packages/magicgui/widgets/_bases/container_widget.py", line 88, in __getattr__
[187](https://github.com/napari/magicgui/actions/runs/3077835365/jobs/4972976813#step:7:188)
    return object.__getattribute__(self, name)
[188](https://github.com/napari/magicgui/actions/runs/3077835365/jobs/4972976813#step:7:189)
AttributeError: 'ScrollableContainer' object has no attribute 'move'

tlambert03 avatar Sep 18 '22 16:09 tlambert03

Hi @tlambert03 , I'm so sorry, I fixed it just now...

hanjinliu avatar Sep 19 '22 00:09 hanjinliu

No worries and no need to be sorry! Just a courtesy notification :) thanks!

tlambert03 avatar Sep 19 '22 00:09 tlambert03