robertobucher / pysimCoder

Block diagram editor and real time code generator for Python
GNU General Public License v3.0
142 stars 31 forks source link

toolbox/supsisim/supsisim/block.py: paint method renders SVG properly #73

Closed zdebanos closed 5 months ago

zdebanos commented 5 months ago

Construct a QtSvg.QSvgRenderer inside the method and calculate the bounds to render the SVG properly instead of rendering bitmaps.

This commit also imports QtSvg from PyQt5. It must be tested whether compatibility won't be broken.

robertobucher commented 5 months ago

I have now this error (I'm investigating it) under PyQt6:

Traceback (most recent call last): File "/home/bucher/CACSD/pysimCoder/toolbox/supsisim/supsisim/block.py", line 124, in paint renderer.render(painter, where_to) TypeError: arguments did not match any overloaded call: render(self, p: Optional[QPainter]): argument 1 has unexpected type 'QPainter' render(self, p: Optional[QPainter], bounds: QRectF): argument 1 has unexpected type 'QPainter' render(self, painter: Optional[QPainter], elementId: Optional[str], bounds: QRectF = QRectF()): argument 1 has unexpected type 'QPainter'

robertobucher commented 5 months ago

Solved! The provided "block.py" worked only under pyQt5! Now the import of "QtSvg is moved in "qtvers.py"