当前位置: 首页>>代码示例>>Python>>正文


Python QLocale.system方法代码示例

本文整理汇总了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()
开发者ID:fabianofranz,项目名称:everpad,代码行数:12,代码来源:indicator.py

示例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()
开发者ID:guofengstc,项目名称:everpad,代码行数:12,代码来源:indicator.py

示例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()
开发者ID:XelK,项目名称:everpad,代码行数:15,代码来源:indicator.py

示例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()
开发者ID:fmoo,项目名称:everpad,代码行数:16,代码来源:indicator.py

示例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()
开发者ID:casualuser,项目名称:everpad,代码行数:19,代码来源:pad.py

示例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.
开发者ID:ssorgatem,项目名称:DecoyFinder,代码行数:21,代码来源:decoy_finder.py

示例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()
开发者ID:freexploit,项目名称:everpad,代码行数:20,代码来源:indicator.py

示例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_())
开发者ID:marchon,项目名称:ifmon,代码行数:23,代码来源:app.py

示例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)
开发者ID:ncarrier,项目名称:gestion_ecole_de_musique,代码行数:32,代码来源:config.py

示例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)
开发者ID:webushka,项目名称:reduce,代码行数:31,代码来源:qreduce.py


注:本文中的PySide.QtCore.QLocale.system方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。