Skip to content

Migrate from PySide2 to PySide6 to Fix Qt Symbol Compatibility Issues #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ test_sources = [


requires = [
"opencv-contrib-python==4.8.1.78",
"PySide2~=5.15",
"opencv-contrib-python-headless==4.8.1.78",
"PySide6~=6.5",
"mediapipe==0.10.7",
"numpy~=1.19",
"pyqtdarktheme ~=2.1.0",
Expand Down
9 changes: 4 additions & 5 deletions src/photoglimmer/colorcurverwidget.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@

import sys
from PySide2 import QtWidgets, QtGui, QtCore
from PySide2.QtWidgets import QWidget, QApplication, QVBoxLayout, QHBoxLayout, QPushButton # Added layouts/button
from PySide2.QtGui import QPainter, QPen, QBrush, QColor, QPainterPath, QPalette
from PySide2.QtCore import QPointF, QRectF, Qt, Signal
from PySide6 import QtWidgets, QtGui, QtCore
from PySide6.QtWidgets import QWidget, QApplication, QVBoxLayout, QHBoxLayout, QPushButton # Added layouts/button
from PySide6.QtGui import QPainter, QPen, QBrush, QColor, QPainterPath, QPalette
from PySide6.QtCore import QPointF, QRectF, Qt, Signal
import math
from pympler import asizeof
# import copy # Needed for deep copying QPointF list during save/load if necessary
Expand Down
6 changes: 3 additions & 3 deletions src/photoglimmer/customfiledialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
# File license CC BY-SA 3.0
# ###############################################################################
import sys
from PySide2.QtCore import Qt
from PySide2.QtGui import QPixmap
from PySide2.QtWidgets import QApplication, QFileDialog, QVBoxLayout, QLabel, QDialog
from PySide6.QtCore import Qt
from PySide6.QtGui import QPixmap
from PySide6.QtWidgets import QApplication, QFileDialog, QVBoxLayout, QLabel, QDialog
import qdarktheme


Expand Down
3 changes: 1 addition & 2 deletions src/photoglimmer/imagewidget.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# ###############################################################################
# Copyright : Rahul Singh
# URL : https://github.com/codecliff/PhotoGlimmer
Expand All @@ -14,7 +13,7 @@
# ###############################################################################
import sys
from enum import Enum
from PySide2 import QtCore, QtGui, QtWidgets
from PySide6 import QtCore, QtGui, QtWidgets
# --- Interaction Modes Enum ---


Expand Down
15 changes: 8 additions & 7 deletions src/photoglimmer/photoglimmer_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
#imports
import os, sys, shutil, time, tempfile
# QT
from PySide2 import QtWidgets, QtCore
from PySide2.QtUiTools import QUiLoader
from PySide2.QtGui import QPixmap, QIcon, QMovie, QKeySequence
from PySide2.QtCore import QThreadPool, QFile,QSettings,QStandardPaths
from PySide2.QtWidgets import QStyle, QMessageBox, QAction, QGridLayout,QLabel, QDialog
from PySide6 import QtWidgets, QtCore
from PySide6.QtUiTools import QUiLoader
from PySide6.QtGui import QPixmap, QIcon, QMovie, QKeySequence, QAction
from PySide6.QtCore import QThreadPool, QFile,QSettings,QStandardPaths
from PySide6.QtWidgets import QStyle, QMessageBox, QGridLayout,QLabel, QDialog
# Only if using qdarktheme style
import qdarktheme
# This application
Expand Down Expand Up @@ -190,7 +190,7 @@ def setUpMyUI(self):


def getImagesDirectory(self):
from PySide2.QtCore import QStandardPaths
from PySide6.QtCore import QStandardPaths
pth=QStandardPaths.PicturesLocation
sysimgfolder= str(QStandardPaths.writableLocation(pth) )
if os.path.exists(sysimgfolder):
Expand Down Expand Up @@ -636,7 +636,8 @@ def openBrowser(self, path_to_open):


def getScreenSize( self ):
from PySide2.QtWidgets import QApplication, QDesktopWidget
from PySide6.QtWidgets import QApplication
from PySide6.QtGui import QScreen
desktop = QDesktopWidget()
screen_width = desktop.screenGeometry().width()
screen_height = desktop.screenGeometry().height()
Expand Down
6 changes: 3 additions & 3 deletions src/photoglimmer/prefs/preferences_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
# preferences_dialog.py
import sys
import os
from PySide2.QtWidgets import (QApplication, QDialog, QFileDialog, QMessageBox,
from PySide6.QtWidgets import (QApplication, QDialog, QFileDialog, QMessageBox,
QWidget, QRadioButton, QVBoxLayout,
QDialogButtonBox)
from PySide2.QtCore import QFile, QSettings, QStandardPaths, Slot
from PySide2.QtUiTools import QUiLoader
from PySide6.QtCore import QFile, QSettings, QStandardPaths, Slot
from PySide6.QtUiTools import QUiLoader
# --- Import the configuration ---
#standard way of importing form same package is to add . prefix
from .settings_config import SettingsConfig
Expand Down
2 changes: 1 addition & 1 deletion src/photoglimmer/prefs/settings_config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

# settings_config.py
from PySide2.QtCore import QStandardPaths
from PySide6.QtCore import QStandardPaths


class SettingsConfig:
Expand Down
20 changes: 10 additions & 10 deletions src/photoglimmer/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"opencv-contrib-python==4.8.1.78",
"PySide2~=5.15",
"mediapipe==0.10.7",
"numpy~=1.19",
"pyqtdarktheme ~=2.1.0",
"splines ~= 0.3.0",
"piexif ~= 1.1.3",
"Pympler ~=1.1",
"memory-profiler ~=0.61.0",
"line-profiler ~=4.2.0"
opencv-contrib-python-headless==4.8.1.78
PySide6~=6.5
mediapipe==0.10.7
numpy~=1.19
pyqtdarktheme~=2.1.0
splines~=0.3.0
piexif~=1.1.3
Pympler~=1.1
memory-profiler~=0.61.0
line-profiler~=4.2.0
7 changes: 3 additions & 4 deletions src/photoglimmer/threadwork.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@

# source for all the code in this file :
# https://gist.github.com/sabapathygithub/160ecf262063bcb826787a7af1637f44
from PySide2.QtCore import QObject,QRunnable,QThreadPool
from PySide2.QtCore import Signal as pyqtSignal
from PySide2.QtCore import Slot as pyqtSlot
from PySide6.QtCore import QObject,QRunnable,QThreadPool
from PySide6.QtCore import Signal as pyqtSignal
from PySide6.QtCore import Slot as pyqtSlot
import sys,traceback


Expand Down
7 changes: 3 additions & 4 deletions src/photoglimmer/uihelper_transparency.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# import backend
import os
import photoglimmer.photoglimmer_backend as backend
Expand All @@ -14,16 +13,16 @@ def __init__(self, uiobject):


def convert_and_copy_to_clipboard(self, bgra_image):
from PySide2.QtGui import QImage, QPixmap,QClipboard
from PySide2.QtWidgets import QApplication
from PySide6.QtGui import QImage, QPixmap,QClipboard
from PySide6.QtWidgets import QApplication
rgba_image = backend.cv2.cvtColor(bgra_image, backend.cv2.COLOR_BGRA2RGBA)
height, width, channels = rgba_image.shape
bytes_per_line = channels * width
qimage = QImage(rgba_image.data, width, height, bytes_per_line,
QImage.Format_RGBA8888)
clipboard = QApplication.clipboard()
clipboard.setPixmap(QPixmap(qimage), QClipboard.Clipboard)
return
return


def transparency_to_clipboard( self, tempdirpath,originalImgPath):
Expand Down