NodeGraphQt icon indicating copy to clipboard operation
NodeGraphQt copied to clipboard

#244 QtPy libary migration

Open bakkiaraj opened this issue 3 years ago • 3 comments

Migrated code base to use QtPy libary than qt.py for Qt compatibility layer

bakkiaraj avatar Apr 18 '22 06:04 bakkiaraj

Hello there,

I did the same changes as you did. Trying to run the basic_example.py pops up the grid and then errors out the following

"c:\Users\nick_\Desktop\Nodes\NodeGraphQt\NodeGraphQt\qgraphics\node_group.py", line 98, in paint
rect_1.bottomLeft(), rect_2.bottomLeft()]) TypeError: index 0 has type 'QPointF' but 'QLineF' is expected

I did the following changes to get around it.

Replaced the following:

        painter.drawLines([rect_1.topRight(), rect_2.topRight(),
                            rect_1.topRight(), rect_1.bottomRight(),
                            rect_1.bottomRight(), rect_1.bottomLeft(),
                            rect_1.bottomLeft(), rect_2.bottomLeft()])`

with this

        painter.drawLine(rect_1.topRight(), rect_2.topRight())
        painter.drawLine(rect_1.topRight(), rect_1.bottomRight())
        painter.drawLine(rect_1.bottomRight(), rect_1.bottomLeft())
        painter.drawLine(rect_1.bottomLeft(), rect_2.bottomLeft())
     

nmathiou avatar Jun 03 '22 14:06 nmathiou

I had to do the same thing as @nmathiou

Willus8888 avatar Jul 05 '22 09:07 Willus8888

Strange. I think, possibility could be Qt Python bindings version. I tried today as well, OS: Ubuntu 22.04 but I did tried earlier in windows 10 PySide2 = PySide2-5.15.2.1-5.15.2-cp35.cp36.cp37.cp38.cp39.cp310-abi3-manylinux1_x86_64.whl Qt.py = Qt.py-1.3.7-py2.py3-none-any.whl

python /mnt/hgfs/Project_WA/Py_WA/NodeGraphQt/basic_example.py -> Just works from my forked branch. No additional changes.

Can you check again the PySide2 , Qt.py versions?

image

bakkiaraj avatar Jul 06 '22 11:07 bakkiaraj

Just wanted to drop by and say that I see the same issue as the couple of other users mentioned above on master and the corrections suggested work for me locally.

FWIW, I'm using pyqt5.15 with qt-py 1.3.7

JarrettSJohnson avatar Nov 08 '22 22:11 JarrettSJohnson

Sorry team at the moment I'm not planning to switch over to the QtPy library.

jchanvfx avatar Mar 13 '23 20:03 jchanvfx