Skip to content

Commit 66e3dd4

Browse files
authored
Merge pull request #2599 from alicevision/dev/qt6.6
Qt6.6.3 / PySide6.6.3.1 upgrade
2 parents f04eda8 + 9af6ade commit 66e3dd4

File tree

145 files changed

+2342
-1698
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+2342
-1698
lines changed

.git-blame-ignore-revs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# [qt6][qml] Clean-up code and harmonize comments
2+
5a0b1c0c9547b0d00f3f10fae6994d6d8ea0b45e
13
# [nodes] Linting: Clean-up files
24
4c0409f573c2694325b104c2686a1532f95cb9bc
35
# Linting: Clean-up files

COPYING.md

Lines changed: 1 addition & 1 deletion
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/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,4 @@ def addToEnvPath(var, val, index=-1):
157157
os.environ["QML_XHR_ALLOW_FILE_READ"] = '1'
158158
os.environ["QML_XHR_ALLOW_FILE_WRITE"] = '1'
159159
os.environ["PYSEQ_STRICT_PAD"] = '1'
160+
os.environ["QSG_RHI_BACKEND"] = "opengl"

meshroom/common/qt.py

Lines changed: 3 additions & 3 deletions
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/core/node.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,11 @@ def elapsedTimeStr(self):
116116

117117
def toDict(self):
118118
d = self.__dict__.copy()
119-
d.pop('destroyed', None) # skip non data attributes from BaseObject
120119
d["elapsedTimeStr"] = self.elapsedTimeStr
120+
121+
# Skip non data attributes from BaseObject
122+
d.pop("destroyed", None)
123+
d.pop("objectNameChanged", None)
121124
return d
122125

123126
def fromDict(self, d):

meshroom/submitters/simpleFarmSubmitter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def __init__(self, parent=None):
3939
# logging.info('REZ: {}'.format(str(r)))
4040
v = r.split('-')
4141
# logging.info(' v: {}'.format(str(v)))
42-
if len(v) == 2:
42+
if len(v) >= 2:
4343
resolvedVersions[v[0]] = v[1]
4444
for p in packages:
4545
if p.startswith('~'):

meshroom/ui/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
import meshroom.ui.app
1111

1212
meshroom.ui.uiInstance = meshroom.ui.app.MeshroomApp(sys.argv)
13-
meshroom.ui.uiInstance.exec_()
13+
meshroom.ui.uiInstance.exec()

meshroom/ui/app.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
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 __version__ as PySideVersion
8+
from PySide6 import QtCore
9+
from PySide6.QtCore import Qt, QUrl, QJsonValue, qInstallMessageHandler, QtMsgType, QSettings
10+
from PySide6.QtGui import QIcon
11+
from PySide6.QtWidgets import QApplication
1112

1213
import meshroom
1314
from meshroom.core import nodesDesc
@@ -188,7 +189,7 @@ class MeshroomApp(QApplication):
188189
def __init__(self, args):
189190
meshroom.core.initPipelines()
190191

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

193194
args = createMeshroomParser(args)
194195

@@ -202,8 +203,6 @@ def __init__(self, args):
202203
}
203204
logging.getLogger().setLevel(logStringToPython[args.verbose])
204205

205-
QApplication.setAttribute(Qt.AA_EnableHighDpiScaling)
206-
207206
super(MeshroomApp, self).__init__(QtArgs)
208207

209208
self.setOrganizationName('AliceVision')
@@ -355,6 +354,7 @@ def _recentProjectFiles(self):
355354
p = {"path": p, "thumbnail": thumbnail}
356355
projects.append(p)
357356
settings.endArray()
357+
settings.endGroup()
358358
return projects
359359

360360
@Slot(str)
@@ -394,6 +394,7 @@ def addRecentProjectFile(self, projectFile):
394394
settings.setArrayIndex(i)
395395
settings.setValue("filepath", p)
396396
settings.endArray()
397+
settings.endGroup()
397398
settings.sync()
398399

399400
self.recentProjectFilesChanged.emit()
@@ -539,7 +540,8 @@ def _systemInfo(self):
539540
import sys
540541
return {
541542
'platform': '{} {}'.format(platform.system(), platform.release()),
542-
'python': 'Python {}'.format(sys.version.split(" ")[0])
543+
'python': 'Python {}'.format(sys.version.split(" ")[0]),
544+
'pyside': 'PySide6 {}'.format(PySideVersion)
543545
}
544546

545547
systemInfo = Property(QJsonValue, _systemInfo, constant=True)

meshroom/ui/commands.py

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

0 commit comments

Comments
 (0)