first version

This commit is contained in:
Paolo Cignoni 2007-10-19 22:27:50 +00:00
parent f553ab00b8
commit 46eb093f0f
1 changed files with 14 additions and 0 deletions

14
wrap/qt/trackball.h Normal file
View File

@ -0,0 +1,14 @@
Trackball::Button QT2VCG(Qt::MouseButton qtbt, Qt::KeyboardModifiers modifiers)
{
int vcgbt=Trackball::BUTTON_NONE;
if(qtbt & Qt::LeftButton ) vcgbt |= Trackball::BUTTON_LEFT;
if(qtbt & Qt::RightButton ) vcgbt |= Trackball::BUTTON_RIGHT;
if(qtbt & Qt::MidButton ) vcgbt |= Trackball::BUTTON_MIDDLE;
if(modifiers & Qt::ShiftModifier ) vcgbt |= Trackball::KEY_SHIFT;
if(modifiers & Qt::ControlModifier ) vcgbt |= Trackball::KEY_CTRL;
if(modifiers & Qt::AltModifier ) vcgbt |= Trackball::KEY_ALT;
return Trackball::Button(vcgbt);
}