Hi, I am trying to rotate two QDials which I have added to a QGraphicsScene but only one dial can be rotated.
Below is my setup

Qt Code:
  1. #include <QtGui/QApplication>
  2. int main(int argc, char *argv[])
  3. {
  4. QApplication a(argc, argv);
  5. QGraphicsView view(&scene);
  6. QWidget* widget=new QWidget;
  7. widget->setAttribute(Qt::WA_AcceptTouchEvents);
  8. widget->setFocusPolicy(Qt::NoFocus);
  9. createGUI(":/GUI.xml",widget); //this function creates all the widget in UI and adds them in widget.
  10. scene.addWidget(widget);
  11. view.setDragMode(QGraphicsView::ScrollHandDrag);
  12. view.setAttribute(Qt::WA_AlwaysShowToolTips);
  13. view.show(); //I cannot move two dials at once
  14.  
  15. //widget.show(); // I can move two dials at once
  16. return a.exec();
  17. }
To copy to clipboard, switch view to plain text mode 

What I want is to create UI from xml file and since I what to provide zoom in/out feature for the UI I have to use QGraphicsView and QGraphicsScene.
All the widgets that are created have 'setAttribute(Qt::WA_AcceptTouchEvents)' done. The problem is if I use QGraphicsView and QGraphicsScene I cannot multitouch widgets. I want to be able to rotate two dials at once. But if I use QWidget (which has all the widgets of UI) I can rotate two dials at once.
I see that QGraphicsItem has a function setsetAcceptTouchEvents() function to be able to accept touch events. So can QGraphicsItem (only) receive touch events in QGraphicsScene and not QWidget?
Or is there something wrong in my setup. I mean loading UI in a widget and the adding that widget into a scene?

Thanks