Skip to content

Commit 8eaac98

Browse files
committed
Fixed #79: TypeError: unexpected type 'QSize'
1 parent 9d86be5 commit 8eaac98

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# PythonQwt Releases
22

3+
## Version 0.10.4
4+
5+
- [Issue #79](https://github.com/PlotPyStack/PythonQwt/issues/79) - TypeError: unexpected type 'QSize' (thanks to @luc-j-bourhis)
6+
37
## Version 0.10.3
48

59
- Moved project to the [PlotPyStack](https://github.com/PlotPyStack) organization.

qwt/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
.. _GitHub: https://github.com/PlotPyStack/PythonQwt
2828
"""
2929

30-
__version__ = "0.10.3"
30+
__version__ = "0.10.4"
3131
QWT_VERSION_STR = "6.1.5"
3232

3333
import warnings

qwt/plot_marker.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def drawLabel(self, painter, canvasRect, pos):
316316
alignPos.setX(canvasRect.center().x())
317317
else:
318318
if self.__data.symbol and self.__data.symbol.style() != QwtSymbol.NoSymbol:
319-
symbolOff = self.__data.symbol.size() + QSizeF(1, 1)
319+
symbolOff = QSizeF(self.__data.symbol.size()) + QSizeF(1, 1)
320320
symbolOff /= 2
321321
pw2 = self.__data.pen.widthF() / 2.0
322322
if pw2 == 0.0:

qwt/symbol.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1208,9 +1208,9 @@ def boundingRect(self):
12081208
pinPointTranslation = True
12091209
elif self.__data.style == QwtSymbol.Pixmap:
12101210
if self.__data.size.isEmpty():
1211-
rect.setSize(self.__data.pixmap.pixmap.size())
1211+
rect.setSize(QSizeF(self.__data.pixmap.pixmap.size()))
12121212
else:
1213-
rect.setSize(self.__data.size)
1213+
rect.setSize(QSizeF(self.__data.size))
12141214
pinPointTranslation = True
12151215
elif self.__data.style == QwtSymbol.Graphic:
12161216
rect = qwtScaleBoundingRect(self.__data.graphic.graphic, self.__data.size)
@@ -1227,7 +1227,7 @@ def boundingRect(self):
12271227
rect = transform.mapRect(rect)
12281228
pinPointTranslation = True
12291229
else:
1230-
rect.setSize(self.__data.size)
1230+
rect.setSize(QSizeF(self.__data.size))
12311231
rect.moveCenter(QPointF(0.0, 0.0))
12321232
if pinPointTranslation:
12331233
pinPoint = QPointF(0.0, 0.0)

0 commit comments

Comments
 (0)