Compatibility fixes with python 3.10
Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
parent
c810989ddd
commit
e8172cdf3a
|
@ -166,6 +166,9 @@ class CanvasPreviewFrame(QFrame):
|
|||
QFrame.mouseReleaseEvent(self, event)
|
||||
|
||||
def paintEvent(self, event):
|
||||
if not self.fUseCustomPaint:
|
||||
QFrame.paintEvent(self, event)
|
||||
|
||||
painter = QPainter(self)
|
||||
|
||||
if self.fUseCustomPaint:
|
||||
|
@ -200,11 +203,6 @@ class CanvasPreviewFrame(QFrame):
|
|||
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()
|
||||
|
||||
|
|
|
@ -2160,13 +2160,13 @@ class ClaudiaMainW(AbstractCanvasJackClass):
|
|||
@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):
|
||||
|
@ -2176,7 +2176,8 @@ class ClaudiaMainW(AbstractCanvasJackClass):
|
|||
|
||||
@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):
|
||||
|
|
|
@ -406,7 +406,7 @@ class JackSettingsW(QDialog):
|
|||
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)
|
||||
|
|
|
@ -2480,16 +2480,16 @@ class CanvasBox(QGraphicsItem):
|
|||
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
|
||||
|
|
|
@ -349,7 +349,7 @@ class RenderW(QDialog):
|
|||
|
||||
@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):
|
||||
|
|
|
@ -515,7 +515,7 @@ class AbstractCanvasJackClass(QMainWindow):
|
|||
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)
|
||||
|
|
Loading…
Reference in New Issue