Skip to content

Commit a149f0e

Browse files
committed
Improved Qt universal support (PyQt5, PySide2, ...)
1 parent b8e570f commit a149f0e

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

qwt/legend.py

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

642-
clicked = Signal("PyQt_PyObject", int)
643-
checked = Signal("PyQt_PyObject", bool, int)
642+
clicked = Signal(object, int)
643+
checked = Signal(object, bool, int)
644644

645645
def __init__(self, parent=None):
646646
QwtAbstractLegend.__init__(self, parent)

qwt/plot.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
QFrame,
2626
QApplication,
2727
)
28-
from qtpy.QtGui import QFont, QPainter, QPalette, QColor
28+
from qtpy.QtGui import QFont, QPainter, QPalette, QColor, QBrush
2929
from qtpy.QtCore import Qt, Signal, QEvent, QSize, QRectF
3030

3131
from qwt.text import QwtText, QwtTextLabel
@@ -272,8 +272,8 @@ class QwtPlot(QFrame, QwtPlotDict):
272272
273273
"""
274274

275-
itemAttached = Signal("PyQt_PyObject", bool)
276-
legendDataChanged = Signal("PyQt_PyObject", "PyQt_PyObject")
275+
itemAttached = Signal(object, bool)
276+
legendDataChanged = Signal(object, object)
277277

278278
# enum Axis
279279
AXES = yLeft, yRight, xBottom, xTop = list(range(4))
@@ -1513,7 +1513,7 @@ def setCanvasBackground(self, brush):
15131513
:py:meth:`canvasBackground()`
15141514
"""
15151515
pal = self.__data.canvas.palette()
1516-
pal.setBrush(QPalette.Window, brush)
1516+
pal.setBrush(QPalette.Window, QBrush(brush))
15171517
self.canvas().setPalette(pal)
15181518

15191519
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
@@ -149,7 +149,7 @@ def add_test(self, fname):
149149
button.setText(bname)
150150
button.setToolTip(fname)
151151
button.setIconSize(QSize(130, 80))
152-
button.clicked.connect(lambda checked, fname=fname: run_test(fname))
152+
button.clicked.connect(lambda checked=None, fname=fname: run_test(fname))
153153
self.grid_layout.addWidget(button, row, column)
154154

155155
def about(self):

0 commit comments

Comments
 (0)