Exemple #1
0
class LauncherEXUtils(QObject):
	def __init__(self):
		QObject.__init__(self)
		
	@pyqtProperty('QString')
	def newUUID(self):
		return QUuid.createUuid().toString()
		

if __name__ == '__main__':
	import os
	import sys

	app = QGuiApplication(sys.argv)
	app.setLayoutDirection(Qt.RightToLeft);


	view = QQuickView()
	context = view.rootContext()
	
	view.engine().setOfflineStoragePath(".")
	
	exutil = LauncherEXUtils()
	qmlRegisterType(LauncherEXUtils, 'ExUtils', 1, 0, 'ExUtils')
	qmlRegisterType(Bozorgrah,'Bozorgrah',1,0,'Bozorgrah')
	context.setContextProperty('exutils',exutil)
	
	view.setResizeMode(QQuickView.SizeRootObjectToView)
	try:
		approot = os.path.dirname(os.path.abspath(__file__))