Skip to content

Commit ce66683

Browse files
committed
[app] Set Fusion style using API
Instead of passing the style via QApplication arguments, use the QQuickStyle API.
1 parent aeb77d8 commit ce66683

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

meshroom/ui/app.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from PySide6 import QtCore
99
from PySide6.QtCore import Qt, QUrl, QJsonValue, qInstallMessageHandler, QtMsgType, QSettings
1010
from PySide6.QtGui import QIcon
11+
from PySide6.QtQuickControls2 import QQuickStyle
1112
from PySide6.QtWidgets import QApplication
1213

1314
import meshroom
@@ -186,12 +187,11 @@ def createMeshroomParser(args):
186187

187188
class MeshroomApp(QApplication):
188189
""" Meshroom UI Application. """
189-
def __init__(self, args):
190+
def __init__(self, inputArgs):
190191
meshroom.core.initPipelines()
191192

192-
QtArgs = [args[0], '-style', 'Fusion'] + args[1:] # force Fusion style by default
193-
194-
args = createMeshroomParser(args)
193+
args = createMeshroomParser(inputArgs)
194+
qtArgs = []
195195

196196
logStringToPython = {
197197
'fatal': logging.FATAL,
@@ -203,7 +203,7 @@ def __init__(self, args):
203203
}
204204
logging.getLogger().setLevel(logStringToPython[args.verbose])
205205

206-
super(MeshroomApp, self).__init__(QtArgs)
206+
super(MeshroomApp, self).__init__(inputArgs[0:] + qtArgs)
207207

208208
self.setOrganizationName('AliceVision')
209209
self.setApplicationName('Meshroom')
@@ -213,6 +213,9 @@ def __init__(self, args):
213213
font.setPointSize(9)
214214
self.setFont(font)
215215

216+
# Use Fusion style by default.
217+
QQuickStyle.setStyle("Fusion")
218+
216219
pwd = os.path.dirname(__file__)
217220
self.setWindowIcon(QIcon(os.path.join(pwd, "img/meshroom.svg")))
218221

0 commit comments

Comments
 (0)