Gestures: subscribe 3d view to recieve gestures
This commit is contained in:
parent
77ef990fa7
commit
c0d15db47c
|
@ -123,7 +123,9 @@
|
|||
|
||||
#include <Inventor/draggers/SoCenterballDragger.h>
|
||||
#include <Inventor/annex/Profiler/SoProfiler.h>
|
||||
#include <qgesture.h>
|
||||
|
||||
#include <WinNativeGestureRecognizers.h>
|
||||
|
||||
//#define FC_LOGGING_CB
|
||||
|
||||
|
@ -458,6 +460,18 @@ void View3DInventorViewer::init()
|
|||
viewerEventFilter = new ViewerEventFilter;
|
||||
installEventFilter(viewerEventFilter);
|
||||
getEventFilter()->registerInputDevice(new SpaceNavigatorDevice);
|
||||
|
||||
this->grabGesture(Qt::PanGesture);
|
||||
this->grabGesture(Qt::PinchGesture);
|
||||
#ifdef GESTURE_MESS
|
||||
{
|
||||
static WinNativeGestureRecognizerPinch* recognizer;//static to avoid creating more than one recognizer, thus causing memory leak and gradual slowdown
|
||||
if(recognizer == 0){
|
||||
recognizer = new WinNativeGestureRecognizerPinch;
|
||||
recognizer->registerRecognizer(recognizer); //From now on, Qt owns the pointer.
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
//create the cursors
|
||||
QBitmap cursor = QBitmap::fromData(QSize(ROTATE_WIDTH, ROTATE_HEIGHT), rotate_bitmap);
|
||||
|
|
|
@ -357,6 +357,7 @@ protected:
|
|||
SbBool processSoEventBase(const SoEvent * const ev);
|
||||
void printDimension();
|
||||
void selectAll();
|
||||
bool isWinGesturesTuned;//a flag. If false, gestures on windows will get tuned(or re-tuned) upon the first event that arrives to eventFilter. This is needed to tune windows gestures after Qt does it internally, since its settings are not all right for us.
|
||||
|
||||
private:
|
||||
static void setViewportCB(void * userdata, SoAction * action);
|
||||
|
|
Loading…
Reference in New Issue
Block a user