本文整理汇总了Python中PyQt5.QtQuick.QQuickView.setColor方法的典型用法代码示例。如果您正苦于以下问题:Python QQuickView.setColor方法的具体用法?Python QQuickView.setColor怎么用?Python QQuickView.setColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtQuick.QQuickView
的用法示例。
在下文中一共展示了QQuickView.setColor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: QQuickView
# 需要导入模块: from PyQt5.QtQuick import QQuickView [as 别名]
# 或者: from PyQt5.QtQuick.QQuickView import setColor [as 别名]
# Create the QML user interface. Auto creates its own engine
view = QQuickView()
engine2 = view.engine
# Does not run
#engine2.quit.connect(app.quit)
#view.setSource(QUrl('PyTest.qml'))
# To Satisfy cool-retro-term needs
view.rootContext().setContextProperty('devicePixelRatio', app.devicePixelRatio())
view.setSource(QUrl('WeatherDash.qml'))
#view.setResizeMode(QDeclarativeView.SizeRootObjectToView)
view.setGeometry(100, 100, 750, 480)
# ala https://pythonspot.com/pyqt5-colors/
view.setColor(QColor(0, 30, 0))
view.show()
is_full_screen = False
# technique lifted from https://stackoverflow.com/questions/19131084/pyqt5-qml-signal-to-python-slot
# and augmented from https://stackoverflow.com/questions/30586983/how-to-close-pyqt5-program-from-qml
# could refine with https://stackoverflow.com/questions/24111717/how-to-bind-buttons-in-qt-quick-to-python-pyqt-5
# not 100% ideal, but adequate and interesting
def on_quit():
app.quit()
def on_toggle_fullscreen():
global is_full_screen
if is_full_screen: