本文整理汇总了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
示例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_())
示例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_())