Updates can only be scheduled from GUI thread or from QQuickItem::updatePaintNode()
问题 I'm trying to change Image with Pushbutton (GPIO PINs) stored inside a folder using QML with PyQt5 Python Code: from gpiozero import Button from signal import pause from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtQml import * import os, time, sys def btn_pressed(): global r return lambda: r.setProperty("source", "/home/pi/Desktop/example/sample/img/img1.jpg") button1 = Button(20) myApp = QGuiApplication([]) myEngine = QQmlApplicationEngine() directory = os.path.dirname(os