QtScript converts the text automatically to a quint16. If you want to ensure that users only enter numbers then you can use a Validator (UI_socketPortLineEdit.addIntValidator(0, 65536)).
PS: This is only a simple example how to use the interfaces.
Best regards,
Stefan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
ok. Thank you for the explanation automatic conversion. Unfortunately I am not programmer. Trying to understand how it works :)
But the script does not work with socket - tcp client. When connected pops up message box TCP error - unknown error. If you try the opposite - in the main window connected socket tcp - client and in a script serial port so it works perfectly.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
No, that's good. There are two configurations - one functional and dysfunctional one. Unfortunately I was stupid. In setting in script, i changed partner ports and addresses :(
Sorry for the post and I thank you for your answers.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
View and moderate all "Bug Reports" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
data type mismatch?
line 358: tcpClient.connectToHost(UI_socketAdressLineEdit.text() , UI_socketPortLineEdit.text());
Qt class QTcpSocket:
void connectToHost(QString hostAdress, quint16 port)
Hi,
QtScript converts the text automatically to a quint16. If you want to ensure that users only enter numbers then you can use a Validator (UI_socketPortLineEdit.addIntValidator(0, 65536)).
PS: This is only a simple example how to use the interfaces.
Best regards,
Stefan
View and moderate all "Bug Reports" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
ok. Thank you for the explanation automatic conversion. Unfortunately I am not programmer. Trying to understand how it works :)
But the script does not work with socket - tcp client. When connected pops up message box TCP error - unknown error. If you try the opposite - in the main window connected socket tcp - client and in a script serial port so it works perfectly.
Hi,
Best regards,
Stefan
View and moderate all "Bug Reports" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
sent in an attachment
Hi,
you selected the serial port instead of the sockets (upper left corner in the script GUI).
Best regards,
Stefan
View and moderate all "Bug Reports" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
No, that's good. There are two configurations - one functional and dysfunctional one. Unfortunately I was stupid. In setting in script, i changed partner ports and addresses :(
Sorry for the post and I thank you for your answers.
Hi,
no problem. If you have any further questions or possible bugs in the future post again.
Best regards,
Stefan