Robert Osfield schrieb:
Hi Oleg,

On 6/12/07, Oleg Dedkow <[EMAIL PROTECTED]> wrote:
> Does the toInt() convert from string to an an ascii number i.e. 'A' to
> 65, or does it convert something like "200" to an int of 200?
I was not aware of 16-bit encoding used by QString class. 'toInt(bool*
ok = 0, int base = 10)', used with default parameters, returns '0' for
all characters excepting numbers, i.e. '0' for 'a' and '1' for '1'.

QString::toAscii() returns an ASCII encoded  8-bit string as QByteArray.
*( text().toAscii().data() ) returns therefore 'a' for the character 'a'.

So... the final QT4 code should be...

   _gw->getEventQueue()->keyPress(
(osgGA::GUIEventAdapter::KeySymbol) event->toAscii().data() );
toAscii().data() returns char*.  So the final QT4 code should be:

_gw->getEventQueue()->keyPress( (osgGA::GUIEventAdapter::KeySymbol) *( event->text().toAscii().data() ) );

and

_gw->getEventQueue()->keyRelease( (osgGA::GUIEventAdapter::KeySymbol) *( event->text().toAscii().data() ) );

Oleg

??

Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/



_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to