First, thank you all for your questions and your answers, I've been learning a lot just by searching and finding perfect information in these forums.

Now, my problem which I couldn't find the solution: I'm not successfully getting mouse cursor position in main window's status bar, based on its movement around a QGraphicsView. It was working perfect when I was using a QWidget instead of QGraphicsView, but I had to change it due to some project new requirements. Also, I should print to an external file the points that were clicked so far. That's not working anymore, too.

The current symptom is: the mouse current coordinates are shown in the status bar, but only in the extremes, i.e., x<=2, y<=2, x>=right-2 or y>=bottom-2. Odd, isn't it?

I've reimplemented QGraphicsScene and QGraphicsView this way:

Qt Code:
  1. #ifndef WHITESPACESCENE_H
  2. #define WHITESPACESCENE_H
  3.  
  4. #include <QGraphicsScene>
  5.  
  6. class WhiteSpaceScene : public QGraphicsScene
  7. {
  8. Q_OBJECT
  9. public:
  10. WhiteSpaceScene (qreal x, qreal y, qreal width, qreal height, QObject * parent = 0);
  11.  
  12. protected:
  13. void mousePressEvent(QMouseEvent *event);
  14.  
  15. private:
  16. void printPoint(const QPoint &clickedPoint);
  17. };
  18.  
  19. #endif // WHITESPACESCENE_H
To copy to clipboard, switch view to plain text mode 
Qt Code:
  1. #include "whitespacescene.h"
  2.  
  3. WhiteSpaceScene::WhiteSpaceScene (qreal x, qreal y, qreal width, qreal height, QObject * parent) :
  4. QGraphicsScene(x, y, width, height, parent)
  5. {
  6.  
  7. }
  8.  
  9. void WhiteSpaceScene::mousePressEvent(QMouseEvent *event)
  10. {
  11. if (event->button() == Qt::LeftButton)
  12. {
  13. printPoint(event->pos());
  14. }
  15. }
  16.  
  17. void WhiteSpaceScene::printPoint(const QPoint &clickedPoint)
  18. {
  19. ...
  20. }
To copy to clipboard, switch view to plain text mode 
Qt Code:
  1. #ifndef WHITESPACEVIEW_H
  2. #define WHITESPACEVIEW_H
  3.  
  4. #include <QGraphicsView>
  5.  
  6. class WhiteSpaceView : public QGraphicsView
  7. {
  8. Q_OBJECT
  9. public:
  10. explicit WhiteSpaceView(QGraphicsScene * scene, QWidget * parent = 0);
  11. };
  12.  
  13. #endif // WHITESPACEVIEW_H
To copy to clipboard, switch view to plain text mode 
Qt Code:
  1. #include "whitespaceview.h"
  2.  
  3. WhiteSpaceView::WhiteSpaceView(QGraphicsScene * scene, QWidget * parent) :
  4. QGraphicsView(scene, parent)
  5. {
  6. setAttribute(Qt::WA_StaticContents); // won't change contents on widget resizing
  7. setRenderHint(QPainter::Antialiasing);
  8. setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate);
  9. setBackgroundBrush(QColor(255, 255, 255));
  10. setMouseTracking(true);
  11. setCursor(Qt::CrossCursor);
  12. }
To copy to clipboard, switch view to plain text mode 
In mainwindow.cpp I have an event filter which wasn't modified:
Qt Code:
  1. bool MainWindow::eventFilter(QObject*, QEvent *event)
  2. {
  3. if (event->type() == QEvent::MouseMove)
  4. {
  5. QMouseEvent *mouseCursor = static_cast<QMouseEvent*>(event);
  6. statusBar()->showMessage(QString("(x,y) coordinates: (%1,%2)").arg(mouseCursor->x()).arg(mouseCursor->y()));
  7. }
  8. else if (event->type() == QEvent::Leave)
  9. {
  10. statusBar()->showMessage("");
  11. }
  12. return false;
  13. }
To copy to clipboard, switch view to plain text mode 
And finally:
Qt Code:
  1. #include <QtGui/QApplication>
  2. #include "mainwindow.h"
  3. #include "whitespacescene.h"
  4. #include "whitespaceview.h"
  5.  
  6. int main(int argc, char *argv[])
  7. {
  8. QApplication a(argc, argv);
  9. MainWindow *window = new MainWindow;
  10.  
  11. WhiteSpaceScene *whitespace = new WhiteSpaceScene(0, 0, 350, 350);
  12. WhiteSpaceView *whitespaceview = new WhiteSpaceView(whitespace);
  13. whitespaceview->installEventFilter(window);
  14. window->setCentralWidget(whitespaceview);
  15. window->show();
  16. return a.exec();
  17. }
To copy to clipboard, switch view to plain text mode 
In the old main, I had a call to my subclassed QWidget (instead of two calls: QGraphicsScene and QGraphicsView) and the event filter was installed on it (subwidget->installEventFilter(window)).

I've also tried to declare using standard QGraphicsView and QGraphicsScene to see if my subclasses were the problem, but the exact same symptom occurs.

Any suggestions?
Thanks a lot in advance.