From a790ac8f21f27adaa6755928819c54e57bf76f6c Mon Sep 17 00:00:00 2001 From: Yann Lanthony Date: Fri, 20 Dec 2024 16:54:39 +0100 Subject: [PATCH] [app] Set Fusion style using API Instead of passing the style via QApplication arguments, use the QQuickStyle API. --- meshroom/ui/app.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/meshroom/ui/app.py b/meshroom/ui/app.py index 884b8851..1ca5dd5e 100644 --- a/meshroom/ui/app.py +++ b/meshroom/ui/app.py @@ -8,6 +8,7 @@ from PySide6 import __version__ as PySideVersion from PySide6 import QtCore from PySide6.QtCore import Qt, QUrl, QJsonValue, qInstallMessageHandler, QtMsgType, QSettings from PySide6.QtGui import QIcon +from PySide6.QtQuickControls2 import QQuickStyle from PySide6.QtWidgets import QApplication import meshroom @@ -186,12 +187,11 @@ Additional Resources: class MeshroomApp(QApplication): """ Meshroom UI Application. """ - def __init__(self, args): + def __init__(self, inputArgs): meshroom.core.initPipelines() - QtArgs = [args[0], '-style', 'Fusion'] + args[1:] # force Fusion style by default - - args = createMeshroomParser(args) + args = createMeshroomParser(inputArgs) + qtArgs = [] logStringToPython = { 'fatal': logging.FATAL, @@ -203,7 +203,7 @@ class MeshroomApp(QApplication): } logging.getLogger().setLevel(logStringToPython[args.verbose]) - super(MeshroomApp, self).__init__(QtArgs) + super(MeshroomApp, self).__init__(inputArgs[:1] + qtArgs) self.setOrganizationName('AliceVision') self.setApplicationName('Meshroom') @@ -213,6 +213,9 @@ class MeshroomApp(QApplication): font.setPointSize(9) self.setFont(font) + # Use Fusion style by default. + QQuickStyle.setStyle("Fusion") + pwd = os.path.dirname(__file__) self.setWindowIcon(QIcon(os.path.join(pwd, "img/meshroom.svg")))