Skip to content

Commit cdbcb75

Browse files
authored
Merge pull request #1723 from p12tic/fix-pyside2-decorator-bug
[ui] Work around PySide2 bug affecting property decorators
2 parents b291a9e + 25cb8f8 commit cdbcb75

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

meshroom/ui/app.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,17 +296,17 @@ def markdownToHtml(self, md):
296296
return md
297297
return markdown(md)
298298

299-
@Property(QJsonValue, constant=True)
300-
def systemInfo(self):
299+
def _systemInfo(self):
301300
import platform
302301
import sys
303302
return {
304303
'platform': '{} {}'.format(platform.system(), platform.release()),
305304
'python': 'Python {}'.format(sys.version.split(" ")[0])
306305
}
307306

308-
@Property("QVariantList", constant=True)
309-
def licensesModel(self):
307+
systemInfo = Property(QJsonValue, _systemInfo, constant=True)
308+
309+
def _licensesModel(self):
310310
"""
311311
Get info about open-source licenses for the application.
312312
Model provides:
@@ -328,6 +328,7 @@ def licensesModel(self):
328328
}
329329
]
330330

331+
licensesModel = Property("QVariantList", _licensesModel, constant=True)
331332
pipelineTemplateFilesChanged = Signal()
332333
recentProjectFilesChanged = Signal()
333334
pipelineTemplateFiles = Property("QVariantList", _pipelineTemplateFiles, notify=pipelineTemplateFilesChanged)

meshroom/ui/reconstruction.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,8 @@ def _updateDenseSceneParams(self):
249249
self._undistortedImagePath = os.path.join(self._activeNode_PrepareDenseScene.node.output.value, filename)
250250
self.denseSceneParamsChanged.emit()
251251

252-
@Property(type=QObject, constant=True)
253-
def attribute(self):
254-
""" Get the underlying Viewpoint attribute wrapped by this Viewpoint. """
255-
return self._viewpoint
252+
# Get the underlying Viewpoint attribute wrapped by this Viewpoint.
253+
attribute = Property(QObject, lambda self: self._viewpoint, constant=True)
256254

257255
@Property(type="QVariant", notify=initialParamsChanged)
258256
def initialIntrinsics(self):

0 commit comments

Comments
 (0)