Skip to content

Commit

Permalink
ENH: enable setting Qt theme from YAML config file
Browse files Browse the repository at this point in the history
  • Loading branch information
KurtJacobson committed Jan 12, 2019
1 parent f690394 commit a6145e2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions qtpyvcp/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,21 @@

class VCPApplication(QApplication):

def __init__(self, vcp_file=None, stylesheet=None):
def __init__(self, theme=None, stylesheet=None):
super(VCPApplication, self).__init__(qtpyvcp.OPTIONS.command_line_args or [])

opts = qtpyvcp.OPTIONS

qApp = QApplication.instance()

from qtpyvcp.core import Prefs, Info
self.info = Info()
self.prefs = Prefs()
self.status = getPlugin('status')

self.initialiseDataPlugins()

if opts.theme is not None:
self.setStyle(QStyleFactory.create(opts.theme))
theme = opts.theme or theme
if theme is not None:
self.setStyle(QStyleFactory.create(theme))

stylesheet = opts.stylesheet or stylesheet
if stylesheet is not None:
Expand Down

0 comments on commit a6145e2

Please sign in to comment.