diff -Nru pyqt-qwt-1.01.00/changelog pyqt-qwt-1.02.00/changelog --- pyqt-qwt-1.01.00/changelog 2018-09-01 08:10:52.000000000 +0000 +++ pyqt-qwt-1.02.00/changelog 2019-02-23 12:55:34.000000000 +0000 @@ -17,3 +17,14 @@ explicit QwtPlot( const QwtText &title, QWidget * = NULL ); - Add QT += printsupport. - Known bug: printing from spectrogram.py freezes in Linux. + +Version 1.02.00 +- Fix compilation for Sip >= 4.18 and Qwt >= 6.1.2 + Tested for Qwt 6.1.2, 6.1.3 and 6.1.4 +- Add Analog Clock widget +- Add Compass widget +- Add Dial wigets +- Add setSamples(QPolygon). Improves framerate. + Thanks to Olivier. +- A few bug fixes +- A few more examples diff -Nru pyqt-qwt-1.01.00/configure.py pyqt-qwt-1.02.00/configure.py --- pyqt-qwt-1.01.00/configure.py 2018-09-01 08:10:52.000000000 +0000 +++ pyqt-qwt-1.02.00/configure.py 2019-02-23 12:55:34.000000000 +0000 @@ -60,7 +60,7 @@ # The version of the module as a string. Set it to None if you don't # provide version information. - version = '6.1.3' + version = "6.1.2" # The name of the PEP 376 .dist-info directory to be created. distinfo_name = 'Qwt' @@ -74,7 +74,7 @@ # The minimum version of SIP that is required. This should be a # dot-separated string of two or three integers (e.g. '1.0', '4.10.3'). If # it is None or an empty string then the version is not checked. - minimum_sip_version = '4.19' + minimum_sip_version = '4.18' # Set if support for C++ exceptions can be disabled. no_exceptions = True @@ -244,11 +244,15 @@ # Because we include the Python bindings with the C++ code we can # reasonably force the same version to be used and not bother about # versioning in the .sip files. - if qwt_version != ModuleConfiguration.version: + qv=qwt_version.split('.') + qwt_version_numeric = int(qv[0])*10000 + int(qv[1])*100 + int(qv[2]) + mv=ModuleConfiguration.version.split('.') + mod_version_numeric = int(mv[0])*10000 + int(mv[1])*100 + int(mv[2]) + if qwt_version_numeric < mod_version_numeric: error( "Qwt %s is being used but the Python bindings %s " - "are being built. Please use matching " - "versions." % (qwt_version, ModuleConfiguration.version)) + "are being built. Please use a newer Qwt " + "version." % (qwt_version, ModuleConfiguration.version)) target_configuration.qwt_version = qwt_version @@ -1344,7 +1348,9 @@ # Add the module-specific flags. argv.extend(pkg_config.get_sip_flags(target_config)) - argv.append('-n sip') + # -n arg new in sip 4.19.9 + if target_config.sip_version >= version_from_string("4.19.9"): + argv.append('-n sip') if target_config.pyqt_package is not None: # Get the flags used for the main PyQt module. diff -Nru pyqt-qwt-1.01.00/debian/changelog pyqt-qwt-1.02.00/debian/changelog --- pyqt-qwt-1.01.00/debian/changelog 2018-10-07 07:07:48.000000000 +0000 +++ pyqt-qwt-1.02.00/debian/changelog 2019-02-23 13:10:11.000000000 +0000 @@ -1,3 +1,11 @@ +pyqt-qwt (1.02.00-1) unstable; urgency=medium + + * New upstream release + * Bump standards version to 4.3.0.2, no changes needed + * Add patch fix_ftbs. Needed for new sip version + + -- Gudjon I. Gudjonsson Sat, 23 Feb 2019 14:10:11 +0100 + pyqt-qwt (1.01.00-3) unstable; urgency=medium * Future proof python3 installs. Thanks to Mattia Rizzolo (Closes: #910080) diff -Nru pyqt-qwt-1.01.00/debian/control pyqt-qwt-1.02.00/debian/control --- pyqt-qwt-1.01.00/debian/control 2018-10-01 20:56:50.000000000 +0000 +++ pyqt-qwt-1.02.00/debian/control 2019-02-23 13:10:11.000000000 +0000 @@ -14,7 +14,7 @@ libqt5svg5-dev, qtbase5-dev, libqt5opengl5-dev -Standards-Version: 4.2.1 +Standards-Version: 4.3.0.2 Homepage: https://github.com/GauiStori/PyQt-Qwt #Testsuite: autopkgtest-pkg-python Vcs-Browser: https://salsa.debian.org/python-team/modules/pyqt-qwt diff -Nru pyqt-qwt-1.01.00/debian/patches/01_ftbs_fix.patch pyqt-qwt-1.02.00/debian/patches/01_ftbs_fix.patch --- pyqt-qwt-1.01.00/debian/patches/01_ftbs_fix.patch 1970-01-01 00:00:00.000000000 +0000 +++ pyqt-qwt-1.02.00/debian/patches/01_ftbs_fix.patch 2019-02-23 13:10:11.000000000 +0000 @@ -0,0 +1,11 @@ +--- a/sip/qwt.sip ++++ b/sip/qwt.sip +@@ -10,7 +10,7 @@ + %Module(name=Qwt, keyword_arguments="Optional") + + %Import QtCore/QtCoremod.sip +-typedef unsigned long size_t; ++//typedef unsigned long size_t; + %Import QtGui/QtGuimod.sip + + %If (Qt_5_0_0 -) diff -Nru pyqt-qwt-1.01.00/debian/patches/series pyqt-qwt-1.02.00/debian/patches/series --- pyqt-qwt-1.01.00/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ pyqt-qwt-1.02.00/debian/patches/series 2019-02-23 13:10:11.000000000 +0000 @@ -0,0 +1 @@ +01_ftbs_fix.patch diff -Nru pyqt-qwt-1.01.00/qt5examples/dials.py pyqt-qwt-1.02.00/qt5examples/dials.py --- pyqt-qwt-1.01.00/qt5examples/dials.py 1970-01-01 00:00:00.000000000 +0000 +++ pyqt-qwt-1.02.00/qt5examples/dials.py 2019-02-23 12:55:34.000000000 +0000 @@ -0,0 +1,400 @@ +#!/usr/bin/python3 + +# python radio.py +# Tested for python3 Qt5. Crashes if mouse is over plot canvas + +import sys +from PyQt5 import Qwt +from PyQt5.QtCore import Qt, QTimer, QRectF, QPointF, qRound # pyqtSignal, Qt, QSize, QBasicTimer +from PyQt5.QtGui import QColor, QPalette, QPainterPath, QPen #, QPixmap, QFont, QIcon, QLinearGradient +from PyQt5.QtWidgets import (QWidget, QApplication, QTabWidget, QGridLayout ) +#from PyQt5.QtPrintSupport import QPrintDialog, QPrinter + +M_PI=3.141 + +class CompassGrid( QWidget ): #QFrame( parent ) + def __init__(self, parent=None): + QWidget.__init__(self, parent) + p = QPalette() + p.setColor( self.backgroundRole(), Qt.gray ) + self.setPalette( p ) + self.setAutoFillBackground( True ) + layout = QGridLayout( self ) + layout.setSpacing( 5 ) + #layout.setMargin( 0 ) + for i in range(6): + compass = self.createCompass( i ) + layout.addWidget( compass, i / 3, i % 3 ) + + #for i in range(layout.columnCount()): + # layout.setColumnStretch( i, 1 ) + + def createCompass( self, pos ): + palette0 = QPalette() + for c in range(QPalette.NColorRoles): + colorRole = QPalette.ColorRole( c ) + palette0.setColor( colorRole, QColor() ) + + #palette0.setColor( QPalette.Base, palette().color( QPalette.backgroundRole() ).light( 120 ) ) + palette0.setColor( QPalette.WindowText, + palette0.color( QPalette.Base ) ) + + compass = Qwt.QwtCompass( self ) + compass.setLineWidth( 4 ) + compass.setFrameShadow(Qwt.QwtCompass.Sunken) + # pos <= 2 ? QwtCompass.Sunken : QwtCompass.Raised ) + + if pos == 0: + #A compass with a rose and no needle. Scale and rose are rotating. + compass.setMode( Qwt.QwtCompass.RotateScale ) + + rose = Qwt.QwtSimpleCompassRose( 16, 2 ) + rose.setWidth( 0.15 ) + + compass.setRose( rose ) + elif pos == 1: + #A windrose, with a scale indicating the main directions only + map = {} + map[0.0] = "N" + map[90.0] = "E" + map[180.0] = "S" + map[270.0] = "W" + + compass.setScaleDraw( Qwt.QwtCompassScaleDraw( map ) ) + + rose = Qwt.QwtSimpleCompassRose( 4, 1 ) + compass.setRose( rose ) + + compass.setNeedle( Qwt.QwtCompassWindArrow( Qwt.QwtCompassWindArrow.Style2 ) ) + compass.setValue( 60.0 ) + elif pos == 2: + #A compass with a rotating needle in darkBlue. Shows + #a ticks for each degree. + + palette0.setColor( QPalette.Base, Qt.darkBlue ) + palette0.setColor( QPalette.WindowText, QColor( Qt.darkBlue ))#.dark( 120 ) ) + palette0.setColor( QPalette.Text, Qt.white ) + + scaleDraw = Qwt.QwtCompassScaleDraw() + scaleDraw.enableComponent( Qwt.QwtAbstractScaleDraw.Ticks, True ) + scaleDraw.enableComponent( Qwt.QwtAbstractScaleDraw.Labels, True ) + scaleDraw.enableComponent( Qwt.QwtAbstractScaleDraw.Backbone, False ) + scaleDraw.setTickLength( Qwt.QwtScaleDiv.MinorTick, 1 ) + scaleDraw.setTickLength( Qwt.QwtScaleDiv.MediumTick, 1 ) + scaleDraw.setTickLength( Qwt.QwtScaleDiv.MajorTick, 3 ) + + compass.setScaleDraw( scaleDraw ) + + compass.setScaleMaxMajor( 36 ) + compass.setScaleMaxMinor( 5 ) + + compass.setNeedle( Qwt.QwtCompassMagnetNeedle( Qwt.QwtCompassMagnetNeedle.ThinStyle ) ) + compass.setValue( 220.0 ) + elif pos == 3: + #A compass without a frame, showing numbers as tick labels. + #The origin is at 220.0 + palette0.setColor( QPalette.Base, self.palette().color( self.backgroundRole() ) ) + palette0.setColor( QPalette.WindowText, Qt.blue ) + compass.setLineWidth( 0 ) + map = {} + for d in range(0,360,60): + map[d] = "%.0f"%(d*1.0) + + scaleDraw = Qwt.QwtCompassScaleDraw( map ) + scaleDraw.enableComponent( Qwt.QwtAbstractScaleDraw.Ticks, True ) + scaleDraw.enableComponent( Qwt.QwtAbstractScaleDraw.Labels, True ) + scaleDraw.enableComponent( Qwt.QwtAbstractScaleDraw.Backbone, True ) + scaleDraw.setTickLength( Qwt.QwtScaleDiv.MinorTick, 0 ) + scaleDraw.setTickLength( Qwt.QwtScaleDiv.MediumTick, 0 ) + scaleDraw.setTickLength( Qwt.QwtScaleDiv.MajorTick, 3 ) + compass.setScaleDraw( scaleDraw ) + compass.setScaleMaxMajor( 36 ) + compass.setScaleMaxMinor( 5 ) + compass.setNeedle( Qwt.QwtDialSimpleNeedle( Qwt.QwtDialSimpleNeedle.Ray, True, Qt.white ) ) + compass.setOrigin( 220.0 ) + compass.setValue( 20.0 ) + elif pos == 4: + #A compass showing another needle + scaleDraw = Qwt.QwtCompassScaleDraw() + scaleDraw.enableComponent( Qwt.QwtAbstractScaleDraw.Ticks, True ) + scaleDraw.enableComponent( Qwt.QwtAbstractScaleDraw.Labels, True ) + scaleDraw.enableComponent( Qwt.QwtAbstractScaleDraw.Backbone, False ) + scaleDraw.setTickLength( Qwt.QwtScaleDiv.MinorTick, 0 ) + scaleDraw.setTickLength( Qwt.QwtScaleDiv.MediumTick, 0 ) + scaleDraw.setTickLength( Qwt.QwtScaleDiv.MajorTick, 3 ) + compass.setScaleDraw( scaleDraw ) + compass.setNeedle( Qwt.QwtCompassMagnetNeedle( Qwt.QwtCompassMagnetNeedle.TriangleStyle, Qt.white, Qt.red ) ) + compass.setValue( 220.0 ) + elif pos == 5: + #A compass with a yellow on black ray + palette0.setColor( QPalette.WindowText, Qt.black ) + compass.setNeedle( Qwt.QwtDialSimpleNeedle( Qwt.QwtDialSimpleNeedle.Ray, False, Qt.yellow ) ) + compass.setValue( 315.0 ) + + newPalette = compass.palette() + for c in range(QPalette.NColorRoles): + colorRole = QPalette.ColorRole( c ) + if ( palette0.color( colorRole ).isValid() ): + newPalette.setColor( colorRole, palette0.color( colorRole ) ) + + for i in range(QPalette.NColorGroups): + colorGroup = QPalette.ColorGroup( i ) + light = newPalette.color( colorGroup, QPalette.Base )#.light( 170 ) + dark = newPalette.color( colorGroup, QPalette.Base )#.dark( 170 ) + #mid = compass.frameShadow() == QwtDial.Raised + # ? newPalette.color( colorGroup, QPalette.Base ).dark( 110 ) + # : newPalette.color( colorGroup, QPalette.Base ).light( 110 ) + mid = newPalette.color( colorGroup, QPalette.Base )#.dark( 110 ) + newPalette.setColor( colorGroup, QPalette.Dark, dark ) + newPalette.setColor( colorGroup, QPalette.Mid, mid ) + newPalette.setColor( colorGroup, QPalette.Light, light ) + compass.setPalette( newPalette ) + return compass + +class SpeedoMeter( Qwt.QwtDial ): #QwtDial( parent ), + def __init__(self,parent = None): + Qwt.QwtDial.__init__(self,parent) + self.d_label = "km/h" + scaleDraw = Qwt.QwtRoundScaleDraw() + scaleDraw.setSpacing( 8 ) + scaleDraw.enableComponent( Qwt.QwtAbstractScaleDraw.Backbone, False ) + scaleDraw.setTickLength( Qwt.QwtScaleDiv.MinorTick, 0 ) + scaleDraw.setTickLength( Qwt.QwtScaleDiv.MediumTick, 4 ) + scaleDraw.setTickLength( Qwt.QwtScaleDiv.MajorTick, 8 ) + self. setScaleDraw( scaleDraw ) + + self.setWrapping( False ) + self.setReadOnly( True ) + + self.setOrigin( 135.0 ) + self.setScaleArc( 0.0, 270.0 ) + + needle = Qwt.QwtDialSimpleNeedle( + Qwt.QwtDialSimpleNeedle.Arrow, True, Qt.red, + QColor( Qt.gray ))#.light( 130 ) ) + self.setNeedle( needle ) + + def setLabel( self, label ): + self.d_label = label + self.update() + + def label(self): + return self.d_label + + def drawScaleContents( self, painter, center, radius ): + rect = QRectF( 0.0, 0.0, 2.0 * radius, 2.0 * radius - 10.0 ) + rect.moveCenter( center ) + color = self.palette().color( QPalette.Text ) + painter.setPen( color ) + flags = Qt.AlignBottom | Qt.AlignHCenter + painter.drawText( rect, flags, self.d_label ) + +class AttitudeIndicatorNeedle(Qwt.QwtDialNeedle): + def __init__(self, color=None): + Qwt.QwtDialNeedle.__init__(self) + palette = QPalette() + palette.setColor( QPalette.Text, color ) + #self.setPalette( palette ) + + def rawNeedle( self, painter, length, colorGroup ): + triangleSize = length * 0.1 + pos = length - 2.0 + + path = QPainterPath() + path.moveTo( pos, 0 ) + path.lineTo( pos - 2 * triangleSize, triangleSize ) + path.lineTo( pos - 2 * triangleSize, -triangleSize ) + path.closeSubpath() + + painter.setBrush( self.palette().brush( colorGroup, QPalette.Text ) ) + painter.drawPath( path ) + + l = length - 2 + painter.setPen( QPen( self.palette().color( colorGroup, QPalette.Text ), 3 ) ) + painter.drawLine( QPointF( 0.0, -l ), QPointF( 0.0, l ) ) + + +class AttitudeIndicator(Qwt.QwtDial): + def __init__(self, parent = None): + Qwt.QwtDial.__init__( self, parent ) + self.d_gradient = 0.0 + scaleDraw = Qwt.QwtRoundScaleDraw() + scaleDraw.enableComponent( Qwt.QwtAbstractScaleDraw.Backbone, False ) + scaleDraw.enableComponent( Qwt.QwtAbstractScaleDraw.Labels, False ) + self.setScaleDraw( scaleDraw ) + + #self.setMode( Qwt.RotateScale ) + self.setWrapping( True ) + + self.setOrigin( 270.0 ) + + self.setScaleMaxMinor( 0 ) + self.setScaleStepSize( 30.0 ) + self.setScale( 0.0, 360.0 ) + + color = self.palette().color( QPalette.Text ) + self.setNeedle( AttitudeIndicatorNeedle( color ) ) + + def setGradient( self, gradient ): + if ( gradient < -1.0 ): + gradient = -1.0 + elif ( gradient > 1.0 ): + gradient = 1.0 + if ( self.d_gradient != gradient ): + self.d_gradient = gradient + self.update() + + def drawScale( self, painter, center, radius ): + offset = 4.0 + p0 = self.qwtPolar2Pos( center, offset, 1.5 * M_PI ) + w = self.innerRect().width() + path = QPainterPath() + path.moveTo( Qwt.qwtPolar2Pos( p0, w, 0.0 ) ) + path.lineTo( Qwt.qwtPolar2Pos( path.currentPosition(), 2 * w, M_PI ) ) + path.lineTo( Qwt.qwtPolar2Pos( path.currentPosition(), w, 0.5 * M_PI ) ) + path.lineTo( Qwt.qwtPolar2Pos( path.currentPosition(), w, 0.0 ) ) + painter.save() + painter.setClipPath( path ) # swallow 180 - 360 degrees + Qwt.QwtDial.drawScale( painter, center, radius ) + painter.restore() + + def drawScaleContents( self, painter, double ): + dir = 360 - qRound( self.origin() - self.value() ) # counter clockwise + arc = 90 + qRound( self.gradient() * 90 ) + skyColor = QColor( 38, 151, 221 ) + painter.save() + painter.setBrush( skyColor ) + painter.drawChord( self.scaleInnerRect(), ( dir - arc ) * 16, 2 * arc * 16 ) + painter.restore() + + def keyPressEvent( self, event ): + k = event.key() + if k == Qt.Key_Plus: + self.setGradient( self.gradient() + 0.05 ) + elif k == Qt.Key_Minus: + self.setGradient( self.gradient() - 0.05 ) + else: + Qwt.QwtDial.keyPressEvent( event ) + + def angle(self): + return self.value() + + def gradient(self): + return self.d_gradient + + def setAngle( self, angle ): + self.setValue( angle ) + +class CockpitGrid( QWidget ): + def __init__(self, parent = None): + QWidget.__init__(self, parent) + self.setAutoFillBackground( True ) + #self.setPalette( self.colorTheme( QColor( Qt.darkGray )))#.dark( 150 ) ) ) + layout = QGridLayout( self ) + layout.setSpacing( 5 ) + #layout.setMargin( 0 ) + for i in range(2): # FIXME. Should be 3 but program crashes for the third one. + dial = self.createDial( i ) + layout.addWidget( dial, 0, i ) + + for i in range(layout.columnCount()): + layout.setColumnStretch( i, 1 ) + + def createDial( self, pos ): + dial = None + if pos == 0: + self.d_clock = Qwt.QwtAnalogClock( ) + # disable minor ticks + #d_clock.scaleDraw().setTickLength( QwtScaleDiv.MinorTick, 0 ) + knobColor = QColor( Qt.gray ) # .light( 130 ) + + for i in range(Qwt.QwtAnalogClock.NHands): + handColor = QColor( Qt.gray ) #.light( 150 ) + width = 8 + if i == Qwt.QwtAnalogClock.SecondHand: + handColor = Qt.gray + width = 5 + hand = Qwt.QwtDialSimpleNeedle( Qwt.QwtDialSimpleNeedle.Arrow, True, handColor, knobColor ) + hand.setWidth( width ) + self.d_clock.setHand( Qwt.QwtAnalogClock.Hand( i ), hand ) + timer = QTimer( self.d_clock ) + timer.timeout.connect(self.d_clock.setCurrentTime) + timer.start( 1000 ) + dial = self.d_clock + elif pos == 1: + self.d_speedo = SpeedoMeter( self ) + self.d_speedo.setScaleStepSize( 20.0 ) + self.d_speedo.setScale( 0.0, 240.0 ) + self.d_speedo.scaleDraw().setPenWidth( 2 ) + timer = QTimer( self.d_speedo ) + timer.timeout.connect(self.changeSpeed ) + timer.start( 50 ) + dial = self.d_speedo + elif pos == 2: + self.d_ai = AttitudeIndicator( self ) + self.d_ai.scaleDraw().setPenWidth( 3 ) + gradientTimer = QTimer( self.d_ai ) + gradientTimer.timeout.connect(self.changeGradient ) + gradientTimer.start( 100 ) + angleTimer = QTimer( self.d_ai ) + angleTimer.timeout.connect( self.changeAngle ) + angleTimer.start( 100 ) + dial = self.d_ai + + if ( dial ): + dial.setReadOnly( True ) + dial.setLineWidth( 4 ) + dial.setFrameShadow(Qwt.QwtDial.Sunken ) + return dial + + def colorTheme( self, base ): + palette = QPalette + palette.setColor( QPalette.Base, base ) + palette.setColor( QPalette.Window, base.dark( 150 ) ) + palette.setColor( QPalette.Mid, base.dark( 110 ) ) + palette.setColor( QPalette.Light, base.light( 170 ) ) + palette.setColor( QPalette.Dark, base.dark( 170 ) ) + palette.setColor( QPalette.Text, base.dark( 200 ).light( 800 ) ) + palette.setColor( QPalette.WindowText, base.dark( 200 ) ) + return palette + + def changeSpeed(self): + offset = 0.8 + speed = self.d_speedo.value() + if ( ( speed < 7.0 and offset < 0.0 ) or ( speed > 203.0 and offset > 0.0 ) ): + offset = -offset + counter = 0 + """switch( counter++ % 12 ) + { + case 0: + case 2: + case 7: + case 8: + break + default: + }""" + self.d_speedo.setValue( speed + offset ) + + def changeAngle(self): + offset = 0.05 + angle = self.d_ai.angle() + if ( angle > 180.0 ): + angle -= 360.0 + if ( ( angle < -5.0 and offset < 0.0 ) or ( angle > 5.0 and offset > 0.0 ) ): + offset = -offset + self.d_ai.setAngle( angle + offset ) + + def changeGradient(self): + offset = 0.005 + gradient = self.d_ai.gradient() + if ( ( gradient < -0.05 and offset < 0.0 ) or ( gradient > 0.05 and offset > 0.0 ) ): + offset = -offset + self.d_ai.setGradient( gradient + offset ) + +a = QApplication(sys.argv) +tabWidget = QTabWidget() +tabWidget.addTab(CompassGrid(),"Compass") +tabWidget.addTab(CockpitGrid(),"Cockpit") +tabWidget.show() + +sys.exit(a.exec_()) diff -Nru pyqt-qwt-1.01.00/qt5examples/radio.py pyqt-qwt-1.02.00/qt5examples/radio.py --- pyqt-qwt-1.01.00/qt5examples/radio.py 2018-09-01 08:10:52.000000000 +0000 +++ pyqt-qwt-1.02.00/qt5examples/radio.py 2019-02-23 12:55:34.000000000 +0000 @@ -1,6 +1,6 @@ -#!/usr/bin/python +#!/usr/bin/python3 -# python simpleplot.py +# python radio.py # Tested for python3 Qt5. Crashes if mouse is over plot canvas import sys diff -Nru pyqt-qwt-1.01.00/qt5examples/scatterplot.py pyqt-qwt-1.02.00/qt5examples/scatterplot.py --- pyqt-qwt-1.01.00/qt5examples/scatterplot.py 2018-09-01 08:10:52.000000000 +0000 +++ pyqt-qwt-1.02.00/qt5examples/scatterplot.py 2019-02-23 12:55:34.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 import sys import math diff -Nru pyqt-qwt-1.01.00/README.md pyqt-qwt-1.02.00/README.md --- pyqt-qwt-1.01.00/README.md 2018-09-01 08:10:52.000000000 +0000 +++ pyqt-qwt-1.02.00/README.md 2019-02-23 12:55:34.000000000 +0000 @@ -18,7 +18,8 @@ The header files need to be patched with 06_python_compat.patch but for convenience the patched files are kept in the header directory. -Do the following before compiling: + +For Qwt version < 6.1.5 the following is needed before compiling: $ cp -a /usr/include/qwt header @@ -34,14 +35,13 @@ which supports coexisting Qt libraries (4 and 5) you need to add QT_SELECT ahead of the command line. +All systems are not exactly equal. python may refer to python3 on some systems. +On Debian systems the Qt5 version of Qwt is named libqwt-qt5.so but the default name is +libqwt.so. Remove the --qwt-lib=qwt-qt5 if the name extension is not used on your system. -$ QT_SELECT=qt5 python configure.py --qwt-incdir=header/qwt --qwt-libdir=/usr/lib --qwt-lib=qwt-qt5 - $ QT_SELECT=qt5 python3 configure.py --qwt-incdir=header/qwt --qwt-libdir=/usr/lib --qwt-lib=qwt-qt5 -$ QT_SELECT=qt4 python configure.py --qwt-incdir=header/qwt --qwt-libdir=/usr/lib --pyqt=PyQt4 - $ QT_SELECT=qt4 python3 configure.py --qwt-incdir=header/qwt --qwt-libdir=/usr/lib --pyqt=PyQt4 $ make @@ -107,16 +107,39 @@ $ gdb --args python3-dbg $ run barchart.py +### Usage + +The pyuic5 doesn't fully work with PyQt-Qwt. + +After creating the python file. + +pyuic5 uifile.ui -o ui_uifile.py + +you need to edit the file afterwards. + +Add + +from PyQt5.Qwt import * + +at the top of the file. + +Then remove all lines with + +import qwt_ + +from the bottom of the file. + +The following command will do this automatically + +pyuic5 uifile.ui |grep -v "from qwt_" | sed 's/# WARNING! All changes made in this file will be lost!/from PyQt5.Qwt import */g' > ui_uifile.py + +but it needs sed and grep to be installed on your computer. ### Status -2018-09-01 - * Merged next version into master - * Compiles with sip >= 4.19.11. Tested on Windows. Doesn't compile with sip 4.19.8 but it compiles with 4.19.12. - * Add more examples from Qwt: curvdemo1. and controls.py - * Add more sip files: qwt_slider.sip, qwt_transform.sip - * Improved several examples - * Changed some /Transfer/ /TransferThis/ instructions. Will run the full library through valgrind before release. +2019-02-14 + * Compiles with sip >= 4.18. + * Compiles with Qwt >= 6.1.2. Tested for version 6.1.2, 6.1.3, 6.1.4 * All examples except for oscilloscope.py do work. diff -Nru pyqt-qwt-1.01.00/sip/qmap_convert.sip pyqt-qwt-1.02.00/sip/qmap_convert.sip --- pyqt-qwt-1.01.00/sip/qmap_convert.sip 1970-01-01 00:00:00.000000000 +0000 +++ pyqt-qwt-1.02.00/sip/qmap_convert.sip 2019-02-23 12:55:34.000000000 +0000 @@ -0,0 +1,82 @@ +// QMap is implemented as a Python dictionary. + +%MappedType QMap /DocType="dict-of-double-QString"/ +{ +%TypeHeaderCode +#include +%End + +%ConvertFromTypeCode + // Create the dictionary. + PyObject *d = PyDict_New(); + + if (!d) + return NULL; + + // Set the dictionary elements. + QMap::const_iterator i = sipCpp->constBegin(); + + while (i != sipCpp->constEnd()) + { + QString *t = new QString(i.value()); + + PyObject *kobj = PyFloat_FromDouble(i.key()); + PyObject *tobj = sipConvertFromType(t, sipType_QString, sipTransferObj); + + if (kobj == NULL || tobj == NULL || PyDict_SetItem(d, kobj, tobj) < 0) + { + Py_DECREF(d); + if (kobj) + { + Py_DECREF(kobj); + } + if (tobj) + { + Py_DECREF(tobj); + } + else + { + delete t; + } + return NULL; + } + Py_DECREF(kobj); + Py_DECREF(tobj); + ++i; + } + return d; +%End + +%ConvertToTypeCode + PyObject *kobj, *tobj; + SIP_SSIZE_T i = 0; + // Check the type if that is all that is required. + if (sipIsErr == NULL) + { + if (!PyDict_Check(sipPy)) + return 0; + while (PyDict_Next(sipPy, &i, &kobj, &tobj)) + if (!sipCanConvertToType(tobj, sipType_QString, SIP_NOT_NONE)) + return 0; + return 1; + } + QMap *qm = new QMap; + while (PyDict_Next(sipPy, &i, &kobj, &tobj)) + { + int state; + double k = PyFloat_AS_DOUBLE(kobj); + QString *t = reinterpret_cast(sipConvertToType(tobj, sipType_QString, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr)); + if (*sipIsErr) + { + sipReleaseType(t, sipType_QString, state); + delete qm; + return 0; + } + qm->insert(k, *t); + sipReleaseType(t, sipType_QString, state); + } + *sipCppPtr = qm; + return sipGetState(sipTransferObj); +%End +}; + diff -Nru pyqt-qwt-1.01.00/sip/qwt_analog_clock.sip pyqt-qwt-1.02.00/sip/qwt_analog_clock.sip --- pyqt-qwt-1.01.00/sip/qwt_analog_clock.sip 1970-01-01 00:00:00.000000000 +0000 +++ pyqt-qwt-1.02.00/sip/qwt_analog_clock.sip 2019-02-23 12:55:34.000000000 +0000 @@ -0,0 +1,87 @@ +/* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** + * Qwt Widget Library + * Copyright (C) 1997 Josef Wilgen + * Copyright (C) 2002 Uwe Rathmann + * Copyright (C) 2018 Gudjon I. Gudjonsson + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the Qwt License, Version 1.0 + *****************************************************************************/ + + +/*! + \brief An analog clock + + \image html analogclock.png + + \par Example + \code + #include + + QwtAnalogClock *clock = new QwtAnalogClock(...); + clock->scaleDraw()->setPenWidth(3); + clock->setLineWidth(6); + clock->setFrameShadow(QwtDial::Sunken); + clock->setTime(); + + // update the clock every second + QTimer *timer = new QTimer(clock); + timer->connect(timer, SIGNAL(timeout()), clock, SLOT(setCurrentTime())); + timer->start(1000); + + \endcode + + \note The examples/dials example shows how to use QwtAnalogClock. +*/ + +class QwtAnalogClock: QwtDial +{ +%TypeHeaderCode +#include +%End + +public: + /*! + Hand type + \sa setHand(), hand() + */ + enum Hand + { + //! Needle displaying the seconds + SecondHand, + + //! Needle displaying the minutes + MinuteHand, + + //! Needle displaying the hours + HourHand, + + //! Number of needles + NHands + }; + + explicit QwtAnalogClock( QWidget* parent /TransferThis/ = NULL ); + virtual ~QwtAnalogClock(); + + void setHand( Hand, QwtDialNeedle * /Transfer/); + + //const QwtDialNeedle *hand( Hand ) const; + QwtDialNeedle *hand( Hand ); + +public Q_SLOTS: + void setCurrentTime(); + void setTime( const QTime & ); + +protected: + virtual void drawNeedle( QPainter *, const QPointF &, + double radius, double direction, QPalette::ColorGroup ) const; + + virtual void drawHand( QPainter *, Hand, const QPointF &, + double radius, double direction, QPalette::ColorGroup ) const; + +private: + // use setHand instead + void setNeedle( QwtDialNeedle * ); + + //QwtDialNeedle *d_hand[NHands]; +}; diff -Nru pyqt-qwt-1.01.00/sip/qwt_compass_rose.sip pyqt-qwt-1.02.00/sip/qwt_compass_rose.sip --- pyqt-qwt-1.01.00/sip/qwt_compass_rose.sip 1970-01-01 00:00:00.000000000 +0000 +++ pyqt-qwt-1.02.00/sip/qwt_compass_rose.sip 2019-02-23 12:55:34.000000000 +0000 @@ -0,0 +1,82 @@ +/* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** + * Qwt Widget Library + * Copyright (C) 1997 Josef Wilgen + * Copyright (C) 2002 Uwe Rathmann + * Copyright (C) 2018 Gudjon I. Gudjonsson + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the Qwt License, Version 1.0 + *****************************************************************************/ + +//class QPainter; + +/*! + \brief Abstract base class for a compass rose +*/ +class QwtCompassRose +{ +%TypeHeaderCode +#include +%End +public: + //! Destructor + virtual ~QwtCompassRose(); + + //! Assign a palette + virtual void setPalette( const QPalette &p ); + + //! \return Current palette + const QPalette &palette() const; + + /*! + Draw the rose + + \param painter Painter + \param center Center point + \param radius Radius of the rose + \param north Position + \param colorGroup Color group + */ + virtual void draw( QPainter *painter, + const QPointF ¢er, double radius, double north, + QPalette::ColorGroup colorGroup = QPalette::Active ) const = 0; + +//private: +// QPalette d_palette; +}; + +/*! + \brief A simple rose for QwtCompass +*/ +class QwtSimpleCompassRose: QwtCompassRose +{ +%TypeHeaderCode +#include +%End +public: + QwtSimpleCompassRose( int numThorns = 8, int numThornLevels = -1 ); + virtual ~QwtSimpleCompassRose(); + + void setWidth( double w ); + double width() const; + + void setNumThorns( int count ); + int numThorns() const; + + void setNumThornLevels( int count ); + int numThornLevels() const; + + void setShrinkFactor( double factor ); + double shrinkFactor() const; + + virtual void draw( QPainter *, const QPointF ¢er, double radius, + double north, QPalette::ColorGroup = QPalette::Active ) const; + + static void drawRose( QPainter *, const QPalette &, + const QPointF ¢er, double radius, double origin, double width, + int numThorns, int numThornLevels, double shrinkFactor ); + +/*private: + class PrivateData; + PrivateData *d_data;*/ +}; diff -Nru pyqt-qwt-1.01.00/sip/qwt_compass.sip pyqt-qwt-1.02.00/sip/qwt_compass.sip --- pyqt-qwt-1.01.00/sip/qwt_compass.sip 1970-01-01 00:00:00.000000000 +0000 +++ pyqt-qwt-1.02.00/sip/qwt_compass.sip 2019-02-23 12:55:34.000000000 +0000 @@ -0,0 +1,79 @@ +/* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** + * Qwt Widget Library + * Copyright (C) 1997 Josef Wilgen + * Copyright (C) 2002 Uwe Rathmann + * Copyright (C) 2018 Gudjon I. Gudjonsson + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the Qwt License, Version 1.0 + *****************************************************************************/ + +//class QwtCompassRose; + +/*! + \brief A special scale draw made for QwtCompass + + QwtCompassScaleDraw maps values to strings using + a special map, that can be modified by the application + + The default map consists of the labels N, NE, E, SE, S, SW, W, NW. + + \sa QwtCompass +*/ + + +class QwtCompassScaleDraw: QwtRoundScaleDraw +{ +%TypeHeaderCode +#include +%End +public: + explicit QwtCompassScaleDraw(); + explicit QwtCompassScaleDraw( const QMap &map ); + + void setLabelMap( const QMap &map ); + QMap labelMap() const; + + virtual QwtText label( double value ) const; + +//private: +// QMap d_labelMap; +}; + +/*! + \brief A Compass Widget + + QwtCompass is a widget to display and enter directions. It consists + of a scale, an optional needle and rose. + + \image html dials1.png + + \note The examples/dials example shows how to use QwtCompass. +*/ + +class QwtCompass: QwtDial +{ +%TypeHeaderCode +#include +%End +public: + explicit QwtCompass( QWidget* parent /TransferThis/ = NULL ); + virtual ~QwtCompass(); + + void setRose( QwtCompassRose *rose /Transfer/); + //const QwtCompassRose *rose() const; + QwtCompassRose *rose(); + +protected: + virtual void drawRose( QPainter *, const QPointF ¢er, + double radius, double north, QPalette::ColorGroup ) const; + + virtual void drawScaleContents( QPainter *, + const QPointF ¢er, double radius ) const; + + virtual void keyPressEvent( QKeyEvent * ); + +//private: +// class PrivateData; +// PrivateData *d_data; +}; diff -Nru pyqt-qwt-1.01.00/sip/qwt_dial_needle.sip pyqt-qwt-1.02.00/sip/qwt_dial_needle.sip --- pyqt-qwt-1.01.00/sip/qwt_dial_needle.sip 1970-01-01 00:00:00.000000000 +0000 +++ pyqt-qwt-1.02.00/sip/qwt_dial_needle.sip 2019-02-23 12:55:34.000000000 +0000 @@ -0,0 +1,189 @@ +/* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** + * Qwt Widget Library + * Copyright (C) 1997 Josef Wilgen + * Copyright (C) 2002 Uwe Rathmann + * Copyright (C) 2018 Gudjon I. Gudjonsson + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the Qwt License, Version 1.0 + *****************************************************************************/ + +/*! + \brief Base class for needles that can be used in a QwtDial. + + QwtDialNeedle is a pointer that indicates a value by pointing + to a specific direction. + + \sa QwtDial, QwtCompass +*/ + +class QwtDialNeedle +{ +%TypeHeaderCode +#include +%End +public: + QwtDialNeedle(); + virtual ~QwtDialNeedle(); + + virtual void setPalette( const QPalette & ); + const QPalette &palette() const; + + virtual void draw( QPainter *painter, const QPointF ¢er, + double length, double direction, + QPalette::ColorGroup = QPalette::Active ) const; + +protected: + /*! + \brief Draw the needle + + The origin of the needle is at position (0.0, 0.0 ) + pointing in direction 0.0 ( = east ). + + The painter is already initialized with translation and + rotation. + + \param painter Painter + \param length Length of the needle + \param colorGroup Color group, used for painting + + \sa setPalette(), palette() + */ + virtual void drawNeedle( QPainter *painter, + double length, QPalette::ColorGroup colorGroup ) const = 0; + + virtual void drawKnob( QPainter *, double width, + const QBrush &, bool sunken ) const; + +//private: +// QPalette d_palette; +}; + +/*! + \brief A needle for dial widgets + + The following colors are used: + + - QPalette::Mid\n + Pointer + - QPalette::Base\n + Knob + + \sa QwtDial, QwtCompass +*/ + +class QwtDialSimpleNeedle: QwtDialNeedle +{ +%TypeHeaderCode +#include +%End +public: + //! Style of the needle + enum Style + { + //! Arrow + Arrow, + + //! A straight line from the center + Ray + }; + + QwtDialSimpleNeedle( Style, bool hasKnob = true, + const QColor &mid = Qt::gray, const QColor &base = Qt::darkGray ); + + void setWidth( double width ); + double width() const; + +protected: + virtual void drawNeedle( QPainter *, double length, + QPalette::ColorGroup ) const; + +/*private: + Style d_style; + bool d_hasKnob; + double d_width;*/ +}; + +/*! + \brief A magnet needle for compass widgets + + A magnet needle points to two opposite directions indicating + north and south. + + The following colors are used: + - QPalette::Light\n + Used for pointing south + - QPalette::Dark\n + Used for pointing north + - QPalette::Base\n + Knob (ThinStyle only) + + \sa QwtDial, QwtCompass +*/ + +class QwtCompassMagnetNeedle: QwtDialNeedle +{ +%TypeHeaderCode +#include +%End +public: + //! Style of the needle + enum Style + { + //! A needle with a triangular shape + TriangleStyle, + + //! A thin needle + ThinStyle + }; + + QwtCompassMagnetNeedle( Style = TriangleStyle, + const QColor &light = Qt::white, const QColor &dark = Qt::red ); + +protected: + virtual void drawNeedle( QPainter *, + double length, QPalette::ColorGroup ) const; + +//private: +// Style d_style; +}; + +/*! + \brief An indicator for the wind direction + + QwtCompassWindArrow shows the direction where the wind comes from. + + - QPalette::Light\n + Used for Style1, or the light half of Style2 + - QPalette::Dark\n + Used for the dark half of Style2 + + \sa QwtDial, QwtCompass +*/ + +class QwtCompassWindArrow: QwtDialNeedle +{ +%TypeHeaderCode +#include +%End +public: + //! Style of the arrow + enum Style + { + //! A needle pointing to the center + Style1, + + //! A needle pointing to the center + Style2 + }; + + QwtCompassWindArrow( Style, const QColor &light = Qt::white, + const QColor &dark = Qt::gray ); + +protected: + virtual void drawNeedle( QPainter *, + double length, QPalette::ColorGroup ) const; + +//private: +// Style d_style; +}; diff -Nru pyqt-qwt-1.01.00/sip/qwt_dial.sip pyqt-qwt-1.02.00/sip/qwt_dial.sip --- pyqt-qwt-1.01.00/sip/qwt_dial.sip 1970-01-01 00:00:00.000000000 +0000 +++ pyqt-qwt-1.02.00/sip/qwt_dial.sip 2019-02-23 12:55:34.000000000 +0000 @@ -0,0 +1,161 @@ +/* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** + * Qwt Widget Library + * Copyright (C) 1997 Josef Wilgen + * Copyright (C) 2002 Uwe Rathmann + * Copyright (C) 2018 Gudjon I. Gudjonsson + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the Qwt License, Version 1.0 + *****************************************************************************/ + +/*! + \brief QwtDial class provides a rounded range control. + + QwtDial is intended as base class for dial widgets like + speedometers, compass widgets, clocks ... + + \image html dials2.png + + A dial contains a scale and a needle indicating the current value + of the dial. Depending on Mode one of them is fixed and the + other is rotating. If not isReadOnly() the + dial can be rotated by dragging the mouse or using keyboard inputs + (see QwtAbstractSlider::keyPressEvent()). A dial might be wrapping, what means + a rotation below/above one limit continues on the other limit (f.e compass). + The scale might cover any arc of the dial, its values are related to + the origin() of the dial. + + Often dials have to be updated very often according to values from external + devices. For these high refresh rates QwtDial caches as much as possible. + For derived classes it might be necessary to clear these caches manually + according to attribute changes using invalidateCache(). + + \sa QwtCompass, QwtAnalogClock, QwtDialNeedle + \note The controls and dials examples shows different types of dials. + \note QDial is more similar to QwtKnob than to QwtDial +*/ + +class QwtDial: QwtAbstractSlider +{ +%TypeHeaderCode +#include +%End + + /* + Q_ENUMS( Shadow Mode Direction ) + + Q_PROPERTY( int lineWidth READ lineWidth WRITE setLineWidth ) + Q_PROPERTY( Shadow frameShadow READ frameShadow WRITE setFrameShadow ) + Q_PROPERTY( Mode mode READ mode WRITE setMode ) + Q_PROPERTY( double origin READ origin WRITE setOrigin ) + Q_PROPERTY( double minScaleArc READ minScaleArc WRITE setMinScaleArc ) + Q_PROPERTY( double maxScaleArc READ maxScaleArc WRITE setMaxScaleArc ) + */ + +public: + + /*! + \brief Frame shadow + + Unfortunately it is not possible to use QFrame::Shadow + as a property of a widget that is not derived from QFrame. + The following enum is made for the designer only. It is safe + to use QFrame::Shadow instead. + */ + enum Shadow + { + //! QFrame::Plain + Plain = QFrame::Plain, + + //! QFrame::Raised + Raised = QFrame::Raised, + + //! QFrame::Sunken + Sunken = QFrame::Sunken + }; + + //! Mode controlling whether the needle or the scale is rotating + enum Mode + { + //! The needle is rotating + RotateNeedle, + + //! The needle is fixed, the scales are rotating + RotateScale + }; + + explicit QwtDial( QWidget *parent /TransferThis/ = NULL ); + virtual ~QwtDial(); + + void setFrameShadow( Shadow ); + Shadow frameShadow() const; + + void setLineWidth( int ); + int lineWidth() const; + + void setMode( Mode ); + Mode mode() const; + + void setScaleArc( double min, double max ); + + void setMinScaleArc( double min ); + double minScaleArc() const; + + void setMaxScaleArc( double min ); + double maxScaleArc() const; + + virtual void setOrigin( double ); + double origin() const; + + void setNeedle( QwtDialNeedle * /Transfer/); + //const QwtDialNeedle *needle() const; + QwtDialNeedle *needle(); + + QRect boundingRect() const; + QRect innerRect() const; + + virtual QRect scaleInnerRect() const; + + virtual QSize sizeHint() const; + virtual QSize minimumSizeHint() const; + + void setScaleDraw( QwtRoundScaleDraw * /Transfer/); + + QwtRoundScaleDraw *scaleDraw(); + //const QwtRoundScaleDraw *scaleDraw() const; + +protected: + virtual void wheelEvent( QWheelEvent * ); + virtual void paintEvent( QPaintEvent * ); + virtual void changeEvent( QEvent * ); + + virtual void drawFrame( QPainter *p ); + virtual void drawContents( QPainter * ) const; + virtual void drawFocusIndicator( QPainter * ) const; + + void invalidateCache(); + + virtual void drawScale( QPainter *, + const QPointF ¢er, double radius ) const; + + virtual void drawScaleContents( QPainter *painter, + const QPointF ¢er, double radius ) const; + + virtual void drawNeedle( QPainter *, const QPointF &, + double radius, double direction, QPalette::ColorGroup ) const; + + virtual double scrolledTo( const QPoint & ) const; + virtual bool isScrollPosition( const QPoint & ) const; + + virtual void sliderChange(); + virtual void scaleChange(); + +private: + void setAngleRange( double angle, double span ); + void drawNeedle( QPainter * ) const; + + //class PrivateData; + //PrivateData *d_data; +}; + +//#endif diff -Nru pyqt-qwt-1.01.00/sip/qwt_legend_data.sip pyqt-qwt-1.02.00/sip/qwt_legend_data.sip --- pyqt-qwt-1.01.00/sip/qwt_legend_data.sip 2018-09-01 08:10:52.000000000 +0000 +++ pyqt-qwt-1.02.00/sip/qwt_legend_data.sip 2019-02-23 12:55:34.000000000 +0000 @@ -45,17 +45,17 @@ QwtLegendData(); ~QwtLegendData(); - //void setValues( const QMap & );XXX unsupported function argument type - provide %MethodCode and a C++ signature - //const QMap &values() const; + void setValues( const QMap & ); + const QMap &values() const; - //void setValue( int role, const QVariant & ); - //QVariant value( int role ) const; + void setValue( int role, const QVariant & ); + QVariant value( int role ) const; bool hasRole( int role ) const; bool isValid() const; - //QwtGraphic icon() const; - //QwtText title() const; + QwtGraphic icon() const; + QwtText title() const; Mode mode() const; //private: diff -Nru pyqt-qwt-1.01.00/sip/qwt_plot_canvas.sip pyqt-qwt-1.02.00/sip/qwt_plot_canvas.sip --- pyqt-qwt-1.01.00/sip/qwt_plot_canvas.sip 2018-09-01 08:10:52.000000000 +0000 +++ pyqt-qwt-1.02.00/sip/qwt_plot_canvas.sip 2019-02-23 12:55:34.000000000 +0000 @@ -9,11 +9,25 @@ *****************************************************************************/ //class QwtPlot; //class QPixmap; +%ModuleHeaderCode +// fix to allow compilation with sip that for some reason +// doesn't add this include to the file where the code from +// ConvertToSubClassCode goes. +#include +%End + + class QwtPlotCanvas : QFrame { %TypeHeaderCode #include %End +%ConvertToSubClassCode + if ( qobject_cast( sipCpp ) ) + sipType = sipType_QwtPlotCanvas; + else + sipType = NULL; +%End // Q_OBJECT // Q_PROPERTY( double borderRadius READ borderRadius WRITE setBorderRadius ) diff -Nru pyqt-qwt-1.01.00/sip/qwt_plot_curve.sip pyqt-qwt-1.02.00/sip/qwt_plot_curve.sip --- pyqt-qwt-1.01.00/sip/qwt_plot_curve.sip 2018-09-01 08:10:52.000000000 +0000 +++ pyqt-qwt-1.02.00/sip/qwt_plot_curve.sip 2019-02-23 12:55:34.000000000 +0000 @@ -188,6 +188,7 @@ void setRawSamples( const double *xData, const double *yData, int size ); void setSamples( const double *xData, const double *yData, int size ); void setSamples( const QVector &xData, const QVector &yData ); + void setSamples( const QPolygonF & ); void setSamples( const QVector & ); void setSamples( QwtSeriesDataQPointF * ); diff -Nru pyqt-qwt-1.01.00/sip/qwt_point_polar.sip pyqt-qwt-1.02.00/sip/qwt_point_polar.sip --- pyqt-qwt-1.01.00/sip/qwt_point_polar.sip 1970-01-01 00:00:00.000000000 +0000 +++ pyqt-qwt-1.02.00/sip/qwt_point_polar.sip 2019-02-23 12:55:34.000000000 +0000 @@ -0,0 +1,101 @@ +/* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** + * Qwt Widget Library + * Copyright (C) 1997 Josef Wilgen + * Copyright (C) 2002 Uwe Rathmann + * Copyright (C) 2018 Gudjon I. Gudjonsson + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the Qwt License, Version 1.0 + *****************************************************************************/ + + +/*! + \brief A point in polar coordinates + + In polar coordinates a point is determined by an angle and a distance. + See http://en.wikipedia.org/wiki/Polar_coordinate_system +*/ + +class QwtPointPolar +{ +%TypeHeaderCode +#include +%End + +public: + QwtPointPolar(); + QwtPointPolar( double azimuth, double radius ); + QwtPointPolar( const QwtPointPolar & ); + QwtPointPolar( const QPointF & ); + + void setPoint( const QPointF & ); + QPointF toPoint() const; + + bool isValid() const; + bool isNull() const; + + double radius() const; + double azimuth() const; + + //double &rRadius(); + //double &rAzimuth(); + + void setRadius( double ); + void setAzimuth( double ); + + bool operator==( const QwtPointPolar & ) const; + bool operator!=( const QwtPointPolar & ) const; + + QwtPointPolar normalized() const; + +/*private: + double d_azimuth; + double d_radius;*/ +}; + +/*! + Constructs a null point, with a radius and azimuth set to 0.0. + \sa QPointF::isNull() +*/ +//inline QwtPointPolar::QwtPointPolar(); +/*! + Constructs a point with coordinates specified by radius and azimuth. + + \param azimuth Azimuth + \param radius Radius +*/ +/*inline QwtPointPolar::QwtPointPolar( double azimuth, double radius ): + d_azimuth( azimuth ), + d_radius( radius ); +/*! + Constructs a point using the values of the point specified. + \param other Other point +*/ +//inline QwtPointPolar::QwtPointPolar( const QwtPointPolar &other ); +//! Returns true if radius() >= 0.0 +//inline bool QwtPointPolar::isValid() const; +//! Returns true if radius() >= 0.0 +//inline bool QwtPointPolar::isNull() const; +//! Returns the radius. +//inline double QwtPointPolar::radius() const; +//! Returns the azimuth. +//inline double QwtPointPolar::azimuth() const; +//! Returns the radius. +//inline double &QwtPointPolar::rRadius(); +//! Returns the azimuth. +//inline double &QwtPointPolar::rAzimuth(); +//! Sets the radius to radius. +//inline void QwtPointPolar::setRadius( double radius ); +//! Sets the atimuth to atimuth. +//inline void QwtPointPolar::setAzimuth( double azimuth ); +//#ifndef QT_NO_DEBUG_STREAM +//QWT_EXPORT QDebug operator<<( QDebug, const QwtPointPolar & ); +//#endif +/*inline QPoint qwtPolar2Pos( const QPoint &pole, double radius, double angle ); +inline QPoint qwtDegree2Pos( const QPoint &pole, double radius, double angle ); +inline QPointF qwtPolar2Pos( const QPointF &pole, double radius, double angle ); +inline QPointF qwtDegree2Pos( const QPointF &pole, double radius, double angle ); +inline QPointF qwtFastPolar2Pos( const QPointF &pole, double radius, double angle ); +inline QPointF qwtFastDegree2Pos( const QPointF &pole, double radius, double angle ); +inline QwtPointPolar qwtFastPos2Polar( const QPointF &pos ); +*/ diff -Nru pyqt-qwt-1.01.00/sip/qwt_round_scale_draw.sip pyqt-qwt-1.02.00/sip/qwt_round_scale_draw.sip --- pyqt-qwt-1.01.00/sip/qwt_round_scale_draw.sip 2018-09-01 08:10:52.000000000 +0000 +++ pyqt-qwt-1.02.00/sip/qwt_round_scale_draw.sip 2019-02-23 12:55:34.000000000 +0000 @@ -1,18 +1,32 @@ -/* - * python-qwt. Python wrapper for the Qwt Widget Library +/* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** + * Qwt Widget Library * Copyright (C) 1997 Josef Wilgen * Copyright (C) 2002 Uwe Rathmann - * Copyright (C) 2015 Gudjon I. Gudjonsson * * This library is free software; you can redistribute it and/or * modify it under the terms of the Qwt License, Version 1.0 *****************************************************************************/ + +/*! + \brief A class for drawing round scales + + QwtRoundScaleDraw can be used to draw round scales. + The circle segment can be adjusted by setAngleRange(). + The geometry of the scale can be specified with + moveCenter() and setRadius(). + + After a scale division has been specified as a QwtScaleDiv object + using QwtAbstractScaleDraw::setScaleDiv(const QwtScaleDiv &s), + the scale can be drawn with the QwtAbstractScaleDraw::draw() member. +*/ + class QwtRoundScaleDraw: QwtAbstractScaleDraw { %TypeHeaderCode #include %End + public: QwtRoundScaleDraw(); virtual ~QwtRoundScaleDraw(); @@ -35,8 +49,16 @@ private: QwtRoundScaleDraw( const QwtRoundScaleDraw & ); - /*QwtRoundScaleDraw &operator=( const QwtRoundScaleDraw &other ); + //QwtRoundScaleDraw &operator=( const QwtRoundScaleDraw &other ); - class PrivateData; - PrivateData *d_data;*/ + //class PrivateData; + //PrivateData *d_data; }; + +//! Move the center of the scale draw, leaving the radius unchanged +/*inline void QwtRoundScaleDraw::moveCenter( double x, double y ) +{ + moveCenter( QPointF( x, y ) ); +}*/ + +//#endif diff -Nru pyqt-qwt-1.01.00/sip/qwt.sip pyqt-qwt-1.02.00/sip/qwt.sip --- pyqt-qwt-1.01.00/sip/qwt.sip 2018-09-01 08:10:52.000000000 +0000 +++ pyqt-qwt-1.02.00/sip/qwt.sip 2019-02-23 12:55:34.000000000 +0000 @@ -17,7 +17,9 @@ %Import QtWidgets/QtWidgetsmod.sip %End + %Include conversions.sip +%Include qmap_convert.sip %Include qwt_legend.sip %Include qwt_legend_data.sip @@ -99,3 +101,14 @@ %Include qwt_slider.sip %Include qwt_transform.sip +%Include qwt_dial_needle.sip +%Include qwt_dial.sip +%Include qwt_round_scale_draw.sip +%Include qwt_compass_rose.sip +%Include qwt_compass.sip + +%Include qwt_point_polar.sip +%Include qwt_analog_clock.sip + + +