Skip to content
This repository has been archived by the owner on Aug 21, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Compatibility fixes with python 3.10
Signed-off-by: falkTX <falktx@falktx.com>
  • Loading branch information
falkTX committed Jun 18, 2022
1 parent c810989 commit e8172cd
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 16 deletions.
8 changes: 3 additions & 5 deletions src/canvaspreviewframe.py
Expand Up @@ -166,6 +166,9 @@ def mouseReleaseEvent(self, event):
QFrame.mouseReleaseEvent(self, event)

def paintEvent(self, event):
if not self.fUseCustomPaint:
QFrame.paintEvent(self, event)

painter = QPainter(self)

if self.fUseCustomPaint:
Expand Down Expand Up @@ -200,11 +203,6 @@ def paintEvent(self, event):
painter.setPen(self.fViewPen)
painter.drawRect(QRectF(self.fViewRect[iX], self.fViewRect[iY], maxWidth, maxHeight))

if self.fUseCustomPaint:
event.accept()
else:
QFrame.paintEvent(self, event)

def resizeEvent(self, event):
self.fRenderSource = self.getRenderSource()

Expand Down
11 changes: 6 additions & 5 deletions src/claudia.py
Expand Up @@ -2160,13 +2160,13 @@ def slot_verticalScrollBarChanged(self, value):
@pyqtSlot()
def slot_miniCanvasInit(self):
settings = QSettings()
self.ui.graphicsView.horizontalScrollBar().setValue(settings.value("HorizontalScrollBarValue", DEFAULT_CANVAS_WIDTH / 3, type=int))
self.ui.graphicsView.verticalScrollBar().setValue(settings.value("VerticalScrollBarValue", DEFAULT_CANVAS_HEIGHT * 3 / 8, type=int))
self.ui.graphicsView.horizontalScrollBar().setValue(settings.value("HorizontalScrollBarValue", int(DEFAULT_CANVAS_WIDTH / 3), type=int))
self.ui.graphicsView.verticalScrollBar().setValue(settings.value("VerticalScrollBarValue", int(DEFAULT_CANVAS_HEIGHT * 3 / 8), type=int))

@pyqtSlot(float, float)
def slot_miniCanvasMoved(self, xp, yp):
self.ui.graphicsView.horizontalScrollBar().setValue(xp * DEFAULT_CANVAS_WIDTH)
self.ui.graphicsView.verticalScrollBar().setValue(yp * DEFAULT_CANVAS_HEIGHT)
self.ui.graphicsView.horizontalScrollBar().setValue(int(xp * DEFAULT_CANVAS_WIDTH))
self.ui.graphicsView.verticalScrollBar().setValue(int(yp * DEFAULT_CANVAS_HEIGHT))

@pyqtSlot()
def slot_miniCanvasCheckAll(self):
Expand All @@ -2176,7 +2176,8 @@ def slot_miniCanvasCheckAll(self):

@pyqtSlot()
def slot_miniCanvasCheckSize(self):
self.ui.miniCanvasPreview.setViewSize(float(self.ui.graphicsView.width()) / DEFAULT_CANVAS_WIDTH, float(self.ui.graphicsView.height()) / DEFAULT_CANVAS_HEIGHT)
self.ui.miniCanvasPreview.setViewSize(float(self.ui.graphicsView.width()) / DEFAULT_CANVAS_WIDTH,
float(self.ui.graphicsView.height()) / DEFAULT_CANVAS_HEIGHT)

@pyqtSlot()
def slot_handleCrash_jack(self):
Expand Down
2 changes: 1 addition & 1 deletion src/jacksettings.py
Expand Up @@ -406,7 +406,7 @@ def loadServerSettings(self, reset=False, forceReset=False):
elif attribute == "client-timeout":
self.setComboBoxValue(self.ui.obj_server_client_timeout, str(int(value)))
elif attribute == "clock-source":
if len(str(value)) == 1 :
if len(str(value)) == 1 and not isinstance(value, dbus.UInt32):
value = str(value)
if value == "c":
self.ui.obj_server_clock_source_cycle.setChecked(True)
Expand Down
6 changes: 3 additions & 3 deletions src/patchcanvas.py
Expand Up @@ -2480,16 +2480,16 @@ def paint(self, painter, option, widget):
else:
painter.setBrush(canvas.theme.box_bg_1)

painter.drawRect(0, 0, self.p_width, self.p_height)
painter.drawRect(QRectF(0, 0, self.p_width, self.p_height))

# Draw pixmap header
if canvas.theme.box_header_pixmap:
painter.setPen(Qt.NoPen)
painter.setBrush(canvas.theme.box_bg_2)
painter.drawRect(1, 1, self.p_width-2, canvas.theme.box_header_height)
painter.drawRect(QRectF(1, 1, self.p_width-2, canvas.theme.box_header_height))

headerPos = QPointF(1, 1)
headerRect = QRectF(2, 2, self.p_width-4, canvas.theme.box_header_height-3)
headerRect = QRectF(2, 2, int(self.p_width-4), canvas.theme.box_header_height-3)
painter.drawTiledPixmap(headerRect, canvas.theme.box_header_pixmap, headerPos)

# Draw text
Expand Down
2 changes: 1 addition & 1 deletion src/render.py
Expand Up @@ -349,7 +349,7 @@ def slot_transportChecked(self, yesNo):

@pyqtSlot()
def slot_updateProgressbar(self):
time = int(jacklib.get_current_transport_frame(self.fJackClient)) / self.fSampleRate
time = int(int(jacklib.get_current_transport_frame(self.fJackClient)) / self.fSampleRate)
self.ui.progressBar.setValue(time)

if time > self.fMaxTime or (self.fLastTime > time and not self.fFreewheel):
Expand Down
2 changes: 1 addition & 1 deletion src/shared_canvasjack.py
Expand Up @@ -515,7 +515,7 @@ def slot_canvasSaveImage(self):
imgFormat = "PNG"
newPath += ".png"

self.fExportImage = QImage(self.scene.sceneRect().width(), self.scene.sceneRect().height(), QImage.Format_RGB32)
self.fExportImage = QImage(int(self.scene.sceneRect().width()), int(self.scene.sceneRect().height()), QImage.Format_RGB32)
painter = QPainter(self.fExportImage)
painter.save()
painter.setRenderHint(QPainter.Antialiasing, True)
Expand Down

0 comments on commit e8172cd

Please sign in to comment.