[Qt-interest] convert QSlidBox value int char

Keshava Krishna keshavkrishna88 at gmail.com
Mon May 11 12:27:12 CEST 2009


I don't know about tcpSocket etc,
But you can use number function of QString to convert an integer to string

QString test =  QString::number ( valueTest);


hope i helped you to solve your problem

On Mon, May 11, 2009 at 3:49 PM, Stefanos Antaris <santaris at csd.auth.gr>wrote:

> Hello.Can anyone help me on how to convert the QSlidBoxValue into char?I
> want to send this using  a tcpSocket into another application.Here is my
> code.The other application receive vmf instead of vmf5 as i expect.The
> value 5 is the default of the SpinBox;
>
> [code]
> QString test;
> int valueTest=ui->velocitySpinBox->value();
> test=(char)valueTest;
> ui->statusLabel->setText(test);
> forwardOut<<quint8('v')<<quint8('m')<<quint8('f')<<quint16(test);
> forwardOut.device()->seek(0);
> actionTcpSocket->write(forwardBlock);
>
>
> [\code]
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>



-- 
Regards,
Keshava.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090511/9801d633/attachment.html 


More information about the Qt-interest-old mailing list