Robert Osfield schrieb:
Hi Oleg,
On 6/12/07, Oleg Dedkow <[EMAIL PROTECTED]> wrote:
Qt Documentation says 'QKeyEvent::text()' should be used instead of
'QKeyEvent::ascii()'. There are still link errors after svn update
(linker can not find the 'QKeyEvent::ascii()' member function). I think
'AdapterWidget::keyPressEvent()' and 'AdapterWidget::keyReleaseEvent()'
should be implemented as follows:
Why use getInt()? when QT docs say text() is equivilant to ascii()?
text() returns QString, so we have to convert the returned value to int
void AdapterWidget::keyPressEvent( QKeyEvent* event )
{
#if USE_QT4
_gw->getEventQueue()->keyPress( (osgGA::GUIEventAdapter::KeySymbol)
event->text().toInt() );
#else
_gw->getEventQueue()->keyPress( (osgGA::GUIEventAdapter::KeySymbol)
event->ascii() );
#endif
}
void AdapterWidget::keyReleaseEvent( QKeyEvent* event )
{
#if USE_QT4
_gw->getEventQueue()->keyRelease(
(osgGA::GUIEventAdapter::KeySymbol) event->text().toInt() );
#else
_gw->getEventQueue()->keyRelease(
(osgGA::GUIEventAdapter::KeySymbol) event->ascii() );
#endif
}
Oleg
>
>
> Cheers,
> Robert.
>
> On 6/11/07, Oleg Dedkow <[EMAIL PROTECTED]> wrote:
>> Hello Robert,
>>
>> i had some trouble compiling 'osgviewerQT' under Debian 4.0 using Qt
>> 4.3.0 (installed in my home directory) and CMake. 'QKeyEvent'
class does
>> not define 'ascii()' method now. 'Qt::WFlags' was renamed in
>> 'Qt::WindowFlags'. The attached file 'osgviewerQT.cpp' contains all
>> changes.
>>
>> I had to change 'CMakeLists.txt' because of link errors, too (see
>> attachment). I used CMake under Linux for the first time, so maybe i
>> missed something. I had to add
>>
>> ${QT_QTCORE_LIBRARY_RELEASE} ${QT_QTGUI_LIBRARY_RELEASE}
>> ${QT_QTOPENGL_LIBRARY_RELEASE}
>>
>> to
>>
>> TARGET_EXTERNAL_LIBRARIES
>>
>> manually. After these changes I was able to build the 'osgviewerQT'
>> example.
>>
>> Oleg
>>
>> SET(TARGET_SRC osgviewerQT.cpp )
>>
>> #SET(TARGET_EXTERNAL_LIBRARIES ${QT_LIBRARIES} )
>> SET(TARGET_EXTERNAL_LIBRARIES ${QT_QTCORE_LIBRARY_RELEASE}
>> ${QT_QTGUI_LIBRARY_RELEASE} ${QT_QTOPENGL_LIBRARY_RELEASE} )
>>
>> INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR} )
>>
>> IF (QT4_FOUND)
>> ADD_DEFINITIONS(-DUSE_QT4)
>> ENDIF(QT4_FOUND)
>>
>> #### end var setup ###
>> SETUP_EXAMPLE(osgviewerQT)
>>
>> _______________________________________________
>> osg-users mailing list
>> osg-users@openscenegraph.net
>> http://openscenegraph.net/mailman/listinfo/osg-users
>> http://www.openscenegraph.org/
>>
>>
> _______________________________________________
> osg-users mailing list
> osg-users@openscenegraph.net
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>
_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/