How do I convert from QString to quint16 ?
Printable View
How do I convert from QString to quint16 ?
QString::number doesnt help?
I have a QLineEdit:
In my tcpSocket I need to connect:
Code:
In stead of having the quint16(2000) I would like to have the value of lePort. I tried
but it doesn't work.
Actually i see that you want string - > int not int->string as i understad before.
Try next
QString::number() makes a QString from a number.. read the docs first.
Use QString::toInt(), QString::toUInt(), etc.