Browse Source

Continue PyQt6 compatibility, seems usable now

Signed-off-by: falktx@falktx.com <falkTX>
pull/1555/merge
falktx@falktx.com 3 months ago
parent
commit
da911f14ab
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
16 changed files with 300 additions and 117 deletions
  1. +1
    -1
      Makefile.print.mk
  2. +4
    -16
      source/frontend/carla
  3. +4
    -16
      source/frontend/carla-control
  4. +4
    -16
      source/frontend/carla-jack-multi
  5. +4
    -16
      source/frontend/carla-jack-single
  6. +4
    -16
      source/frontend/carla-patchbay
  7. +2
    -0
      source/frontend/carla-plugin
  8. +4
    -16
      source/frontend/carla-rack
  9. +20
    -10
      source/frontend/midipattern-ui
  10. +1
    -1
      source/frontend/patchcanvas/canvasbox.py
  11. +2
    -1
      source/frontend/patchcanvas/canvasicon.py
  12. +245
    -2
      source/frontend/qt_compat.py
  13. +1
    -1
      source/frontend/widgets/ledbutton.py
  14. +1
    -1
      source/frontend/widgets/scalablebutton.py
  15. +1
    -2
      source/frontend/widgets/scalabledial.py
  16. +2
    -2
      source/theme/CarlaStyle.cpp

+ 1
- 1
Makefile.print.mk View File

@@ -27,7 +27,7 @@ endif
features_print_main:
@printf -- "$(tS)---> Main features $(tE)\n"
ifeq ($(HAVE_FRONTEND),true)
@printf -- "Front-End: $(ANS_YES)\n"
@printf -- "Front-End: $(ANS_YES) (Qt$(FRONTEND_TYPE))\n"
@printf -- "LV2 plugin: $(ANS_YES)\n"
ifneq ($(HAIKU),true)
@printf -- "VST2 plugin: $(ANS_YES)\n"


+ 4
- 16
source/frontend/carla View File

@@ -1,20 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# Carla plugin host
# Copyright (C) 2011-2022 Filipe Coelho <falktx@falktx.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# For a full copy of the GNU General Public License see the doc/GPL.txt file.
# SPDX-FileCopyrightText: 2011-2024 Filipe Coelho <falktx@falktx.com>
# SPDX-License-Identifier: GPL-2.0-or-later

# ----------------------------------------------------------------------------------------------------------------------
# Imports (Custom Stuff)
@@ -38,6 +24,8 @@ from carla_shared import (
# Main

if __name__ == '__main__':
import resources_rc

# ------------------------------------------------------------------------------------------------------------------
# Read CLI args



+ 4
- 16
source/frontend/carla-control View File

@@ -1,20 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# Carla plugin host
# Copyright (C) 2011-2021 Filipe Coelho <falktx@falktx.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# For a full copy of the GNU General Public License see the doc/GPL.txt file.
# SPDX-FileCopyrightText: 2011-2024 Filipe Coelho <falktx@falktx.com>
# SPDX-License-Identifier: GPL-2.0-or-later

# ----------------------------------------------------------------------------------------------------------------------
# Imports (Custom Stuff)
@@ -36,6 +22,8 @@ import sys
# Main

if __name__ == '__main__':
import resources_rc

# ------------------------------------------------------------------------------------------------------------------
# Read CLI args



+ 4
- 16
source/frontend/carla-jack-multi View File

@@ -1,20 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# Carla plugin host
# Copyright (C) 2011-2017 Filipe Coelho <falktx@falktx.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# For a full copy of the GNU General Public License see the doc/GPL.txt file.
# SPDX-FileCopyrightText: 2011-2024 Filipe Coelho <falktx@falktx.com>
# SPDX-License-Identifier: GPL-2.0-or-later

# ----------------------------------------------------------------------------------------------------------------------
# Imports (Custom Stuff)
@@ -25,6 +11,8 @@ from carla_host import *
# Main

if __name__ == '__main__':
import resources_rc

# ------------------------------------------------------------------------------------------------------------------
# Read CLI args



+ 4
- 16
source/frontend/carla-jack-single View File

@@ -1,20 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# Carla plugin host
# Copyright (C) 2011-2017 Filipe Coelho <falktx@falktx.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# For a full copy of the GNU General Public License see the doc/GPL.txt file.
# SPDX-FileCopyrightText: 2011-2024 Filipe Coelho <falktx@falktx.com>
# SPDX-License-Identifier: GPL-2.0-or-later

# ----------------------------------------------------------------------------------------------------------------------
# Imports (Custom Stuff)
@@ -25,6 +11,8 @@ from carla_host import *
# Main

if __name__ == '__main__':
import resources_rc

# ------------------------------------------------------------------------------------------------------------------
# Read CLI args



+ 4
- 16
source/frontend/carla-patchbay View File

@@ -1,20 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# Carla plugin host
# Copyright (C) 2011-2017 Filipe Coelho <falktx@falktx.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# For a full copy of the GNU General Public License see the doc/GPL.txt file.
# SPDX-FileCopyrightText: 2011-2024 Filipe Coelho <falktx@falktx.com>
# SPDX-License-Identifier: GPL-2.0-or-later

# ----------------------------------------------------------------------------------------------------------------------
# Imports (Custom Stuff)
@@ -25,6 +11,8 @@ from carla_host import *
# Main

if __name__ == '__main__':
import resources_rc

# ------------------------------------------------------------------------------------------------------------------
# Read CLI args



+ 2
- 0
source/frontend/carla-plugin View File

@@ -569,6 +569,8 @@ class CarlaEmbedW(QEmbedWidget):
# Main

if __name__ == '__main__':
import resources_rc

# -------------------------------------------------------------
# Get details regarding target usage



+ 4
- 16
source/frontend/carla-rack View File

@@ -1,20 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# Carla plugin host
# Copyright (C) 2011-2015 Filipe Coelho <falktx@falktx.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# For a full copy of the GNU General Public License see the doc/GPL.txt file.
# SPDX-FileCopyrightText: 2011-2024 Filipe Coelho <falktx@falktx.com>
# SPDX-License-Identifier: GPL-2.0-or-later

# ----------------------------------------------------------------------------------------------------------------------
# Imports (Custom Stuff)
@@ -25,6 +11,8 @@ from carla_host import *
# Main

if __name__ == '__main__':
import resources_rc

# ------------------------------------------------------------------------------------------------------------------
# Read CLI args



+ 20
- 10
source/frontend/midipattern-ui View File

@@ -9,11 +9,11 @@
from qt_compat import qt_config

if qt_config == 5:
from PyQt5.QtCore import pyqtSlot, Qt, QEvent
from PyQt5.QtCore import pyqtSlot, QT_VERSION, Qt, QEvent
from PyQt5.QtGui import QKeyEvent
from PyQt5.QtWidgets import QMainWindow
elif qt_config == 6:
from PyQt6.QtCore import pyqtSlot, Qt, QEvent
from PyQt6.QtCore import pyqtSlot, QT_VERSION, Qt, QEvent
from PyQt6.QtGui import QKeyEvent
from PyQt6.QtWidgets import QMainWindow

@@ -67,15 +67,25 @@ class MidiPatternW(ExternalUI, QMainWindow):
self.ui.piano.modeupdate.connect(self.ui.modeIndicator.changeMode)
self.ui.piano.modeupdate.connect(self.slot_modeChanged)

self.ui.timeSigBox.currentIndexChanged[int].connect(self.slot_paramChanged)
self.ui.measureBox.currentIndexChanged[int].connect(self.slot_paramChanged)
self.ui.defaultLengthBox.currentIndexChanged[int].connect(self.slot_paramChanged)
self.ui.quantizeBox.currentIndexChanged[int].connect(self.slot_paramChanged)
if QT_VERSION >= 0x60000:
self.ui.timeSigBox.currentIndexChanged.connect(self.slot_paramChanged)
self.ui.measureBox.currentIndexChanged.connect(self.slot_paramChanged)
self.ui.defaultLengthBox.currentIndexChanged.connect(self.slot_paramChanged)
self.ui.quantizeBox.currentIndexChanged.connect(self.slot_paramChanged)
self.ui.timeSigBox.currentTextChanged.connect(self.slot_setTimeSignature)
self.ui.measureBox.currentTextChanged.connect(self.ui.piano.setMeasures)
self.ui.defaultLengthBox.currentTextChanged.connect(self.ui.piano.setDefaultLength)
self.ui.quantizeBox.currentTextChanged.connect(self.ui.piano.setGridDiv)
else:
self.ui.timeSigBox.currentIndexChanged[int].connect(self.slot_paramChanged)
self.ui.measureBox.currentIndexChanged[int].connect(self.slot_paramChanged)
self.ui.defaultLengthBox.currentIndexChanged[int].connect(self.slot_paramChanged)
self.ui.quantizeBox.currentIndexChanged[int].connect(self.slot_paramChanged)
self.ui.timeSigBox.currentIndexChanged[str].connect(self.slot_setTimeSignature)
self.ui.measureBox.currentIndexChanged[str].connect(self.ui.piano.setMeasures)
self.ui.defaultLengthBox.currentIndexChanged[str].connect(self.ui.piano.setDefaultLength)
self.ui.quantizeBox.currentIndexChanged[str].connect(self.ui.piano.setGridDiv)

self.ui.timeSigBox.currentIndexChanged[str].connect(self.slot_setTimeSignature)
self.ui.measureBox.currentIndexChanged[str].connect(self.ui.piano.setMeasures)
self.ui.defaultLengthBox.currentIndexChanged[str].connect(self.ui.piano.setDefaultLength)
self.ui.quantizeBox.currentIndexChanged[str].connect(self.ui.piano.setGridDiv)
self.ui.hSlider.valueChanged.connect(self.ui.graphicsView.setZoomX)
self.ui.vSlider.valueChanged.connect(self.ui.graphicsView.setZoomY)



+ 1
- 1
source/frontend/patchcanvas/canvasbox.py View File

@@ -15,7 +15,7 @@ if qt_config == 5:
elif qt_config == 6:
from PyQt6.QtCore import pyqtSignal, pyqtSlot, qCritical, QT_VERSION, Qt, QPointF, QRectF, QTimer
from PyQt6.QtGui import QCursor, QFont, QFontMetrics, QImage, QLinearGradient, QPainter, QPen
from PyQt6.QtSvg import QGraphicsSvgItem
from PyQt6.QtSvgWidgets import QGraphicsSvgItem
from PyQt6.QtWidgets import QGraphicsItem, QGraphicsObject, QMenu

# ------------------------------------------------------------------------------------------------------------


+ 2
- 1
source/frontend/patchcanvas/canvasicon.py View File

@@ -15,7 +15,8 @@ if qt_config == 5:
elif qt_config == 6:
from PyQt6.QtCore import qCritical, QRectF
from PyQt6.QtGui import QPainter
from PyQt6.QtSvg import QGraphicsSvgItem, QSvgRenderer
from PyQt6.QtSvg import QSvgRenderer
from PyQt6.QtSvgWidgets import QGraphicsSvgItem
from PyQt6.QtWidgets import QGraphicsColorizeEffect

# ------------------------------------------------------------------------------------------------------------


+ 245
- 2
source/frontend/qt_compat.py View File

@@ -11,10 +11,253 @@ if qt_config == 5:
Qt.MiddleButton = Qt.MidButton

elif qt_config == 6:
from PyQt6.QtCore import Qt
from PyQt6.QtWidgets import QMessageBox
from PyQt6.QtCore import Qt, QEvent, QEventLoop
from PyQt6.QtGui import QFont, QPainter, QPalette
from PyQt6.QtWidgets import (
QAbstractItemView,
QAbstractSpinBox,
QApplication,
QColorDialog,
QDialog,
QDialogButtonBox,
QFileDialog,
QGraphicsItem,
QGraphicsScene,
QGraphicsView,
QHeaderView,
QListWidgetItem,
QMenu,
QMessageBox,
QStyle,
)

# TODO fill up everything else

Qt.AlignCenter = Qt.AlignmentFlag.AlignCenter
Qt.AlignLeft = Qt.AlignmentFlag.AlignLeft

Qt.AA_DontShowIconsInMenus = Qt.ApplicationAttribute.AA_DontShowIconsInMenus

Qt.IgnoreAspectRatio = Qt.AspectRatioMode.IgnoreAspectRatio
Qt.KeepAspectRatio = Qt.AspectRatioMode.KeepAspectRatio

Qt.NoBrush = Qt.BrushStyle.NoBrush

Qt.Checked = Qt.CheckState.Checked
Qt.Unchecked = Qt.CheckState.Unchecked

Qt.CustomContextMenu = Qt.ContextMenuPolicy.CustomContextMenu
Qt.NoContextMenu = Qt.ContextMenuPolicy.NoContextMenu

Qt.ArrowCursor = Qt.CursorShape.ArrowCursor
Qt.ClosedHandCursor = Qt.CursorShape.ClosedHandCursor
Qt.CrossCursor = Qt.CursorShape.CrossCursor
Qt.OpenHandCursor = Qt.CursorShape.OpenHandCursor
Qt.PointingHandCursor = Qt.CursorShape.PointingHandCursor
Qt.SizeAllCursor = Qt.CursorShape.SizeAllCursor
Qt.SizeHorCursor = Qt.CursorShape.SizeHorCursor

Qt.black = Qt.GlobalColor.black
Qt.blue = Qt.GlobalColor.blue
Qt.cyan = Qt.GlobalColor.cyan
Qt.darkGray = Qt.GlobalColor.darkGray
Qt.red = Qt.GlobalColor.red
Qt.transparent = Qt.GlobalColor.transparent
Qt.white = Qt.GlobalColor.white
Qt.yellow = Qt.GlobalColor.yellow

Qt.Key_0 = Qt.Key.Key_0
Qt.Key_1 = Qt.Key.Key_1
Qt.Key_2 = Qt.Key.Key_2
Qt.Key_3 = Qt.Key.Key_3
Qt.Key_5 = Qt.Key.Key_5
Qt.Key_6 = Qt.Key.Key_6
Qt.Key_7 = Qt.Key.Key_7
Qt.Key_9 = Qt.Key.Key_9
Qt.Key_A = Qt.Key.Key_A
Qt.Key_Agrave = Qt.Key.Key_Agrave
Qt.Key_B = Qt.Key.Key_B
Qt.Key_C = Qt.Key.Key_C
Qt.Key_Ccedilla = Qt.Key.Key_Ccedilla
Qt.Key_Comma = Qt.Key.Key_Comma
Qt.Key_D = Qt.Key.Key_D
Qt.Key_Delete = Qt.Key.Key_Delete
Qt.Key_E = Qt.Key.Key_E
Qt.Key_Eacute = Qt.Key.Key_Eacute
Qt.Key_Egrave = Qt.Key.Key_Egrave
Qt.Key_Escape = Qt.Key.Key_Escape
Qt.Key_F = Qt.Key.Key_F
Qt.Key_G = Qt.Key.Key_G
Qt.Key_H = Qt.Key.Key_H
Qt.Key_Home = Qt.Key.Key_Home
Qt.Key_I = Qt.Key.Key_I
Qt.Key_J = Qt.Key.Key_J
Qt.Key_M = Qt.Key.Key_M
Qt.Key_Minus = Qt.Key.Key_Minus
Qt.Key_N = Qt.Key.Key_N
Qt.Key_O = Qt.Key.Key_O
Qt.Key_P = Qt.Key.Key_P
Qt.Key_ParenLeft = Qt.Key.Key_ParenLeft
Qt.Key_Plus = Qt.Key.Key_Plus
Qt.Key_Q = Qt.Key.Key_Q
Qt.Key_QuoteDbl = Qt.Key.Key_QuoteDbl
Qt.Key_R = Qt.Key.Key_R
Qt.Key_S = Qt.Key.Key_S
Qt.Key_T = Qt.Key.Key_T
Qt.Key_U = Qt.Key.Key_U
Qt.Key_V = Qt.Key.Key_V
Qt.Key_W = Qt.Key.Key_W
Qt.Key_X = Qt.Key.Key_X
Qt.Key_Y = Qt.Key.Key_Y
Qt.Key_Z = Qt.Key.Key_Z

Qt.AltModifier = Qt.KeyboardModifier.AltModifier
Qt.ControlModifier = Qt.KeyboardModifier.ControlModifier
Qt.MetaModifier = Qt.KeyboardModifier.MetaModifier
Qt.NoModifier = Qt.KeyboardModifier.NoModifier
Qt.ShiftModifier = Qt.KeyboardModifier.ShiftModifier

Qt.UserRole = Qt.ItemDataRole.UserRole

Qt.ItemIsDragEnabled = Qt.ItemFlag.ItemIsDragEnabled
Qt.ItemIsEnabled = Qt.ItemFlag.ItemIsEnabled
Qt.ItemIsSelectable = Qt.ItemFlag.ItemIsSelectable

Qt.ContainsItemShape = Qt.ItemSelectionMode.ContainsItemShape

Qt.LeftButton = Qt.MouseButton.LeftButton
Qt.MiddleButton = Qt.MouseButton.MiddleButton
Qt.RightButton = Qt.MouseButton.RightButton

Qt.MouseEventSynthesizedByApplication = Qt.MouseEventSource.MouseEventSynthesizedByApplication

Qt.Horizontal = Qt.Orientation.Horizontal

Qt.FlatCap = Qt.PenCapStyle.FlatCap

Qt.MiterJoin = Qt.PenJoinStyle.MiterJoin

Qt.DashLine = Qt.PenStyle.DashLine
Qt.NoPen = Qt.PenStyle.NoPen
Qt.SolidLine = Qt.PenStyle.SolidLine

Qt.ScrollBarAlwaysOn = Qt.ScrollBarPolicy.ScrollBarAlwaysOn
Qt.ScrollBarAlwaysOff = Qt.ScrollBarPolicy.ScrollBarAlwaysOff

Qt.AscendingOrder = Qt.SortOrder.AscendingOrder

Qt.SmoothTransformation = Qt.TransformationMode.SmoothTransformation

Qt.WA_OpaquePaintEvent = Qt.WidgetAttribute.WA_OpaquePaintEvent

Qt.WindowModal = Qt.WindowModality.WindowModal

Qt.WindowActive = Qt.WindowState.WindowActive
Qt.WindowMinimized = Qt.WindowState.WindowMinimized

Qt.MSWindowsFixedSizeDialogHint = Qt.WindowType.MSWindowsFixedSizeDialogHint
Qt.WindowContextHelpButtonHint = Qt.WindowType.WindowContextHelpButtonHint

QAbstractItemView.DropOnly = QAbstractItemView.DragDropMode.DropOnly

QAbstractItemView.SingleSelection = QAbstractItemView.SelectionMode.SingleSelection

QAbstractSpinBox.NoButtons = QAbstractSpinBox.ButtonSymbols.NoButtons
QAbstractSpinBox.UpDownArrows = QAbstractSpinBox.ButtonSymbols.UpDownArrows

QAbstractSpinBox.StepNone = QAbstractSpinBox.StepEnabledFlag.StepNone
QAbstractSpinBox.StepDownEnabled = QAbstractSpinBox.StepEnabledFlag.StepDownEnabled
QAbstractSpinBox.StepUpEnabled = QAbstractSpinBox.StepEnabledFlag.StepUpEnabled

QApplication.exec_ = lambda a: a.exec()

QColorDialog.DontUseNativeDialog = QColorDialog.ColorDialogOption.DontUseNativeDialog

QDialog.exec_ = lambda d: d.exec()

QDialogButtonBox.Reset = QDialogButtonBox.StandardButton.Reset

QEvent.EnabledChange = QEvent.Type.EnabledChange
QEvent.MouseButtonPress = QEvent.Type.MouseButtonPress
QEvent.PaletteChange = QEvent.Type.PaletteChange
QEvent.StyleChange = QEvent.Type.StyleChange
QEvent.User = QEvent.Type.User

QEventLoop.ExcludeUserInputEvents = QEventLoop.ProcessEventsFlag.ExcludeUserInputEvents

QFileDialog.AcceptSave = QFileDialog.AcceptMode.AcceptSave

QFileDialog.AnyFile = QFileDialog.FileMode.AnyFile

QFileDialog.DontUseCustomDirectoryIcons = QFileDialog.Option.DontUseCustomDirectoryIcons
QFileDialog.ShowDirsOnly = QFileDialog.Option.ShowDirsOnly

QFont.AllUppercase = QFont.Capitalization.AllUppercase

QFont.Bold = QFont.Weight.Bold
QFont.Normal = QFont.Weight.Normal

QGraphicsItem.ItemSelectedHasChanged = QGraphicsItem.GraphicsItemChange.ItemSelectedHasChanged

QGraphicsItem.ItemIsFocusable = QGraphicsItem.GraphicsItemFlag.ItemIsFocusable
QGraphicsItem.ItemIsMovable = QGraphicsItem.GraphicsItemFlag.ItemIsMovable
QGraphicsItem.ItemIsSelectable = QGraphicsItem.GraphicsItemFlag.ItemIsSelectable
QGraphicsItem.ItemSendsGeometryChanges = QGraphicsItem.GraphicsItemFlag.ItemSendsGeometryChanges

QGraphicsScene.NoIndex = QGraphicsScene.ItemIndexMethod.NoIndex

QGraphicsView.NoDrag = QGraphicsView.DragMode.NoDrag
QGraphicsView.ScrollHandDrag = QGraphicsView.DragMode.ScrollHandDrag

QGraphicsView.FullViewportUpdate = QGraphicsView.ViewportUpdateMode.FullViewportUpdate
QGraphicsView.MinimalViewportUpdate = QGraphicsView.ViewportUpdateMode.MinimalViewportUpdate

QHeaderView.Fixed = QHeaderView.ResizeMode.Fixed

QListWidgetItem.UserType = QListWidgetItem.ItemType.UserType

QMenu.exec_ = lambda m, p: m.exec(p)

QMessageBox.exec_ = lambda mb: mb.exec()

QMessageBox.No = QMessageBox.StandardButton.No
QMessageBox.Yes = QMessageBox.StandardButton.Yes

QPainter.CompositionMode_Difference = QPainter.CompositionMode.CompositionMode_Difference
QPainter.CompositionMode_Multiply = QPainter.CompositionMode.CompositionMode_Multiply
QPainter.CompositionMode_Plus = QPainter.CompositionMode.CompositionMode_Plus
QPainter.CompositionMode_SourceOver = QPainter.CompositionMode.CompositionMode_SourceOver

QPainter.HighQualityAntialiasing = None

QPainter.Antialiasing = QPainter.RenderHint.Antialiasing
QPainter.SmoothPixmapTransform = QPainter.RenderHint.SmoothPixmapTransform
QPainter.TextAntialiasing = QPainter.RenderHint.TextAntialiasing

QPalette.Active = QPalette.ColorGroup.Active
QPalette.Disabled = QPalette.ColorGroup.Disabled
QPalette.Inactive = QPalette.ColorGroup.Inactive

QPalette.AlternateBase = QPalette.ColorRole.AlternateBase
QPalette.Base = QPalette.ColorRole.Base
QPalette.BrightText = QPalette.ColorRole.BrightText
QPalette.Button = QPalette.ColorRole.Button
QPalette.ButtonText = QPalette.ColorRole.ButtonText
QPalette.Dark = QPalette.ColorRole.Dark
QPalette.Highlight = QPalette.ColorRole.Highlight
QPalette.HighlightedText = QPalette.ColorRole.HighlightedText
QPalette.Light = QPalette.ColorRole.Light
QPalette.Link = QPalette.ColorRole.Link
QPalette.LinkVisited = QPalette.ColorRole.LinkVisited
QPalette.Mid = QPalette.ColorRole.Mid
QPalette.Midlight = QPalette.ColorRole.Midlight
QPalette.Shadow = QPalette.ColorRole.Shadow
QPalette.Text = QPalette.ColorRole.Text
QPalette.ToolTipBase = QPalette.ColorRole.ToolTipBase
QPalette.ToolTipText = QPalette.ColorRole.ToolTipText
QPalette.Window = QPalette.ColorRole.Window
QPalette.WindowText = QPalette.ColorRole.WindowText

QPalette.Background = QPalette.Window

QStyle.State_Selected = QStyle.StateFlag.State_Selected

+ 1
- 1
source/frontend/widgets/ledbutton.py View File

@@ -15,7 +15,7 @@ if qt_config == 5:
elif qt_config == 6:
from PyQt6.QtCore import QRectF
from PyQt6.QtGui import QPainter, QPixmap
from PyQt6.QtSvg import QSvgWidget
from PyQt6.QtSvgWidgets import QSvgWidget
from PyQt6.QtWidgets import QPushButton

# ---------------------------------------------------------------------------------------------------------------------


+ 1
- 1
source/frontend/widgets/scalablebutton.py View File

@@ -15,7 +15,7 @@ if qt_config == 5:
elif qt_config == 6:
from PyQt6.QtCore import QPointF, QRectF
from PyQt6.QtGui import QColor, QFont, QPainter, QPixmap
from PyQt6.QtSvg import QSvgWidget
from PyQt6.QtSvgWidgets import QSvgWidget
from PyQt6.QtWidgets import QPushButton

# ---------------------------------------------------------------------------------------------------------------------


+ 1
- 2
source/frontend/widgets/scalabledial.py View File

@@ -16,7 +16,7 @@ if qt_config == 5:
elif qt_config == 6:
from PyQt6.QtCore import pyqtSlot, Qt, QEvent, QPointF, QRectF, QTimer, QSize
from PyQt6.QtGui import QColor, QConicalGradient, QFontMetrics, QPainterPath, QPen, QPixmap
from PyQt6.QtSvg import QSvgWidget
from PyQt6.QtSvgWidgets import QSvgWidget

from .commondial import CommonDial
from carla_shared import fontMetricsHorizontalAdvance
@@ -276,7 +276,6 @@ class ScalableDial(CommonDial):

# Custom knobs
else:
painter.restore()
return

if self.HOVER_MIN < self.fHoverStep < self.HOVER_MAX:


+ 2
- 2
source/theme/CarlaStyle.cpp View File

@@ -1700,7 +1700,7 @@ void CarlaStyle::drawControl(ControlElement element, const QStyleOption *option,

// Get extra style options if version 2
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
vertical = bar->state != QStyle::State_Horizontal;
vertical = (bar->state & QStyle::State_Horizontal) == 0;
#else
vertical = (bar->orientation == Qt::Vertical);
#endif
@@ -1809,7 +1809,7 @@ void CarlaStyle::drawControl(ControlElement element, const QStyleOption *option,
painter->save();
bool vertical = false, inverted = false;
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
vertical = bar->state != QStyle::State_Horizontal;
vertical = (bar->state & QStyle::State_Horizontal) == 0;
#else
vertical = (bar->orientation == Qt::Vertical);
#endif


Loading…
Cancel
Save