[Qt-interest] convert QSlidBox value int char

Stefanos Antaris santaris at csd.auth.gr
Mon May 11 12:57:17 CEST 2009


Ok that works but i want to cast it into char.Not QString;quint doesn't 
support QString;

Keshava Krishna wrote:
> 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 <mailto: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 <mailto: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/2b8dec78/attachment.html 


More information about the Qt-interest-old mailing list