Skip to content

Commit

Permalink
[app] Set Fusion style using API
Browse files Browse the repository at this point in the history
Instead of passing the style via QApplication arguments,
use the QQuickStyle API.
  • Loading branch information
yann-lty committed Dec 20, 2024
1 parent aeb77d8 commit ce66683
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions meshroom/ui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
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
Expand Down Expand Up @@ -186,12 +187,11 @@ def createMeshroomParser(args):

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,
Expand All @@ -203,7 +203,7 @@ def __init__(self, args):
}
logging.getLogger().setLevel(logStringToPython[args.verbose])

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

self.setOrganizationName('AliceVision')
self.setApplicationName('Meshroom')
Expand All @@ -213,6 +213,9 @@ def __init__(self, args):
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")))

Expand Down

0 comments on commit ce66683

Please sign in to comment.