1
# This file is part of the Frescobaldi project, http://www.frescobaldi.org/
3
# Copyright (c) 2008 - 2011 by Wilbert Berendsen
5
# This program is free software; you can redistribute it and/or
6
# modify it under the terms of the GNU General Public License
7
# as published by the Free Software Foundation; either version 2
8
# of the License, or (at your option) any later version.
10
# This program is distributed in the hope that it will be useful,
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
15
# You should have received a copy of the GNU General Public License
16
# along with this program; if not, write to the Free Software
17
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
# See http://www.gnu.org/licenses/ for more information.
21
Sets the user interface style.
24
from __future__ import unicode_literals
27
from PyQt4.QtCore import QSettings
28
from PyQt4.QtGui import QStyleFactory
32
_system_default = app.qApp.style().objectName()
36
return [name.lower() for name in QStyleFactory.keys()]
40
style = QSettings().value("guistyle", "").lower()
41
if style not in keys():
42
style = _system_default
43
if style != app.qApp.style().objectName():
44
app.qApp.setStyle(QStyleFactory.create(style))
47
app.settingsChanged.connect(setStyle)