本文整理汇总了Python中PySide.QtCore.QLocale.system方法的典型用法代码示例。如果您正苦于以下问题:Python QLocale.system方法的具体用法?Python QLocale.system怎么用?Python QLocale.system使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtCore.QLocale
的用法示例。
在下文中一共展示了QLocale.system方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PySide.QtCore import QLocale [as 别名]
# 或者: from PySide.QtCore.QLocale import system [as 别名]
def __init__(self, *args, **kwargs):
QApplication.__init__(self, *args, **kwargs)
self.settings = QSettings("everpad", "everpad-pad")
self.translator = QTranslator()
if not self.translator.load("../../i18n/%s" % QLocale.system().name()):
self.translator.load("/usr/share/everpad/i18n/%s" % QLocale.system().name())
self.installTranslator(self.translator)
self.icon = QIcon.fromTheme("everpad-mono", QIcon("../../everpad-mono.png"))
self.indicator = Indicator(self, self.icon)
self.indicator.show()
示例2: __init__
# 需要导入模块: from PySide.QtCore import QLocale [as 别名]
# 或者: from PySide.QtCore.QLocale import system [as 别名]
def __init__(self, *args, **kwargs):
QApplication.__init__(self, *args, **kwargs)
self.settings = QSettings('everpad', 'everpad-pad')
self.translator = QTranslator()
if not self.translator.load('../../i18n/%s' % QLocale.system().name()):
self.translator.load('/usr/share/everpad/i18n/%s' % QLocale.system().name())
self.installTranslator(self.translator)
self.indicator = Indicator(self)
self.update_icon()
self.indicator.show()
示例3: __init__
# 需要导入模块: from PySide.QtCore import QLocale [as 别名]
# 或者: from PySide.QtCore.QLocale import system [as 别名]
def __init__(self, *args, **kwargs):
QApplication.__init__(self, *args, **kwargs)
self.settings = QSettings("everpad", "everpad-pad")
self.translator = QTranslator()
if not self.translator.load("../../i18n/%s" % QLocale.system().name()):
self.translator.load("/usr/share/everpad/i18n/%s" % QLocale.system().name())
# This application string can be localized to 'RTL' to switch the application layout
# direction. See for example i18n/ar_EG.ts
QT_TRANSLATE_NOOP("QApplication", "QT_LAYOUT_DIRECTION")
self.installTranslator(self.translator)
self.indicator = Indicator(self)
self.update_icon()
self.indicator.show()
示例4: __init__
# 需要导入模块: from PySide.QtCore import QLocale [as 别名]
# 或者: from PySide.QtCore.QLocale import system [as 别名]
def __init__(self, *args, **kwargs):
QApplication.__init__(self, *args, **kwargs)
self.settings = QSettings('everpad', 'everpad-pad')
self.translator = QTranslator()
if not self.translator.load('../../i18n/%s' % QLocale.system().name()):
self.translator.load('/usr/share/everpad/i18n/%s' % QLocale.system().name())
# This application string can be localized to 'RTL' to switch the application layout
# direction. See for example i18n/ar_EG.ts
QT_TRANSLATE_NOOP('QApplication', 'QT_LAYOUT_DIRECTION')
self.installTranslator(self.translator)
QNetworkProxyFactory.setUseSystemConfiguration(True)
self.indicator = Indicator(self)
self.update_icon()
self.indicator.show()
示例5: __init__
# 需要导入模块: from PySide.QtCore import QLocale [as 别名]
# 或者: from PySide.QtCore.QLocale import system [as 别名]
def __init__(self, *args, **kwargs):
"""Init app"""
QApplication.__init__(self, *args, **kwargs)
self.sync_thread = SyncThread()
self.sync_thread.start()
self.translator = QTranslator()
if not self.translator.load('i18n/%s' % QLocale.system().name()):
self.translator.load('/usr/share/everpad/lang/%s' % QLocale.system().name())
self.provider_obj = dbus.SessionBus().get_object("com.everpad.Provider", '/EverpadProvider')
self.provider = dbus.Interface(self.provider_obj, "com.everpad.Provider")
self.installTranslator(self.translator)
self.icon = QIcon.fromTheme('everpad', QIcon('../everpad.png'))
indicator = Indicator(self, self.icon)
indicator.show()
self.opened = {}
self.setApplicationName('everpad')
self.settings = gconf.client_get_default()
示例6: main
# 需要导入模块: from PySide.QtCore import QLocale [as 别名]
# 或者: from PySide.QtCore.QLocale import system [as 别名]
def main():
"""
"""
from MainWindow import MainWindow
translator = QTranslator() #Build the translator
translator.load(":/locales/df_%s" % QLocale.system().name())
qttranslator = QTranslator()#A translator for Qt standard strings
qttranslator.load("qt_%s" % (QLocale.system().name()))
App = QApplication(sys.argv) #Creating the app
App.setOrganizationName(ORGNAME) #Setting organization and application's
App.setApplicationName(NAME)#name. It's only useful for QSettings
App.setApplicationVersion(VERSION)
App.setOrganizationDomain(URL)
App.installTranslator(translator)#Install translators into the application.
App.installTranslator(qttranslator)
mw = MainWindow(App) #Now it's time to instantiate the main window
mw.show() #And show it
sys.exit(App.exec_()) #When the app finishes, exit.
示例7: __init__
# 需要导入模块: from PySide.QtCore import QLocale [as 别名]
# 或者: from PySide.QtCore.QLocale import system [as 别名]
def __init__(self, *args, **kwargs):
QApplication.__init__(self, *args, **kwargs)
self.settings = QSettings('everpad', 'everpad-pad')
locale = QLocale.system().name()
self.qtTranslator = QTranslator()
self.qtTranslator.load("qt_" + locale, QLibraryInfo.location(QLibraryInfo.TranslationsPath))
self.installTranslator(self.qtTranslator)
self.appTranslator = QTranslator()
if not self.appTranslator.load(locale, os.path.join(os.path.dirname(__file__), '../../i18n')):
self.appTranslator.load(locale, resource_filename('share/everpad/i18n'))
# This application string can be localized to 'RTL' to switch the application layout
# direction. See for example i18n/ar_EG.ts
QT_TRANSLATE_NOOP('QApplication', 'QT_LAYOUT_DIRECTION')
self.installTranslator(self.appTranslator)
QNetworkProxyFactory.setUseSystemConfiguration(True)
self.indicator = Indicator()
self.update_icon()
self.indicator.show()
示例8: main
# 需要导入模块: from PySide.QtCore import QLocale [as 别名]
# 或者: from PySide.QtCore.QLocale import system [as 别名]
def main(argv=None):
app = QApplication(argv or sys.argv)
locale = QLocale.system().name()
trans = QTranslator()
locale_path = '%s/locale/ifmon_%s' % (os.path.dirname(os.path.dirname(
os.path.realpath(__file__))), locale.lower())
trans.load(locale_path)
app.installTranslator(trans)
try:
setup_db()
except:
QMessageBox.critical(None, 'Database error',
'Could not find the database.\n'
'Please install it properly by running install.py on Ubuntu.\n'
'For other Linux distributions, check the requirements.',
QMessageBox.Ok)
sys.exit(app.exit())
else:
mw = MainWindow()
mw.show()
sys.exit(app.exec_())
示例9: __setitem__
# 需要导入模块: from PySide.QtCore import QLocale [as 别名]
# 或者: from PySide.QtCore.QLocale import system [as 别名]
return self.__settings.value(key)
else:
return ""
def __setitem__(self, key, value):
"""Méthode magique sous-jacent à l'opérateur [] en écriture"""
self.__settings.setValue(key, value)
def __delitem__(self, key):
"""Méthode magique sous-jacent à l'opérateur del"""
self.__settings.remove(key)
if __name__ == "__main__":
"""Main de test"""
import sys
from PySide.QtGui import QApplication
from PySide.QtCore import QLibraryInfo, QLocale, QTranslator
app = QApplication(sys.argv)
locale = QLocale.system().name()
translator = QTranslator()
translator.load("qt_" + locale,
QLibraryInfo.location(QLibraryInfo.TranslationsPath))
app.installTranslator(translator)
ui = ConfigUI()
ui.show()
ret = app.exec_()
sys.exit(ret)
示例10: QApplication
# 需要导入模块: from PySide.QtCore import QLocale [as 别名]
# 或者: from PySide.QtCore.QLocale import system [as 别名]
from PySide.QtCore import QTranslator
from PySide.QtCore import QLocale
from PySide.QtCore import QLibraryInfo
from PySide.QtCore import Qt
from qrmainwindow import QtReduceMainWindow
app = QApplication(sys.argv)
app.setOrganizationName("The Reduce Project")
app.setOrganizationDomain("reduce-algebra.sourceforge.net")
app.setApplicationName("QReduce")
qtTranslator = QTranslator(app)
qtTranslator.load("qt_" + QLocale.system().name(),
QLibraryInfo.location(QLibraryInfo.TranslationsPath))
app.installTranslator(qtTranslator)
qreduceTranslator = QTranslator(app)
qreduceTranslator.load(sys.path[0] + "/" + "qreducetr." +
str(locale.getdefaultlocale()[0]))
#app.installTranslator(qreduceTranslator)
# app.setStyleSheet("QStatusBar::item { border: 0px solid black }");
app.setWindowIcon(QIcon(sys.path[0] + "/" + "Bumblebee.png"))
if os.uname()[0] == "Darwin":
app.setAttribute(Qt.AA_DontShowIconsInMenus)