pyside2

Registering a type in QML using PySide2

牧云@^-^@ 提交于 2020-08-08 06:28:07
问题 I am trying to create a new QML type by using Python, but I am having trouble with registering a QML type. However, I am getting an Error: TypeError: 'PySide2.QtQml.qmlRegisterType' called with wrong argument types: PySide2.QtQml.qmlRegisterType(module, str, int, int, str) Supported signatures: PySide2.QtQml.qmlRegisterType(type, str, int, int, str) So I understand that its expecting a type, however, in this blogpost it does something similar: qmlRegisterType(PieChart, 'Charts', 1, 0,

Registering a type in QML using PySide2

守給你的承諾、 提交于 2020-08-08 06:27:30
问题 I am trying to create a new QML type by using Python, but I am having trouble with registering a QML type. However, I am getting an Error: TypeError: 'PySide2.QtQml.qmlRegisterType' called with wrong argument types: PySide2.QtQml.qmlRegisterType(module, str, int, int, str) Supported signatures: PySide2.QtQml.qmlRegisterType(type, str, int, int, str) So I understand that its expecting a type, however, in this blogpost it does something similar: qmlRegisterType(PieChart, 'Charts', 1, 0,

PySide How to see QML errors in python console?

六月ゝ 毕业季﹏ 提交于 2020-08-07 07:56:13
问题 I have the following code: if __name__ == '__main__': os.environ["QT_QUICK_CONTROLS_STYLE"] = "Material" app = QGuiApplication(sys.argv) engine = QQmlApplicationEngine() engine.load('./QML/main.qml') if not engine.rootObjects(): sys.exit(-1) sys.exit(app.exec_()) As you can see, if `engine.load' fails all I'll see is a '-1' exit code, without any elaboration on why it failed and what the error happened. How can I print the QML error in the python console? There was a walkaround for this with

PySide How to see QML errors in python console?

孤街浪徒 提交于 2020-08-07 07:55:07
问题 I have the following code: if __name__ == '__main__': os.environ["QT_QUICK_CONTROLS_STYLE"] = "Material" app = QGuiApplication(sys.argv) engine = QQmlApplicationEngine() engine.load('./QML/main.qml') if not engine.rootObjects(): sys.exit(-1) sys.exit(app.exec_()) As you can see, if `engine.load' fails all I'll see is a '-1' exit code, without any elaboration on why it failed and what the error happened. How can I print the QML error in the python console? There was a walkaround for this with

Unable to compile with cx_freeze and PySide2

倖福魔咒の 提交于 2020-07-22 05:01:12
问题 I have a python program I'm trying to compile with cx_freeze. The GUI I'm using is PySide2. I've tried including PySide2, here is excluding it, but I keep getting the same error. Below is my setup.py code from cx_Freeze import setup, Executable import sys includefiles = ['README.md', 'debug.log','tcl86t.dll', 'tk86t.dll', 'field.jpg', 'inputClass.py', 'mainfile.qml', 'MyTabView.qml', 'PlayerSelection.qml', 'selectedPlayers.py', 'Settings.qml', 'SimOutput.qml', 'simulationOutput.py'] includes

Unable to compile with cx_freeze and PySide2

ε祈祈猫儿з 提交于 2020-07-22 05:01:05
问题 I have a python program I'm trying to compile with cx_freeze. The GUI I'm using is PySide2. I've tried including PySide2, here is excluding it, but I keep getting the same error. Below is my setup.py code from cx_Freeze import setup, Executable import sys includefiles = ['README.md', 'debug.log','tcl86t.dll', 'tk86t.dll', 'field.jpg', 'inputClass.py', 'mainfile.qml', 'MyTabView.qml', 'PlayerSelection.qml', 'selectedPlayers.py', 'Settings.qml', 'SimOutput.qml', 'simulationOutput.py'] includes

several questions about QML and PySide2

前提是你 提交于 2020-07-09 17:45:48
问题 I have the following cases, I want to use several Qml: "welcome.qml", "create.qml", "dashboard.qml" in which cases to use QQuickview or QqmlApplicationEngine.? I am using "QQmlAplicatiobEngine" and search in the object with findChild to get the signal, and handle the logic, If the signal completes a condition, I use the engine.load to load another QML. python: class guiBackend(QObject): def __init__(self): self.engine = QQmlApplicationEngine() self.context = self.engine.rootContext() self