The
pySerial port
property is a Python string but the
PyQt QLineEdit
text()
functions returns a
QString
object. So you have to use a conversion method or function.
I don't know for sure which conversion must or can be used here because I don't know Python well. But you can try the
QString
methods
toAscii()
,
toUtf8()
, and
toLocal8Bit()
:
serialport.port = textbox.text().toAscii()