本文整理汇总了Python中PyQt5.QtQuick.QQuickView.resize方法的典型用法代码示例。如果您正苦于以下问题:Python QQuickView.resize方法的具体用法?Python QQuickView.resize怎么用?Python QQuickView.resize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtQuick.QQuickView
的用法示例。
在下文中一共展示了QQuickView.resize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: QApplication
# 需要导入模块: from PyQt5.QtQuick import QQuickView [as 别名]
# 或者: from PyQt5.QtQuick.QQuickView import resize [as 别名]
# -*- coding: utf-8 -*-
#from PyQt5.QtGui import QApplication
from PyQt5.QtWidgets import QApplication
from PyQt5.QtCore import QVariant, QUrl, QDir
from PyQt5.QtQml import QQmlApplicationEngine, QQmlEngine
from PyQt5.QtQuick import QQuickView, QQuickItem, QQuickWindow
if __name__ == '__main__':
import sys
app = QApplication(sys.argv)
viewer = QQuickView()
viewer.setSource(QUrl("main.qml"))
viewer.setTitle("Material Demo QML")
viewer.engine().quit.connect(app.quit)
viewer.resize(500, 500)
viewer.setResizeMode(QQuickView.SizeRootObjectToView)
viewer.show()
sys.exit(app.exec_())
示例2: QApplication
# 需要导入模块: from PyQt5.QtQuick import QQuickView [as 别名]
# 或者: from PyQt5.QtQuick.QQuickView import resize [as 别名]
#!/usr/bin/env python
import sys
import os
from simple_ellipse import SimpleEllipse
from PyQt5.QtQml import qmlRegisterType
from PyQt5.QtWidgets import QApplication
from PyQt5.QtQuick import QQuickView
from PyQt5.QtCore import QUrl
if __name__ == '__main__':
app = QApplication(sys.argv)
qmlRegisterType(SimpleEllipse, "Shapes", 1, 0, "SimpleEllipse")
view = QQuickView()
view.resize(480, 480)
view.setResizeMode(QQuickView.SizeRootObjectToView)
view.setSource(QUrl.fromLocalFile(
os.path.join(os.path.dirname(__file__), 'qml/main.qml')))
view.show()
sys.exit(app.exec_())