gam17 / QAD

Quantum Aided Design - cad tools plugin for QGIS
GNU General Public License v3.0
27 stars 13 forks source link

TypeError: arguments did not match any overloaded call: fillRect #84

Closed reenberg closed 2 weeks ago

reenberg commented 4 weeks ago

When using the various commands, i get the following messages in the Log Messages windows.

Python version: 3.11.9 (main, Nov 10 2011, 15:00:00) [GCC 13.2.0] QGIS version: 3.38.1-Grenoble Grenoble, exported

I am using QGIS installed as a Flatpak, in Fedora linux.

I tried installing the plugin from the plugin manager, which failed. I read that you had suggested to load it as a zip straight from Github, so I also did that. The below errors is when loading it as a zip as of yesterday.

Messages:

2024-08-13T12:06:22     WARNING    Python error : An error has occurred while executing Python code: See message log (Python Error) for more details.

Python Error:

2024-08-13T12:06:22     WARNING    Traceback (most recent call last):
              File "/var/home/user/.var/app/org.qgis.qgis/data/QGIS/QGIS3/profiles/default/python/plugins/QAD-master/qad_grip.py", line 130, in paint
              painter.fillRect(-self.iconSize, -self.iconSize / 2, self.iconSize * 2, self.iconSize, QBrush(QColor(self.fillColor)));
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
             TypeError: arguments did not match any overloaded call:
              fillRect(self, a0: QRectF, a1: Union[QBrush, Union[QColor, Qt.GlobalColor], QGradient]): argument 1 has unexpected type 'int'
              fillRect(self, a0: QRect, a1: Union[QBrush, Union[QColor, Qt.GlobalColor], QGradient]): argument 1 has unexpected type 'int'
              fillRect(self, x: int, y: int, w: int, h: int, b: Union[QBrush, Union[QColor, Qt.GlobalColor], QGradient]): argument 2 has unexpected type 'float'
              fillRect(self, a0: QRectF, color: Union[QColor, Qt.GlobalColor]): argument 1 has unexpected type 'int'
              fillRect(self, a0: QRect, color: Union[QColor, Qt.GlobalColor]): argument 1 has unexpected type 'int'
              fillRect(self, x: int, y: int, w: int, h: int, b: Union[QColor, Qt.GlobalColor]): argument 2 has unexpected type 'float'
              fillRect(self, x: int, y: int, w: int, h: int, c: Qt.GlobalColor): argument 2 has unexpected type 'float'
              fillRect(self, r: QRect, c: Qt.GlobalColor): argument 1 has unexpected type 'int'
              fillRect(self, r: QRectF, c: Qt.GlobalColor): argument 1 has unexpected type 'int'
              fillRect(self, x: int, y: int, w: int, h: int, style: Qt.BrushStyle): argument 2 has unexpected type 'float'
              fillRect(self, r: QRect, style: Qt.BrushStyle): argument 1 has unexpected type 'int'
              fillRect(self, r: QRectF, style: Qt.BrushStyle): argument 1 has unexpected type 'int'
              fillRect(self, x: int, y: int, w: int, h: int, preset: QGradient.Preset): argument 2 has unexpected type 'float'
              fillRect(self, r: QRect, preset: QGradient.Preset): argument 1 has unexpected type 'int'
              fillRect(self, r: QRectF, preset: QGradient.Preset): argument 1 has unexpected type 'int'

... repeated multiple times.

2024-08-13T12:07:55     WARNING    Message log truncated

It generally seems to happen when selecting a polygon, where QAD then colours it yellow.

reenberg commented 4 weeks ago

Sometimes the Python error shows as a popup, instead of in the log window. When this happens, you have to click cancel a few "hundreds" times before you can use QGIS again. In this case it becomes unusable, and sometimes it is faster to just kill QGIS and start over.

gam17 commented 2 weeks ago

Hi, can you test the last github version (download the zip file) ? let me know if it solves... gam17

reenberg commented 2 weeks ago

From my initial testing, it would seem that I now only get all the deprecation warnings. Thanks.