Could someone please point me to a very simple QGraphicsView Example for QT5.7 QtCreator mainwindow's main.cpp that actually works and doesn't throw a "no matching function for call" error.

I've read the documentation for QGraphicsView, QGraphicsScene, and QGraphicsItem. I've tried various code published here and elsewhere which is supposed to work. But everything seems to throw that error.

For example, I start a new Qt widgets application in Qt Creator. I change nothing except main.cpp, which becomes:

Qt Code:
  1. #include "mainwindow.h"
  2. #include <QApplication>
  3. #include <QGraphicsItem>
  4. #include <QGraphicsScene>
  5. #include <QGraphicsView>
  6.  
  7. int main( int argc, char **argv )
  8. {
  9. QApplication app(argc, argv);
  10.  
  11. QGraphicsRectItem *rect = scene.addRect(QRectF(0, 0, 100, 100));
  12.  
  13. QGraphicsItem *item = scene.itemAt(50, 50);
  14. // item == rect
  15.  
  16. QGraphicsView view(&scene);
  17. view.show();
  18.  
  19. return app.exec();
  20. }
To copy to clipboard, switch view to plain text mode 

At the line:

Qt Code:
  1. QGraphicsItem *item = scene.itemAt(50, 50);
To copy to clipboard, switch view to plain text mode 

I get "no matching function for call to 'QGraphicsScene::itemAt(int,int)'.