Skip to content

Commit

Permalink
Continue PyQt6 compatibility, seems usable now
Browse files Browse the repository at this point in the history
Signed-off-by: [email protected] <falkTX>
  • Loading branch information
[email protected] authored and [email protected] committed Aug 11, 2024
1 parent b0878b7 commit da911f1
Show file tree
Hide file tree
Showing 16 changed files with 300 additions and 117 deletions.
2 changes: 1 addition & 1 deletion Makefile.print.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
20 changes: 4 additions & 16 deletions source/frontend/carla
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# Carla plugin host
# Copyright (C) 2011-2022 Filipe Coelho <[email protected]>
#
# 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 <[email protected]>
# SPDX-License-Identifier: GPL-2.0-or-later

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

if __name__ == '__main__':
import resources_rc

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

Expand Down
20 changes: 4 additions & 16 deletions source/frontend/carla-control
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# Carla plugin host
# Copyright (C) 2011-2021 Filipe Coelho <[email protected]>
#
# 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 <[email protected]>
# SPDX-License-Identifier: GPL-2.0-or-later

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

if __name__ == '__main__':
import resources_rc

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

Expand Down
20 changes: 4 additions & 16 deletions source/frontend/carla-jack-multi
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# Carla plugin host
# Copyright (C) 2011-2017 Filipe Coelho <[email protected]>
#
# 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 <[email protected]>
# SPDX-License-Identifier: GPL-2.0-or-later

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

if __name__ == '__main__':
import resources_rc

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

Expand Down
20 changes: 4 additions & 16 deletions source/frontend/carla-jack-single
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# Carla plugin host
# Copyright (C) 2011-2017 Filipe Coelho <[email protected]>
#
# 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 <[email protected]>
# SPDX-License-Identifier: GPL-2.0-or-later

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

if __name__ == '__main__':
import resources_rc

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

Expand Down
20 changes: 4 additions & 16 deletions source/frontend/carla-patchbay
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# Carla plugin host
# Copyright (C) 2011-2017 Filipe Coelho <[email protected]>
#
# 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 <[email protected]>
# SPDX-License-Identifier: GPL-2.0-or-later

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

if __name__ == '__main__':
import resources_rc

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

Expand Down
2 changes: 2 additions & 0 deletions source/frontend/carla-plugin
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,8 @@ class CarlaEmbedW(QEmbedWidget):
# Main

if __name__ == '__main__':
import resources_rc

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

Expand Down
20 changes: 4 additions & 16 deletions source/frontend/carla-rack
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# Carla plugin host
# Copyright (C) 2011-2015 Filipe Coelho <[email protected]>
#
# 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 <[email protected]>
# SPDX-License-Identifier: GPL-2.0-or-later

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

if __name__ == '__main__':
import resources_rc

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

Expand Down
30 changes: 20 additions & 10 deletions source/frontend/midipattern-ui
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion source/frontend/patchcanvas/canvasbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
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

# ------------------------------------------------------------------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion source/frontend/patchcanvas/canvasicon.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
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

# ------------------------------------------------------------------------------------------------------------
Expand Down
Loading

0 comments on commit da911f1

Please sign in to comment.