diff --git a/qwt/color_map.py b/qwt/color_map.py index 6debc8a..9a54cf0 100644 --- a/qwt/color_map.py +++ b/qwt/color_map.py @@ -28,7 +28,7 @@ :members: """ -from qtpy.QtCore import Qt, qIsNaN +from qtpy.QtCore import QObject, Qt, qIsNaN from qtpy.QtGui import QColor, qAlpha, qBlue, qGreen, qRed, qRgb, qRgba @@ -211,8 +211,10 @@ def colorIndex(self, interval, value): return 0 -class QwtLinearColorMap_PrivateData(object): +class QwtLinearColorMap_PrivateData(QObject): def __init__(self): + QObject.__init__(self) + self.colorStops = ColorStops() self.mode = None @@ -322,8 +324,10 @@ def colorIndex(self, interval, value): return int(ratio * 255 + 0.5) -class QwtAlphaColorMap_PrivateData(object): +class QwtAlphaColorMap_PrivateData(QObject): def __init__(self): + QObject.__init__(self) + self.color = QColor() self.rgb = QColor().rgb() self.rgbMax = QColor().rgb() diff --git a/qwt/column_symbol.py b/qwt/column_symbol.py index fb74038..c4e46b0 100644 --- a/qwt/column_symbol.py +++ b/qwt/column_symbol.py @@ -5,7 +5,7 @@ # Copyright (c) 2015 Pierre Raybaut, for the Python translation/optimization # (see LICENSE file for more details) -from qtpy.QtCore import QLineF, QRectF, Qt +from qtpy.QtCore import QLineF, QObject, QRectF, Qt from qtpy.QtGui import QPalette, QPolygonF from qwt.interval import QwtInterval @@ -71,8 +71,10 @@ def qwtDrawPanel(painter, rect, pal, lw): painter.fillRect(rect.adjusted(lw, lw, -lw + 1, -lw + 1), pal.window()) -class QwtColumnSymbol_PrivateData(object): +class QwtColumnSymbol_PrivateData(QObject): def __init__(self): + QObject.__init__(self) + self.style = QwtColumnSymbol.Box self.frameStyle = QwtColumnSymbol.Raised self.lineWidth = 2 diff --git a/qwt/dyngrid_layout.py b/qwt/dyngrid_layout.py index 2599ab4..45850da 100644 --- a/qwt/dyngrid_layout.py +++ b/qwt/dyngrid_layout.py @@ -15,12 +15,14 @@ :members: """ -from qtpy.QtCore import QRect, QSize, Qt +from qtpy.QtCore import QObject, QRect, QSize, Qt from qtpy.QtWidgets import QLayout -class QwtDynGridLayout_PrivateData(object): +class QwtDynGridLayout_PrivateData(QObject): def __init__(self): + QObject.__init__(self) + self.isDirty = True self.maxColumns = 0 self.numRows = 0 diff --git a/qwt/graphic.py b/qwt/graphic.py index 1eccc34..cbf2d97 100644 --- a/qwt/graphic.py +++ b/qwt/graphic.py @@ -15,7 +15,7 @@ import math -from qtpy.QtCore import QPointF, QRect, QRectF, QSize, QSizeF, Qt +from qtpy.QtCore import QObject, QPointF, QRect, QRectF, QSize, QSizeF, Qt from qtpy.QtGui import ( QImage, QPaintEngine, @@ -185,8 +185,9 @@ def scaleFactorY(self, pathRect, targetRect, scalePens): return sy -class QwtGraphic_PrivateData(object): +class QwtGraphic_PrivateData(QObject): def __init__(self): + QObject.__init__(self) self.boundingRect = QRectF(0.0, 0.0, -1.0, -1.0) self.pointRect = QRectF(0.0, 0.0, -1.0, -1.0) self.initialTransform = None diff --git a/qwt/legend.py b/qwt/legend.py index 86030c3..a117370 100644 --- a/qwt/legend.py +++ b/qwt/legend.py @@ -21,7 +21,7 @@ import math -from qtpy.QtCore import QEvent, QPoint, QRect, QRectF, QSize, Qt, Signal +from qtpy.QtCore import QEvent, QObject, QPoint, QRect, QRectF, QSize, Qt, Signal # qDrawWinButton, from qtpy.QtGui import QPainter, QPalette, QPixmap @@ -170,8 +170,10 @@ def buttonShift(w): return QSize(ph, pv) -class QwtLegendLabel_PrivateData(object): +class QwtLegendLabel_PrivateData(QObject): def __init__(self): + QObject.__init__(self) + self.itemMode = QwtLegendData.ReadOnly self.isDown = False self.spacing = MARGIN @@ -588,8 +590,10 @@ def layoutContents(self): self.contentsWidget.resize(w, h) -class QwtLegend_PrivateData(object): +class QwtLegend_PrivateData(QObject): def __init__(self): + QObject.__init__(self) + self.itemMode = QwtLegendData.ReadOnly self.view = QwtDynGridLayout() self.itemMap = QwtLegendMap() diff --git a/qwt/null_paintdevice.py b/qwt/null_paintdevice.py index bd4b4af..fd3fdaf 100644 --- a/qwt/null_paintdevice.py +++ b/qwt/null_paintdevice.py @@ -15,13 +15,16 @@ import os +from qtpy.QtCore import QObject from qtpy.QtGui import QPaintDevice, QPaintEngine, QPainterPath QT_API = os.environ["QT_API"] -class QwtNullPaintDevice_PrivateData(object): +class QwtNullPaintDevice_PrivateData(QObject): def __init__(self): + QObject.__init__(self) + self.mode = QwtNullPaintDevice.NormalMode diff --git a/qwt/plot.py b/qwt/plot.py index c3b69dc..298382c 100644 --- a/qwt/plot.py +++ b/qwt/plot.py @@ -22,7 +22,7 @@ import math import numpy as np -from qtpy.QtCore import QEvent, QRectF, QSize, Qt, Signal +from qtpy.QtCore import QEvent, QObject, QRectF, QSize, Qt, Signal from qtpy.QtGui import QBrush, QColor, QFont, QPainter, QPalette from qtpy.QtWidgets import QApplication, QFrame, QSizePolicy, QWidget @@ -75,9 +75,10 @@ def removeItem(self, obj): self.sortItems() -class QwtPlot_PrivateData(object): +class QwtPlot_PrivateData(QObject): def __init__(self): - super(QwtPlot_PrivateData, self).__init__() + QObject.__init__(self) + self.itemList = ItemList() self.titleLabel = None self.footerLabel = None @@ -1691,8 +1692,10 @@ def exportTo( renderer.renderDocument(self, filename, size_mm, resolution, format_) -class QwtPlotItem_PrivateData(object): +class QwtPlotItem_PrivateData(QObject): def __init__(self): + QObject.__init__(self) + self.plot = None self.isVisible = True self.attributes = 0 diff --git a/qwt/plot_canvas.py b/qwt/plot_canvas.py index edee435..c7c7950 100644 --- a/qwt/plot_canvas.py +++ b/qwt/plot_canvas.py @@ -15,7 +15,7 @@ import os -from qtpy.QtCore import QEvent, QPoint, QPointF, QRect, QRectF, QSize, Qt +from qtpy.QtCore import QEvent, QObject, QPoint, QPointF, QRect, QRectF, QSize, Qt from qtpy.QtGui import ( QBrush, QGradient, @@ -329,8 +329,10 @@ def __init__(self): self.background = StyleSheetBackground() -class QwtPlotCanvas_PrivateData(object): +class QwtPlotCanvas_PrivateData(QObject): def __init__(self): + QObject.__init__(self) + self.focusIndicator = QwtPlotCanvas.NoFocusIndicator self.borderRadius = 0 self.paintAttributes = 0 diff --git a/qwt/plot_directpainter.py b/qwt/plot_directpainter.py index 961e5fd..06697d3 100644 --- a/qwt/plot_directpainter.py +++ b/qwt/plot_directpainter.py @@ -39,8 +39,10 @@ def qwtHasBackingStore(canvas): ) -class QwtPlotDirectPainter_PrivateData(object): +class QwtPlotDirectPainter_PrivateData(QObject): def __init__(self): + QObject.__init__(self) + self.attributes = 0 self.hasClipping = False self.seriesItem = None # QwtPlotSeriesItem diff --git a/qwt/plot_grid.py b/qwt/plot_grid.py index 364b52d..a75a07c 100644 --- a/qwt/plot_grid.py +++ b/qwt/plot_grid.py @@ -13,7 +13,7 @@ :members: """ -from qtpy.QtCore import QLineF, Qt +from qtpy.QtCore import QLineF, QObject, Qt from qtpy.QtGui import QPen from qwt._math import qwtFuzzyGreaterOrEqual, qwtFuzzyLessOrEqual @@ -22,8 +22,10 @@ from qwt.scale_div import QwtScaleDiv -class QwtPlotGrid_PrivateData(object): +class QwtPlotGrid_PrivateData(QObject): def __init__(self): + QObject.__init__(self) + self.xEnabled = True self.yEnabled = True self.xMinEnabled = False diff --git a/qwt/plot_layout.py b/qwt/plot_layout.py index 98cce3d..0919914 100644 --- a/qwt/plot_layout.py +++ b/qwt/plot_layout.py @@ -15,7 +15,7 @@ import math -from qtpy.QtCore import QRectF, QSize, Qt +from qtpy.QtCore import QObject, QRectF, QSize, Qt from qtpy.QtGui import QFont, QRegion from qwt.plot import QwtPlot @@ -143,8 +143,10 @@ def init(self, plot, rect): ] -class QwtPlotLayout_PrivateData(object): +class QwtPlotLayout_PrivateData(QObject): def __init__(self): + QObject.__init__(self) + self.spacing = 5 self.titleRect = QRectF() self.footerRect = QRectF() diff --git a/qwt/plot_marker.py b/qwt/plot_marker.py index c037148..1db25cd 100644 --- a/qwt/plot_marker.py +++ b/qwt/plot_marker.py @@ -13,7 +13,7 @@ :members: """ -from qtpy.QtCore import QLineF, QPointF, QRect, QRectF, QSizeF, Qt +from qtpy.QtCore import QLineF, QObject, QPointF, QRect, QRectF, QSizeF, Qt from qtpy.QtGui import QPainter, QPen from qwt.graphic import QwtGraphic @@ -23,8 +23,10 @@ from qwt.text import QwtText -class QwtPlotMarker_PrivateData(object): +class QwtPlotMarker_PrivateData(QObject): def __init__(self): + QObject.__init__(self) + self.labelAlignment = Qt.AlignCenter self.labelOrientation = Qt.Horizontal self.spacing = 2 diff --git a/qwt/plot_renderer.py b/qwt/plot_renderer.py index 112c9de..d8b2640 100644 --- a/qwt/plot_renderer.py +++ b/qwt/plot_renderer.py @@ -55,8 +55,10 @@ def qwtCanvasClip(canvas, canvasRect): return canvas.borderPath(r) -class QwtPlotRenderer_PrivateData(object): +class QwtPlotRenderer_PrivateData(QObject): def __init__(self): + QObject.__init__(self) + self.discardFlags = QwtPlotRenderer.DiscardNone self.layoutFlags = QwtPlotRenderer.DefaultLayout diff --git a/qwt/scale_draw.py b/qwt/scale_draw.py index 7479ac9..d2a8a8c 100644 --- a/qwt/scale_draw.py +++ b/qwt/scale_draw.py @@ -21,7 +21,16 @@ import math -from qtpy.QtCore import QLineF, QPoint, QPointF, QRect, QRectF, Qt, qFuzzyCompare +from qtpy.QtCore import ( + QLineF, + QObject, + QPoint, + QPointF, + QRect, + QRectF, + Qt, + qFuzzyCompare, +) from qtpy.QtGui import QFontMetrics, QPalette, QTransform from qwt._math import qwtRadians @@ -30,8 +39,10 @@ from qwt.text import QwtText -class QwtAbstractScaleDraw_PrivateData(object): +class QwtAbstractScaleDraw_PrivateData(QObject): def __init__(self): + QObject.__init__(self) + self.spacing = 4 self.penWidth = 0 self.minExtent = 0.0 @@ -233,7 +244,8 @@ def draw(self, painter, palette): Draw the scale :param QPainter painter: The painter - :param QPalette palette: Palette, text color is used for the labels, foreground color for ticks and backbone + :param QPalette palette: Palette, text color is used for the labels, + foreground color for ticks and backbone """ painter.save() @@ -457,8 +469,10 @@ def invalidateCache(self): self.__data.labelCache.clear() -class QwtScaleDraw_PrivateData(object): +class QwtScaleDraw_PrivateData(QObject): def __init__(self): + QObject.__init__(self) + self.len = 0 self.alignment = QwtScaleDraw.BottomScale self.labelAlignment = 0 @@ -1048,7 +1062,8 @@ def setLabelRotation(self, rotation): adjust the label flags too. Finding a useful combination is often the result of try and error. - :param float rotation: Angle in degrees. When changing the label rotation, the label flags often needs to be adjusted too. + :param float rotation: Angle in degrees. When changing the label rotation, the + label flags often needs to be adjusted too. .. seealso:: diff --git a/qwt/scale_widget.py b/qwt/scale_widget.py index d9bb6c8..fb3eac6 100644 --- a/qwt/scale_widget.py +++ b/qwt/scale_widget.py @@ -15,7 +15,7 @@ import math -from qtpy.QtCore import QRectF, QSize, Qt, Signal +from qtpy.QtCore import QObject, QRectF, QSize, Qt, Signal from qtpy.QtGui import QPainter, QPalette from qtpy.QtWidgets import QSizePolicy, QStyle, QStyleOption, QWidget @@ -35,8 +35,10 @@ def __init__(self): self.colorMap = QwtColorMap() -class QwtScaleWidget_PrivateData(object): +class QwtScaleWidget_PrivateData(QObject): def __init__(self): + QObject.__init__(self) + self.scaleDraw = None self.borderDist = [None] * 2 self.minBorderDist = [None] * 2 diff --git a/qwt/symbol.py b/qwt/symbol.py index 0f9bbb8..458b94f 100644 --- a/qwt/symbol.py +++ b/qwt/symbol.py @@ -15,7 +15,17 @@ import math -from qtpy.QtCore import QLineF, QPoint, QPointF, QRect, QRectF, QSize, QSizeF, Qt +from qtpy.QtCore import ( + QLineF, + QObject, + QPoint, + QPointF, + QRect, + QRectF, + QSize, + QSizeF, + Qt, +) from qtpy.QtGui import ( QBrush, QPainter, @@ -334,8 +344,9 @@ def qwtDrawHexagonSymbols(painter, points, symbol): painter.drawPolygon(QPolygonF(hexa)) -class QwtSymbol_PrivateData(object): +class QwtSymbol_PrivateData(QObject): def __init__(self, st, br, pn, sz): + QObject.__init__(self) self.style = st self.size = sz self.brush = br diff --git a/qwt/text.py b/qwt/text.py index 65b310e..69a3192 100644 --- a/qwt/text.py +++ b/qwt/text.py @@ -47,7 +47,7 @@ import os import struct -from qtpy.QtCore import QRectF, QSize, QSizeF, Qt +from qtpy.QtCore import QObject, QRectF, QSize, QSizeF, Qt from qtpy.QtGui import ( QAbstractTextDocumentLayout, QColor, @@ -457,8 +457,10 @@ def textMargins(self, font): return 0, 0, 0, 0 -class QwtText_PrivateData(object): +class QwtText_PrivateData(QObject): def __init__(self): + QObject.__init__(self) + self.renderFlags = Qt.AlignCenter self.borderRadius = 0 self.borderPen = Qt.NoPen @@ -1104,8 +1106,10 @@ def setTextEngine(self, format_, engine): self.__map.setdefault(format_, engine) -class QwtTextLabel_PrivateData(object): +class QwtTextLabel_PrivateData(QObject): def __init__(self): + QObject.__init__(self) + self.indent = 4 self.margin = 0 self.text = QwtText()