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


Python QLocale.setDefault方法代码示例

本文整理汇总了Python中PySide.QtCore.QLocale.setDefault方法的典型用法代码示例。如果您正苦于以下问题:Python QLocale.setDefault方法的具体用法?Python QLocale.setDefault怎么用?Python QLocale.setDefault使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PySide.QtCore.QLocale的用法示例。


在下文中一共展示了QLocale.setDefault方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: onLoad

# 需要导入模块: from PySide.QtCore import QLocale [as 别名]
# 或者: from PySide.QtCore.QLocale import setDefault [as 别名]
	def onLoad( self ):
		QLocale.setDefault(QLocale(QLocale.C))
		locale.setlocale(locale.LC_ALL, 'C')

		QCoreApplication.setOrganizationName("CloudTeam")
		QCoreApplication.setOrganizationDomain("cloudteam.pro")
		QCoreApplication.setApplicationName("juma-moai-editor")

		self.qtApp = QApplication( sys.argv )
		self.qtSetting = QSettings()
		
		self.setupMainWindow()		

		self.initialized = True
		self.running     = False

		return True
开发者ID:cloudteampro,项目名称:juma-editor,代码行数:19,代码来源:QtSupport.py

示例2: main

# 需要导入模块: from PySide.QtCore import QLocale [as 别名]
# 或者: from PySide.QtCore.QLocale import setDefault [as 别名]
def main():

    # application specifics
    app = QApplication(sys.argv)

    # TODO: remove this, hardcoding it for testing
    QLocale.setDefault(QLocale(QLocale.Portuguese, QLocale.Brazil))

    # login dialog
    login_dialog = Login()
    if login_dialog.exec_() == QDialog.Accepted:
        # validation complete, open main interface
        window = MainWindow(login_dialog.get_user_data())
        window.showMaximized()
        # solves mainwindow focusing on windows/xfce
        app.setActiveWindow(window)
        # start main loop
        sys.exit(app.exec_())
开发者ID:raulvc,项目名称:seareiros,代码行数:20,代码来源:seareiros.py

示例3: main

# 需要导入模块: from PySide.QtCore import QLocale [as 别名]
# 或者: from PySide.QtCore.QLocale import setDefault [as 别名]
def main(args):
    parser = argparse.ArgumentParser(description='Runs the inselect user-interface')
    parser.add_argument("file", help='The inselect document to open', nargs='?')
    parser.add_argument('-d', '--debug', action='store_true',
                        help='Show debug messages')
    parser.add_argument('-l', '--locale', action='store',
                        help='Use LOCALE; intended for testing purposes only')
    parser.add_argument('-v', '--version', action='version',
                        version='%(prog)s ' + inselect.__version__)
    parsed = parser.parse_args(args[1:])

    # TODO LH A command-line switch to clear all QSettings

    inselect.lib.utils.DEBUG_PRINT = parsed.debug

    # Only one instance of QApplication can be created per process. The single
    # instance is stored in QtGui.qApp. When test plans are being run it is
    # likely that the QApplication will have been created by a unittest.
    app = QtGui.qApp if QtGui.qApp else QtGui.QApplication(args)

    debug_print(u'Settings stored in [{0}]'.format(QSettings().fileName()))

    if parsed.locale:
        debug_print('Will set locale to [{0}]'.format(parsed.locale))
        QLocale.setDefault(QLocale(parsed.locale))
        locale.setlocale(locale.LC_ALL, parsed.locale)
    else:
        # Set Python's locale module to the user's default locale
        locale.setlocale(locale.LC_ALL, '')

    debug_print(u'Locale is [{0}]'.format(QLocale().name()))

    window = MainWindow(app)
    window.show_from_geometry_settings()

    if parsed.file:
        window.open_file(parsed.file)

    sys.exit(app.exec_())
开发者ID:edwbaker,项目名称:inselect,代码行数:41,代码来源:app.py


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