mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-04-28 17:57:16 +02:00
[app] Set Fusion style using API
Instead of passing the style via QApplication arguments, use the QQuickStyle API.
This commit is contained in:
parent
aeb77d8dbc
commit
a790ac8f21
1 changed files with 8 additions and 5 deletions
|
@ -8,6 +8,7 @@ from PySide6 import __version__ as PySideVersion
|
||||||
from PySide6 import QtCore
|
from PySide6 import QtCore
|
||||||
from PySide6.QtCore import Qt, QUrl, QJsonValue, qInstallMessageHandler, QtMsgType, QSettings
|
from PySide6.QtCore import Qt, QUrl, QJsonValue, qInstallMessageHandler, QtMsgType, QSettings
|
||||||
from PySide6.QtGui import QIcon
|
from PySide6.QtGui import QIcon
|
||||||
|
from PySide6.QtQuickControls2 import QQuickStyle
|
||||||
from PySide6.QtWidgets import QApplication
|
from PySide6.QtWidgets import QApplication
|
||||||
|
|
||||||
import meshroom
|
import meshroom
|
||||||
|
@ -186,12 +187,11 @@ Additional Resources:
|
||||||
|
|
||||||
class MeshroomApp(QApplication):
|
class MeshroomApp(QApplication):
|
||||||
""" Meshroom UI Application. """
|
""" Meshroom UI Application. """
|
||||||
def __init__(self, args):
|
def __init__(self, inputArgs):
|
||||||
meshroom.core.initPipelines()
|
meshroom.core.initPipelines()
|
||||||
|
|
||||||
QtArgs = [args[0], '-style', 'Fusion'] + args[1:] # force Fusion style by default
|
args = createMeshroomParser(inputArgs)
|
||||||
|
qtArgs = []
|
||||||
args = createMeshroomParser(args)
|
|
||||||
|
|
||||||
logStringToPython = {
|
logStringToPython = {
|
||||||
'fatal': logging.FATAL,
|
'fatal': logging.FATAL,
|
||||||
|
@ -203,7 +203,7 @@ class MeshroomApp(QApplication):
|
||||||
}
|
}
|
||||||
logging.getLogger().setLevel(logStringToPython[args.verbose])
|
logging.getLogger().setLevel(logStringToPython[args.verbose])
|
||||||
|
|
||||||
super(MeshroomApp, self).__init__(QtArgs)
|
super(MeshroomApp, self).__init__(inputArgs[:1] + qtArgs)
|
||||||
|
|
||||||
self.setOrganizationName('AliceVision')
|
self.setOrganizationName('AliceVision')
|
||||||
self.setApplicationName('Meshroom')
|
self.setApplicationName('Meshroom')
|
||||||
|
@ -213,6 +213,9 @@ class MeshroomApp(QApplication):
|
||||||
font.setPointSize(9)
|
font.setPointSize(9)
|
||||||
self.setFont(font)
|
self.setFont(font)
|
||||||
|
|
||||||
|
# Use Fusion style by default.
|
||||||
|
QQuickStyle.setStyle("Fusion")
|
||||||
|
|
||||||
pwd = os.path.dirname(__file__)
|
pwd = os.path.dirname(__file__)
|
||||||
self.setWindowIcon(QIcon(os.path.join(pwd, "img/meshroom.svg")))
|
self.setWindowIcon(QIcon(os.path.join(pwd, "img/meshroom.svg")))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue