Skip to content

Commit 1bb6702

Browse files
committed
Improved Qt universal support (PyQt5, PySide2, ...)
# Conflicts: # qwt/plot.py
1 parent 9c265a4 commit 1bb6702

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

qwt/legend.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -641,8 +641,8 @@ class QwtLegend(QwtAbstractLegend):
641641
Clicks are disabled as default
642642
"""
643643

644-
clicked = Signal("PyQt_PyObject", int)
645-
checked = Signal("PyQt_PyObject", bool, int)
644+
clicked = Signal(object, int)
645+
checked = Signal(object, bool, int)
646646

647647
def __init__(self, parent=None):
648648
QwtAbstractLegend.__init__(self, parent)

qwt/plot.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
QPainter,
2929
QPalette,
3030
QColor,
31+
QBrush,
3132
)
3233
from .qt.QtCore import Qt, Signal, QEvent, QSize, QRectF
3334

@@ -275,8 +276,8 @@ class QwtPlot(QFrame, QwtPlotDict):
275276
276277
"""
277278

278-
itemAttached = Signal("PyQt_PyObject", bool)
279-
legendDataChanged = Signal("PyQt_PyObject", "PyQt_PyObject")
279+
itemAttached = Signal(object, bool)
280+
legendDataChanged = Signal(object, object)
280281

281282
# enum Axis
282283
AXES = yLeft, yRight, xBottom, xTop = list(range(4))
@@ -1516,7 +1517,7 @@ def setCanvasBackground(self, brush):
15161517
:py:meth:`canvasBackground()`
15171518
"""
15181519
pal = self.__data.canvas.palette()
1519-
pal.setBrush(QPalette.Window, brush)
1520+
pal.setBrush(QPalette.Window, QBrush(brush))
15201521
self.canvas().setPalette(pal)
15211522

15221523
def canvasBackground(self):

qwt/plot_grid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def make(
100100
if z is not None:
101101
item.setZ(z)
102102
color = qcolor_from_str(color, Qt.gray)
103-
width = 1.0 if width is None else width
103+
width = 1.0 if width is None else float(width)
104104
style = Qt.DotLine if style is None else style
105105
item.setPen(QPen(color, width, style))
106106
if mincolor is not None or minwidth is not None or minstyle is not None:

qwt/tests/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def add_test(self, fname):
150150
button.setText(bname)
151151
button.setToolTip(fname)
152152
button.setIconSize(QSize(130, 80))
153-
button.clicked.connect(lambda checked, fname=fname: run_test(fname))
153+
button.clicked.connect(lambda checked=None, fname=fname: run_test(fname))
154154
self.grid_layout.addWidget(button, row, column)
155155

156156
def about(self):

0 commit comments

Comments
 (0)