Robert Osfield schrieb:
Hi Oleg,
Your changes broke the QT3 build so I've tried to change the code so
that it better handles the differences between QT3 and QT4, fingers
cross it'll now work cleanly on QT4. Could you do an svn update and
see if things now work.
Hello Robert,
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:
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/