Posts

Showing posts with the label pyside2

PySide2 Signal with named parameter

Image
Clash Royale CLAN TAG #URR8PPP PySide2 Signal with named parameter I am trying to replicate below example using PySide2. https://evileg.com/en/post/242/ But as PySide2 doesn't support emitting a Signal with named parameter to QML, i have no clue about how to do this using PySide2 ? Here is my code main.py from PySide2.QtGui import QGuiApplication from PySide2.QtQml import QQmlApplicationEngine from PySide2.QtCore import QObject, Signal, Slot, Property class Calculator(QObject): def __init__(self): QObject.__init__(self) sumResult = Signal(int) subResult = Signal(int) @Slot(int, int) def sum(self, arg1, arg2): self.sumResult.emit(arg1 + arg2) @Slot(int, int) def sub(self, arg1, arg2): self.subResult.emit(arg1 - arg2) if __name__ == "__main__": import sys app = QGuiApplication(sys.argv) engine = QQmlApplicationEngine() calculator = Calculator() engine.rootContext().setContextProperty("calculator...

Pyside2 application failed to start

Image
Clash Royale CLAN TAG #URR8PPP Pyside2 application failed to start I just tried to test the newly released version of pyside2 (5.11) on Windows 10, 64bit version. But the "Hello World" example does not work. I am using Python 3.6 with PyCharm.The interpreter I use is from Anaconda. So I pip installed the pyside2 version and also tried to install via "conda install ..." the older version of pyside2. Both installations worked, but I get the same error message for both libraries. The error message is pooping up in a separate secreen saying:" This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Available platform plugins are: minimal, offscreen, windows." So I definetly can see the plugin files in the correct folder. I tried reinstalling. Deleted everything and tried other IDEs. But nothing solved the problem. Any help appreciated. 1 Answer ...