[osg-users] osgQt Coverity Scan reported issue, Qt experts please chip in.
Jordi Torres
jtorresfabra at gmail.com
Fri Jun 24 13:19:25 PDT 2016
Hi Jan,
El 24/6/2016 21:46, "Jan Ciger" <jan.ciger at gmail.com> escribió:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hello,
>
> On 24/06/16 20:32, Robert Osfield wrote:
> > If you have a github account you should be able to login in with
> > this account. Alternatively you can create your own account for
> > Coverity.
>
> I have logged in with my Github account, but unless someone adds me to
> the OpenSceneGraph project, I don't have access to the reports.
>
> >
You can add yourself to the project as an observer/defect viewer. Otherwise
you also can ask for permissions as a contributor. Me or Robert will add
you as soon as you ask for it.
Cheers.
> > Attach is a screen snaptshot of the source browser. The source I
> > also included in my previous post.
>
> >
> > I've looked at the relevant code, copy and pasted below for
> > reference. The issue looks to be related to mixing an int key value
> > with the enum's defined in osgGA::GUIEventAdapter. I presume the
> > key value is coming in from a Qt event, though I'm not 100% clear
> > on this as I'm not the author of this code, no have Qt expertise.
>
> Yes, the problem is that the key is being passed into the function as
> an instead of enum. It is coming from QEvent (line 136 of the same
> file). The code is taking the Qt events and passing them to the OSG
> event handling system using custom Qt events (a kludge necessary to
> work around some Qt issues).
>
> To fix the problem the comparison should be done using the Qt key
> codes instead:
>
> Change:
> osgGA::GUIEventAdapter::KEY_Shift_L to Qt::Key_Shift
> osgGA::GUIEventAdapter::KEY_Shift_R to Qt::Key_Shift as well
>
> osgGA::GUIEventAdapter::KEY_Control_L to Qt::Key_Control
> osgGA::GUIEventAdapter::KEY_Control_R to Qt::Key_Control
>
> osgGA::GUIEventAdapter::KEY_Alt_L to Qt::Key_Alt
> osgGA::GUIEventAdapter::KEY_Alt_R to Qt::Key_AltGr
>
> osgGA::GUIEventAdapter::KEY_Meta_L to Qt::Key_Meta
> osgGA::GUIEventAdapter::KEY_Meta_R to Qt::Key_Meta
>
>
> I don't think Qt makes distinction between left/right shift, control
> and meta (windows) keys unless you use the native scan code, which is
> platform-specific.
>
> You can find the full list here:
> http://doc.qt.io/qt-5/qt.html#Key-enum
>
> Best regards,
>
> Jan
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2
>
> iD8DBQFXbY4sn11XseNj94gRAsTqAJ9mZ7BWmhrfNKNPSbjlw97UPMVb8QCfVuzK
> 3exJN3eTbdmqx1pwgwPHeYw=
> =Hs+F
> -----END PGP SIGNATURE-----
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20160624/292f603a/attachment-0002.htm>
More information about the osg-users
mailing list