Skip to content

Commit 579371f

Browse files
committed
[qt6] Replace all PySide2/shiboken2 imports by PySide6/shiboken6
1 parent f07c924 commit 579371f

17 files changed

+40
-40
lines changed

COPYING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Meshroom is licensed under the [MPL2 license](LICENSE-MPL2.md).
1515
Copyright (c) 2001-2018 Python Software Foundation.
1616
Distributed under the [PSFL V2 license](https://www.python.org/download/releases/2.7/license/).
1717

18-
* __Qt/PySide2__
18+
* __Qt/PySide6__
1919
[https://www.qt.io](https://www.qt.io)
2020
Copyright (C) 2018 The Qt Company Ltd and other contributors.
2121
Distributed under the [LGPL V3 license](https://opensource.org/licenses/LGPL-3.0).

meshroom/common/qt.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from PySide2 import QtCore, QtQml
2-
import shiboken2
1+
from PySide6 import QtCore, QtQml
2+
import shiboken6
33

44

55
class QObjectListModel(QtCore.QAbstractListModel):
@@ -285,7 +285,7 @@ def _referenceItem(self, item):
285285

286286
def _dereferenceItem(self, item):
287287
# Ask for object deletion if parented to the model
288-
if shiboken2.isValid(item) and item.parent() == self:
288+
if shiboken6.isValid(item) and item.parent() == self:
289289
# delay deletion until the next event loop
290290
# This avoids warnings when the QML engine tries to evaluate (but should not)
291291
# an object that has already been deleted

meshroom/ui/app.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
import argparse
55
import json
66

7-
from PySide2 import QtCore
8-
from PySide2.QtCore import Qt, QUrl, QJsonValue, qInstallMessageHandler, QtMsgType, QSettings
9-
from PySide2.QtGui import QIcon
10-
from PySide2.QtWidgets import QApplication
7+
from PySide6 import QtCore
8+
from PySide6.QtCore import Qt, QUrl, QJsonValue, qInstallMessageHandler, QtMsgType, QSettings
9+
from PySide6.QtGui import QIcon
10+
from PySide6.QtWidgets import QApplication
1111

1212
import meshroom
1313
from meshroom.core import nodesDesc
@@ -188,7 +188,7 @@ class MeshroomApp(QApplication):
188188
def __init__(self, args):
189189
meshroom.core.initPipelines()
190190

191-
QtArgs = [args[0], '-style', 'fusion'] + args[1:] # force Fusion style by default
191+
QtArgs = [args[0], '-style', 'Fusion'] + args[1:] # force Fusion style by default
192192

193193
args = createMeshroomParser(args)
194194

meshroom/ui/commands.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
import traceback
33
from contextlib import contextmanager
44

5-
from PySide2.QtWidgets import QUndoCommand, QUndoStack
6-
from PySide2.QtCore import Property, Signal
5+
from PySide6.QtGui import QUndoCommand, QUndoStack
6+
from PySide6.QtCore import Property, Signal
77

88
from meshroom.core.attribute import ListAttribute, Attribute
99
from meshroom.core.graph import GraphModification

meshroom/ui/components/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
def registerTypes():
3-
from PySide2.QtQml import qmlRegisterType
3+
from PySide6.QtQml import qmlRegisterType
44
from meshroom.ui.components.clipboard import ClipboardHelper
55
from meshroom.ui.components.edge import EdgeMouseArea
66
from meshroom.ui.components.filepath import FilepathHelper

meshroom/ui/components/clipboard.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from PySide2.QtCore import Slot, QObject
2-
from PySide2.QtGui import QClipboard
1+
from PySide6.QtCore import Slot, QObject
2+
from PySide6.QtGui import QClipboard
33

44

55
class ClipboardHelper(QObject):

meshroom/ui/components/csvData.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from meshroom.common.qt import QObjectListModel
22

3-
from PySide2.QtCore import QObject, Slot, Signal, Property
4-
from PySide2.QtCharts import QtCharts
3+
from PySide6.QtCore import QObject, Slot, Signal, Property
4+
from PySide6 import QtCharts
55

66
import csv
77
import os

meshroom/ui/components/edge.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from PySide2.QtCore import Signal, Property, QPointF, Qt, QObject
2-
from PySide2.QtGui import QPainterPath, QVector2D
3-
from PySide2.QtQuick import QQuickItem
1+
from PySide6.QtCore import Signal, Property, QPointF, Qt, QObject
2+
from PySide6.QtGui import QPainterPath, QVector2D
3+
from PySide6.QtQuick import QQuickItem
44

55

66
class MouseEvent(QObject):

meshroom/ui/components/filepath.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22
# coding:utf-8
3-
from PySide2.QtCore import QUrl, QFileInfo
4-
from PySide2.QtCore import QObject, Slot
3+
from PySide6.QtCore import QUrl, QFileInfo
4+
from PySide6.QtCore import QObject, Slot
55

66
import os
77
import glob

meshroom/ui/components/scene3D.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from math import acos, pi, sqrt, atan2, cos, sin, asin
22

3-
from PySide2.QtCore import QObject, Slot, QSize, Signal, QPointF
4-
from PySide2.Qt3DCore import Qt3DCore
5-
from PySide2.Qt3DRender import Qt3DRender
6-
from PySide2.QtGui import QVector3D, QQuaternion, QVector2D, QVector4D, QMatrix4x4
3+
from PySide6.QtCore import QObject, Slot, QSize, Signal, QPointF
4+
from PySide6.Qt3DCore import Qt3DCore
5+
from PySide6.Qt3DRender import Qt3DRender
6+
from PySide6.QtGui import QVector3D, QQuaternion, QVector2D, QVector4D, QMatrix4x4
77

88
from meshroom.ui.utils import makeProperty
99

meshroom/ui/components/scriptEditor.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from PySide2.QtCore import QObject, Slot
1+
from PySide6.QtCore import QObject, Slot
22

33
from io import StringIO
44
from contextlib import redirect_stdout

meshroom/ui/components/thumbnail.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from meshroom.common import Signal
22

3-
from PySide2.QtCore import QObject, Slot, QSize, QUrl, Qt, QStandardPaths
4-
from PySide2.QtGui import QImageReader, QImageWriter
3+
from PySide6.QtCore import QObject, Slot, QSize, QUrl, Qt, QStandardPaths
4+
from PySide6.QtGui import QImageReader, QImageWriter
55

66
import os
77
from pathlib import Path

meshroom/ui/graph.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from threading import Thread, Event, Lock
99
from multiprocessing.pool import ThreadPool
1010

11-
from PySide2.QtCore import Slot, QJsonValue, QObject, QUrl, Property, Signal, QPoint
11+
from PySide6.QtCore import Slot, QJsonValue, QObject, QUrl, Property, Signal, QPoint
1212

1313
from meshroom.core import sessionUid
1414
from meshroom.common.qt import QObjectListModel

meshroom/ui/palette.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from PySide2.QtCore import QObject, Qt, Slot, Property, Signal
2-
from PySide2.QtGui import QPalette, QColor
3-
from PySide2.QtWidgets import QApplication
1+
from PySide6.QtCore import QObject, Qt, Slot, Property, Signal
2+
from PySide6.QtGui import QPalette, QColor
3+
from PySide6.QtWidgets import QApplication
44

55

66
class PaletteManager(QObject):

meshroom/ui/reconstruction.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
from multiprocessing.pool import ThreadPool
77
from threading import Thread
88

9-
from PySide2.QtCore import QObject, Slot, Property, Signal, QUrl, QSizeF, QPoint
10-
from PySide2.QtGui import QMatrix4x4, QMatrix3x3, QQuaternion, QVector3D, QVector2D
9+
from PySide6.QtCore import QObject, Slot, Property, Signal, QUrl, QSizeF, QPoint
10+
from PySide6.QtGui import QMatrix4x4, QMatrix3x3, QQuaternion, QVector3D, QVector2D
1111

1212
import meshroom.core
1313
import meshroom.common

meshroom/ui/utils.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import os
22
import time
33

4-
from PySide2.QtCore import QFileSystemWatcher, QUrl, Slot, QTimer, Property, QObject
5-
from PySide2.QtQml import QQmlApplicationEngine
4+
from PySide6.QtCore import QFileSystemWatcher, QUrl, Slot, QTimer, Property, QObject
5+
from PySide6.QtQml import QQmlApplicationEngine
66
try:
7-
from PySide2 import shiboken2
7+
from PySide6 import shiboken6
88
except Exception:
9-
import shiboken2
9+
import shiboken6
1010

1111

1212
class QmlInstantEngine(QQmlApplicationEngine):
@@ -237,7 +237,7 @@ def setter(instance, value):
237237
setattr(instance, resetCallbackName, lambda self=instance, *args: setter(self, None))
238238
resetCallback = getattr(instance, resetCallbackName, None)
239239

240-
if resetCallback and currentValue and shiboken2.isValid(currentValue):
240+
if resetCallback and currentValue and shiboken6.isValid(currentValue):
241241
currentValue.destroyed.disconnect(resetCallback)
242242
setattr(instance, attributeName, value)
243243
if resetCallback and value:

tests/test_model.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pytest
22

3-
from PySide2.QtCore import QObject, Property
3+
from PySide6.QtCore import QObject, Property
44

55
from meshroom.common.core import CoreDictModel
66
from meshroom.common.qt import QObjectListModel, QTypedObjectListModel

0 commit comments

Comments
 (0)