I confirmed that the code I posted previously (the TouchObject class) still receives gesture events with Qt 4.7.1 under Windows 7. I cannot test for OS X. However, I will attach the other little code pieces I use to get it running. I hope it helps. Let me know if I can do anything else for you.
main.cpp
#include <QApplication>
#include <QGraphicsView>
#include <QGraphicsScene>
#include "TouchObject.h"
int main(int argc, char* argv[]){
pScene->setSceneRect(-300, -300, 600, 600);
pScene->addItem(new TouchObject());
view.show();
return app.exec();
}
#include <QApplication>
#include <QGraphicsView>
#include <QGraphicsScene>
#include "TouchObject.h"
int main(int argc, char* argv[]){
QApplication app(argc, argv);
QGraphicsScene* pScene = new QGraphicsScene();
pScene->setSceneRect(-300, -300, 600, 600);
pScene->addItem(new TouchObject());
QGraphicsView view(pScene);
view.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
.pro file
TEMPLATE = app
CONFIG += qt warn_on no_keywords embed_manifest_exe
QT +=
TARGET = GraphicsObjectGestures
SOURCES = main.cpp
HEADERS = TouchObject.h
LIBS +=
CONFIG += console
# Treat warnings as errors
win32:QMAKE_CXXFLAGS += /WX
TEMPLATE = app
CONFIG += qt warn_on no_keywords embed_manifest_exe
QT +=
TARGET = GraphicsObjectGestures
SOURCES = main.cpp
HEADERS = TouchObject.h
LIBS +=
CONFIG += console
# Treat warnings as errors
win32:QMAKE_CXXFLAGS += /WX
To copy to clipboard, switch view to plain text mode
TouchObject.h is the same as before.
Bookmarks