summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2018-06-18 13:15:27 +0200
committerCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2018-06-18 11:52:55 +0000
commit5d88488592f55aa8d81b3256a4e76cfdf1a7f050 (patch)
tree11a197a6fb2b17747edee52bfcd8e2a11e843207
parent59694f8bf1c2f81c00d15fffef3060509d2a4b63 (diff)
Remove semicolon from examples
Task-number: PYSIDE-712 Change-Id: Ib91e4fec88bdb7146e54c285c7f4da60deecb6cf Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r--examples/3d/simple3d.py2
-rw-r--r--examples/datavisualization/bars3d.py10
-rwxr-xr-xexamples/macextras/macpasteboardmime.py2
-rw-r--r--examples/multimedia/player.py8
-rw-r--r--examples/opengl/contextinfo.py52
-rw-r--r--examples/tutorial/t10.py4
-rw-r--r--examples/tutorial/t11.py6
-rw-r--r--examples/tutorial/t12.py6
-rw-r--r--examples/tutorial/t13.py6
-rw-r--r--examples/tutorial/t14.py8
-rw-r--r--examples/tutorial/t8.py2
-rw-r--r--examples/tutorial/t9.py2
-rw-r--r--examples/widgets/animation/easing/easing.py2
-rw-r--r--examples/widgets/graphicsview/collidingmice/collidingmice.py4
-rwxr-xr-xexamples/widgets/graphicsview/elasticnodes.py2
-rw-r--r--examples/widgets/layouts/dynamiclayouts.py12
-rwxr-xr-xexamples/widgets/mainwindows/application/application.py4
-rwxr-xr-xexamples/widgets/richtext/syntaxhighlighter.py2
18 files changed, 67 insertions, 67 deletions
diff --git a/examples/3d/simple3d.py b/examples/3d/simple3d.py
index e4b06132..b97ee79d 100644
--- a/examples/3d/simple3d.py
+++ b/examples/3d/simple3d.py
@@ -82,7 +82,7 @@ class OrbitTransformController(QObject):
return self._angle
def updateMatrix(self):
- self._matrix.setToIdentity();
+ self._matrix.setToIdentity()
self._matrix.rotate(self._angle, QVector3D(0, 1, 0))
self._matrix.translate(self._radius, 0, 0)
if self._target is not None:
diff --git a/examples/datavisualization/bars3d.py b/examples/datavisualization/bars3d.py
index e8b568f2..e2fa7320 100644
--- a/examples/datavisualization/bars3d.py
+++ b/examples/datavisualization/bars3d.py
@@ -68,18 +68,18 @@ class MainWindow(QMainWindow):
self.columnAxis.setTitle('Columns')
self.columnAxis.setTitleVisible(True)
self.columnAxis.setLabels(['Column1', 'Column2'])
- self.columnAxis.setLabelAutoRotation(30);
+ self.columnAxis.setLabelAutoRotation(30)
self.rowAxis = QtDataVisualization.QCategory3DAxis()
self.rowAxis.setTitle('Rows')
self.rowAxis.setTitleVisible(True)
self.rowAxis.setLabels(['Row1', 'Row2'])
- self.rowAxis.setLabelAutoRotation(30);
+ self.rowAxis.setLabelAutoRotation(30)
self.valueAxis = QtDataVisualization.QValue3DAxis()
self.valueAxis.setTitle('Values')
self.valueAxis.setTitleVisible(True)
- self.valueAxis.setRange(0, 5);
+ self.valueAxis.setRange(0, 5)
self.bars.setRowAxis(self.rowAxis)
self.bars.setColumnAxis(self.columnAxis)
@@ -104,8 +104,8 @@ class MainWindow(QMainWindow):
size = geometry.height() * 3 / 4
self.container.setMinimumSize(size, size)
- self.container.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding);
- self.container.setFocusPolicy(Qt.StrongFocus);
+ self.container.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
+ self.container.setFocusPolicy(Qt.StrongFocus)
self.setCentralWidget(self.container)
if __name__ == '__main__':
diff --git a/examples/macextras/macpasteboardmime.py b/examples/macextras/macpasteboardmime.py
index 41271427..2e0995a2 100755
--- a/examples/macextras/macpasteboardmime.py
+++ b/examples/macextras/macpasteboardmime.py
@@ -116,7 +116,7 @@ class TestWidget(QtWidgets.QWidget):
if e.mimeData().hasFormat("application/x-mycompany-VCard"):
s = e.mimeData().data( "application/x-mycompany-VCard" )
# s now contains text of vcard
- self.label2.setText(str(s));
+ self.label2.setText(str(s))
e.acceptProposedAction()
if __name__ == '__main__':
diff --git a/examples/multimedia/player.py b/examples/multimedia/player.py
index 71604f41..3e7d9f2c 100644
--- a/examples/multimedia/player.py
+++ b/examples/multimedia/player.py
@@ -114,9 +114,9 @@ class MainWindow(QMainWindow):
self.videoWidget = QVideoWidget()
self.setCentralWidget(self.videoWidget)
- self.player.setPlaylist(self.playlist);
+ self.player.setPlaylist(self.playlist)
self.player.stateChanged.connect(self.updateButtons)
- self.player.setVideoOutput(self.videoWidget);
+ self.player.setVideoOutput(self.videoWidget)
self.updateButtons(self.player.state())
@@ -136,9 +136,9 @@ class MainWindow(QMainWindow):
# Go to previous track if we are within the first 5 seconds of playback
# Otherwise, seek to the beginning.
if self.player.position() <= 5000:
- self.playlist.previous();
+ self.playlist.previous()
else:
- player.setPosition(0);
+ player.setPosition(0)
def updateButtons(self, state):
mediaCount = self.playlist.mediaCount()
diff --git a/examples/opengl/contextinfo.py b/examples/opengl/contextinfo.py
index ef100560..9cd22965 100644
--- a/examples/opengl/contextinfo.py
+++ b/examples/opengl/contextinfo.py
@@ -109,10 +109,10 @@ colors = numpy.array([1, 0, 0, 0, 1, 0, 0, 0, 1], dtype = numpy.float32)
class RenderWindow(QWindow):
def __init__(self, format):
super(RenderWindow, self).__init__()
- self.setSurfaceType(QWindow.OpenGLSurface);
- self.setFormat(format);
- self.context = QOpenGLContext(self);
- self.context.setFormat(self.requestedFormat());
+ self.setSurfaceType(QWindow.OpenGLSurface)
+ self.setFormat(format)
+ self.context = QOpenGLContext(self)
+ self.context.setFormat(self.requestedFormat())
if not self.context.create():
raise Exception("Unable to create GL context")
self.program = None
@@ -120,12 +120,12 @@ class RenderWindow(QWindow):
self.angle = 0
def initGl(self):
- self.program = QOpenGLShaderProgram(self);
+ self.program = QOpenGLShaderProgram(self)
self.vao = QOpenGLVertexArrayObject()
self.vbo = QOpenGLBuffer()
- format = self.context.format();
- useNewStyleShader = format.profile() == QSurfaceFormat.CoreProfile;
+ format = self.context.format()
+ useNewStyleShader = format.profile() == QSurfaceFormat.CoreProfile
# Try to handle 3.0 & 3.1 that do not have the core/compatibility profile
# concept 3.2+ has. This may still fail since version 150 (3.2) is
# specified in the sources but it's worth a try.
@@ -142,31 +142,31 @@ class RenderWindow(QWindow):
if not self.program.link():
raise Exception("Could not link shaders: {}".format(self.program.log()))
- self.posAttr = self.program.attributeLocation("posAttr");
- self.colAttr = self.program.attributeLocation("colAttr");
- self.matrixUniform = self.program.uniformLocation("matrix");
+ self.posAttr = self.program.attributeLocation("posAttr")
+ self.colAttr = self.program.attributeLocation("colAttr")
+ self.matrixUniform = self.program.uniformLocation("matrix")
- self.vbo.create();
- self.vbo.bind();
+ self.vbo.create()
+ self.vbo.bind()
self.verticesData = vertices.tobytes()
self.colorsData = colors.tobytes()
verticesSize = 4 * vertices.size
colorsSize = 4 * colors.size
- self.vbo.allocate(VoidPtr(self.verticesData), verticesSize + colorsSize);
+ self.vbo.allocate(VoidPtr(self.verticesData), verticesSize + colorsSize)
self.vbo.write(verticesSize, VoidPtr(self.colorsData), colorsSize)
- self.vbo.release();
+ self.vbo.release()
vaoBinder = QOpenGLVertexArrayObject.Binder(self.vao)
if self.vao.isCreated(): # have VAO support, use it
self.setupVertexAttribs()
def setupVertexAttribs(self):
- self.vbo.bind();
- self.program.setAttributeBuffer(self.posAttr, GL.GL_FLOAT, 0, 2);
- self.program.setAttributeBuffer(self.colAttr, GL.GL_FLOAT, 4 * vertices.size, 3);
- self.program.enableAttributeArray(self.posAttr);
- self.program.enableAttributeArray(self.colAttr);
- self.vbo.release();
+ self.vbo.bind()
+ self.program.setAttributeBuffer(self.posAttr, GL.GL_FLOAT, 0, 2)
+ self.program.setAttributeBuffer(self.colAttr, GL.GL_FLOAT, 4 * vertices.size, 3)
+ self.program.enableAttributeArray(self.posAttr)
+ self.program.enableAttributeArray(self.colAttr)
+ self.vbo.release()
def exposeEvent(self, event):
if self.isExposed():
@@ -185,22 +185,22 @@ class RenderWindow(QWindow):
functions.glClearColor(0, 0, 0, 1)
self.initGl()
- functions.glViewport(0, 0, self.width(), self.height());
- functions.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
+ functions.glViewport(0, 0, self.width(), self.height())
+ functions.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT)
- self.program.bind();
+ self.program.bind()
matrix = QMatrix4x4()
matrix.perspective(60, 4 / 3, 0.1, 100)
matrix.translate(0, 0, -2)
matrix.rotate(self.angle, 0, 1, 0)
- self.program.setUniformValue(self.matrixUniform, matrix);
+ self.program.setUniformValue(self.matrixUniform, matrix)
if self.vao.isCreated():
- self.vao.bind();
+ self.vao.bind()
else: # no VAO support, set the vertex attribute arrays now
self.setupVertexAttribs()
- functions.glDrawArrays(GL.GL_TRIANGLES, 0, 3);
+ functions.glDrawArrays(GL.GL_TRIANGLES, 0, 3)
self.vao.release()
self.program.release()
diff --git a/examples/tutorial/t10.py b/examples/tutorial/t10.py
index f49faa1b..baf3884a 100644
--- a/examples/tutorial/t10.py
+++ b/examples/tutorial/t10.py
@@ -105,7 +105,7 @@ class CannonField(QtWidgets.QWidget):
if angle < 5:
angle = 5
if angle > 70:
- angle = 70;
+ angle = 70
if self.currentAngle == angle:
return
self.currentAngle = angle
@@ -121,7 +121,7 @@ class CannonField(QtWidgets.QWidget):
force = 0
if self.currentForce == force:
return
- self.currentForce = force;
+ self.currentForce = force
self.emit(QtCore.SIGNAL("forceChanged(int)"), self.currentForce)
def paintEvent(self, event):
diff --git a/examples/tutorial/t11.py b/examples/tutorial/t11.py
index 46e24e0d..b028fc22 100644
--- a/examples/tutorial/t11.py
+++ b/examples/tutorial/t11.py
@@ -112,7 +112,7 @@ class CannonField(QtWidgets.QWidget):
if angle < 5:
angle = 5
if angle > 70:
- angle = 70;
+ angle = 70
if self.currentAngle == angle:
return
self.currentAngle = angle
@@ -128,7 +128,7 @@ class CannonField(QtWidgets.QWidget):
force = 0
if self.currentForce == force:
return
- self.currentForce = force;
+ self.currentForce = force
self.emit(QtCore.SIGNAL("forceChanged(int)"), self.currentForce)
@QtCore.Slot()
@@ -162,7 +162,7 @@ class CannonField(QtWidgets.QWidget):
self.paintShot(painter)
def paintShot(self, painter):
- painter.setPen(QtCore.Qt.NoPen);
+ painter.setPen(QtCore.Qt.NoPen)
painter.setBrush(QtCore.Qt.black)
painter.drawRect(self.shotRect())
diff --git a/examples/tutorial/t12.py b/examples/tutorial/t12.py
index a3e1a6cf..945edbd8 100644
--- a/examples/tutorial/t12.py
+++ b/examples/tutorial/t12.py
@@ -134,7 +134,7 @@ class CannonField(QtWidgets.QWidget):
if angle < 5:
angle = 5
if angle > 70:
- angle = 70;
+ angle = 70
if self.currentAngle == angle:
return
self.currentAngle = angle
@@ -150,7 +150,7 @@ class CannonField(QtWidgets.QWidget):
force = 0
if self.currentForce == force:
return
- self.currentForce = force;
+ self.currentForce = force
self.emit(QtCore.SIGNAL("forceChanged(int)"), self.currentForce)
@QtCore.Slot()
@@ -201,7 +201,7 @@ class CannonField(QtWidgets.QWidget):
self.paintTarget(painter)
def paintShot(self, painter):
- painter.setPen(QtCore.Qt.NoPen);
+ painter.setPen(QtCore.Qt.NoPen)
painter.setBrush(QtCore.Qt.black)
painter.drawRect(self.shotRect())
diff --git a/examples/tutorial/t13.py b/examples/tutorial/t13.py
index a26db073..706b8a52 100644
--- a/examples/tutorial/t13.py
+++ b/examples/tutorial/t13.py
@@ -139,7 +139,7 @@ class CannonField(QtWidgets.QWidget):
if angle < 5:
angle = 5
if angle > 70:
- angle = 70;
+ angle = 70
if self.currentAngle == angle:
return
self.currentAngle = angle
@@ -155,7 +155,7 @@ class CannonField(QtWidgets.QWidget):
force = 0
if self.currentForce == force:
return
- self.currentForce = force;
+ self.currentForce = force
self.emit(QtCore.SIGNAL("forceChanged(int)"), self.currentForce)
@QtCore.Slot()
@@ -229,7 +229,7 @@ class CannonField(QtWidgets.QWidget):
self.paintTarget(painter)
def paintShot(self, painter):
- painter.setPen(QtCore.Qt.NoPen);
+ painter.setPen(QtCore.Qt.NoPen)
painter.setBrush(QtCore.Qt.black)
painter.drawRect(self.shotRect())
diff --git a/examples/tutorial/t14.py b/examples/tutorial/t14.py
index caf6d183..a7a4a059 100644
--- a/examples/tutorial/t14.py
+++ b/examples/tutorial/t14.py
@@ -140,7 +140,7 @@ class CannonField(QtWidgets.QWidget):
if angle < 5:
angle = 5
if angle > 70:
- angle = 70;
+ angle = 70
if self.currentAngle == angle:
return
self.currentAngle = angle
@@ -156,7 +156,7 @@ class CannonField(QtWidgets.QWidget):
force = 0
if self.currentForce == force:
return
- self.currentForce = force;
+ self.currentForce = force
self.emit(QtCore.SIGNAL("forceChanged(int)"), self.currentForce)
@QtCore.Slot()
@@ -234,7 +234,7 @@ class CannonField(QtWidgets.QWidget):
def mouseReleaseEvent(self, event):
if event.button() == QtCore.Qt.LeftButton:
- self.barrelPressed = False;
+ self.barrelPressed = False
def paintEvent(self, event):
painter = QtGui.QPainter(self)
@@ -252,7 +252,7 @@ class CannonField(QtWidgets.QWidget):
self.paintTarget(painter)
def paintShot(self, painter):
- painter.setPen(QtCore.Qt.NoPen);
+ painter.setPen(QtCore.Qt.NoPen)
painter.setBrush(QtCore.Qt.black)
painter.drawRect(self.shotRect())
diff --git a/examples/tutorial/t8.py b/examples/tutorial/t8.py
index 0c682df1..e203ed8a 100644
--- a/examples/tutorial/t8.py
+++ b/examples/tutorial/t8.py
@@ -103,7 +103,7 @@ class CannonField(QtWidgets.QWidget):
if angle < 5:
angle = 5
if angle > 70:
- angle = 70;
+ angle = 70
if self.currentAngle == angle:
return
self.currentAngle = angle
diff --git a/examples/tutorial/t9.py b/examples/tutorial/t9.py
index dc2106d9..d4640744 100644
--- a/examples/tutorial/t9.py
+++ b/examples/tutorial/t9.py
@@ -103,7 +103,7 @@ class CannonField(QtWidgets.QWidget):
if angle < 5:
angle = 5
if angle > 70:
- angle = 70;
+ angle = 70
if self.currentAngle == angle:
return
self.currentAngle = angle
diff --git a/examples/widgets/animation/easing/easing.py b/examples/widgets/animation/easing/easing.py
index 6a37d46d..8bb74254 100644
--- a/examples/widgets/animation/easing/easing.py
+++ b/examples/widgets/animation/easing/easing.py
@@ -173,7 +173,7 @@ class Window(QtWidgets.QWidget):
painter.drawLine(0, xAxis, self.m_iconSize.width(), xAxis)
painter.drawLine(yAxis, 0, yAxis, self.m_iconSize.height())
- curveScale = self.m_iconSize.height() / 2.0;
+ curveScale = self.m_iconSize.height() / 2.0
painter.setPen(QtCore.Qt.NoPen)
diff --git a/examples/widgets/graphicsview/collidingmice/collidingmice.py b/examples/widgets/graphicsview/collidingmice/collidingmice.py
index 575ecc1f..8bff64bc 100644
--- a/examples/widgets/graphicsview/collidingmice/collidingmice.py
+++ b/examples/widgets/graphicsview/collidingmice/collidingmice.py
@@ -90,7 +90,7 @@ class Mouse(QtWidgets.QGraphicsItem):
def shape(self):
path = QtGui.QPainterPath()
path.addRect(-10, -20, 20, 40)
- return path;
+ return path
def paint(self, painter, option, widget):
# Body.
@@ -133,7 +133,7 @@ class Mouse(QtWidgets.QGraphicsItem):
if lineToCenter.length() > 150:
angleToCenter = math.acos(lineToCenter.dx() / lineToCenter.length())
if lineToCenter.dy() < 0:
- angleToCenter = Mouse.TwoPi - angleToCenter;
+ angleToCenter = Mouse.TwoPi - angleToCenter
angleToCenter = Mouse.normalizeAngle((Mouse.Pi - angleToCenter) + Mouse.Pi / 2)
if angleToCenter < Mouse.Pi and angleToCenter > Mouse.Pi / 4:
diff --git a/examples/widgets/graphicsview/elasticnodes.py b/examples/widgets/graphicsview/elasticnodes.py
index f013156d..f640ab60 100755
--- a/examples/widgets/graphicsview/elasticnodes.py
+++ b/examples/widgets/graphicsview/elasticnodes.py
@@ -131,7 +131,7 @@ class Edge(QtWidgets.QGraphicsItem):
sourceArrowP1 = self.sourcePoint + QtCore.QPointF(math.sin(angle + Edge.Pi / 3) * self.arrowSize,
math.cos(angle + Edge.Pi / 3) * self.arrowSize)
sourceArrowP2 = self.sourcePoint + QtCore.QPointF(math.sin(angle + Edge.Pi - Edge.Pi / 3) * self.arrowSize,
- math.cos(angle + Edge.Pi - Edge.Pi / 3) * self.arrowSize);
+ math.cos(angle + Edge.Pi - Edge.Pi / 3) * self.arrowSize)
destArrowP1 = self.destPoint + QtCore.QPointF(math.sin(angle - Edge.Pi / 3) * self.arrowSize,
math.cos(angle - Edge.Pi / 3) * self.arrowSize)
destArrowP2 = self.destPoint + QtCore.QPointF(math.sin(angle - Edge.Pi + Edge.Pi / 3) * self.arrowSize,
diff --git a/examples/widgets/layouts/dynamiclayouts.py b/examples/widgets/layouts/dynamiclayouts.py
index fe46c053..77750ee1 100644
--- a/examples/widgets/layouts/dynamiclayouts.py
+++ b/examples/widgets/layouts/dynamiclayouts.py
@@ -86,27 +86,27 @@ class Dialog(QDialog):
def buttonsOrientationChanged(self, index):
- self.mainLayout.setSizeConstraint(QLayout.SetNoConstraint);
- self.setMinimumSize(0, 0);
+ self.mainLayout.setSizeConstraint(QLayout.SetNoConstraint)
+ self.setMinimumSize(0, 0)
orientation = Qt.Orientation(int(self.buttonsOrientationComboBox.itemData(index)))
if orientation == self.buttonBox.orientation():
return
- self.mainLayout.removeWidget(self.buttonBox);
+ self.mainLayout.removeWidget(self.buttonBox)
spacing = self.mainLayout.spacing()
- oldSizeHint = self.buttonBox.sizeHint() + QSize(spacing, spacing);
+ oldSizeHint = self.buttonBox.sizeHint() + QSize(spacing, spacing)
self.buttonBox.setOrientation(orientation)
newSizeHint = self.buttonBox.sizeHint() + QSize(spacing, spacing)
if orientation == Qt.Horizontal:
- self.mainLayout.addWidget(self.buttonBox, 2, 0);
+ self.mainLayout.addWidget(self.buttonBox, 2, 0)
self.resize(self.size() + QSize(-oldSizeHint.width(), newSizeHint.height()))
else:
- self.mainLayout.addWidget(self.buttonBox, 0, 3, 2, 1);
+ self.mainLayout.addWidget(self.buttonBox, 0, 3, 2, 1)
self.resize(self.size() + QSize(newSizeHint.width(), -oldSizeHint.height()))
self.mainLayout.setSizeConstraint(QLayout.SetDefaultConstraint)
diff --git a/examples/widgets/mainwindows/application/application.py b/examples/widgets/mainwindows/application/application.py
index be0dc992..78a1f994 100755
--- a/examples/widgets/mainwindows/application/application.py
+++ b/examples/widgets/mainwindows/application/application.py
@@ -161,7 +161,7 @@ class MainWindow(QtWidgets.QMainWindow):
self.fileMenu.addAction(self.openAct)
self.fileMenu.addAction(self.saveAct)
self.fileMenu.addAction(self.saveAsAct)
- self.fileMenu.addSeparator();
+ self.fileMenu.addSeparator()
self.fileMenu.addAction(self.exitAct)
self.editMenu = self.menuBar().addMenu("&Edit")
@@ -243,7 +243,7 @@ class MainWindow(QtWidgets.QMainWindow):
outf << self.textEdit.toPlainText()
QtWidgets.QApplication.restoreOverrideCursor()
- self.setCurrentFile(fileName);
+ self.setCurrentFile(fileName)
self.statusBar().showMessage("File saved", 2000)
return True
diff --git a/examples/widgets/richtext/syntaxhighlighter.py b/examples/widgets/richtext/syntaxhighlighter.py
index 6a431c3f..83621ca8 100755
--- a/examples/widgets/richtext/syntaxhighlighter.py
+++ b/examples/widgets/richtext/syntaxhighlighter.py
@@ -189,7 +189,7 @@ class Highlighter(QtGui.QSyntaxHighlighter):
self.setFormat(startIndex, commentLength,
self.multiLineCommentFormat)
startIndex = self.commentStartExpression.indexIn(text,
- startIndex + commentLength);
+ startIndex + commentLength)
if __name__ == '__main__':