2

I am trying to develop a simple (?) application for N900 using Qt, but I don't even know when to start. I want to tap anywhere in the screen, keep that position, render an object through OpenGL ES there and then be able to pick it and modify its appearance. So, my questions:

  1. From what I've read N900 doesn't support touch events. Nevertheless, the touch examples that exist in QtSDK (almost) worked for me. Should I go for QGesture then or maybe with QtMouse for the tapping (or QTouchEvent)?
  2. Supposing I have the tapped position coordinates, I should later transform them from screen coordinates to object coordinates, if I understand correctly, right?
  3. For the 'picking object' part, does OpenGL ES 2.0 support the select buffer? Or otherwise, how could that be implemented (ray tracing) ?

Any hint to get me started would be very appreciated!!!

Bob
  • 23
  • 2

1 Answers1

0
  1. QTouchEvent is exactly what is not supported on N900. You should use QMouseEvent, which are delivered to QWidget or QGraphicsSceneMouseEvent, which are delivered to QGraphicsScene.
  2. QMouseEvent contains both globalPos() and pos(), so you normally don't need to do a conversion. But there are QWidget::mapToGlobal() and friends allowing these conversions. QGraphicsView has mapFromScene and mapToScene for the same purpose.
divanov
  • 6,173
  • 3
  • 32
  • 51
  • Thank you very much divanov, after your advice I focused mainly on QMouseEvent example and I managed to put some things in an order. In either case (i.e. if I use QGraphicsScene or not), supposing I have 3 QGLWidgets in my scene and I want to rotate it, should I implement a signal for each widget or there is a way for rotating the scene alltogether? (because from what I understand I should either define a central widget in the former case or set the viewport to one of my QGLWidgets in the QGraphicsScene case).Thanks again! (Either way I am picking this answer cause it gave me guidance) – Bob Jun 03 '11 at 23:26
  • There is no easy way to rotate QWidget, but for QGraphicsView with QGraphicsScene it's as easy as calling QGraphicsView::rotate () (http://doc.qt.nokia.com/latest/qgraphicsview.html#rotate) – divanov Jun 04 '11 at 09:21