title: How to use QGraphicsVeiw
body: <p>I need to create a application,which is created in QMainWindow. I have created application.in UI form I have dragged QGraphicsView. I have created Graphic scene also. 
  I'm posting the code.i'm able to get scene but it by deafult coming at topleft corner. other than coming inside QGraphicsView.suggest me,where I might have gone wrong.</p>
  
  <pre><code>#include &lt;QtGui/QApplication&gt;
  #include "mainwindow.h"
  int main(int argc, char *argv[])
  {
       QApplication a(argc, argv);
       MainWindow w;
       w.show();
      return a.exec();
  }
  
  #ifndef MAINWINDOW_H
  #define MAINWINDOW_H
  
  #include &lt;QMainWindow&gt;
  #include &lt;QGraphicsView&gt;
  #include &lt;QGraphicsScene&gt;
  #include &lt;QBrush&gt;
  
  
   namespace Ui {
  class MainWindow;
  }
  
  class MainWindow : public QMainWindow {
  Q_OBJECT
  public:
  MainWindow(QWidget *parent = 0);
  ~MainWindow();
  
  protected:
  void changeEvent(QEvent *e);
  
   private:
  Ui::MainWindow *ui;
   };
  
  #include "mainwindow.h"
  #include "ui_mainwindow.h"
  
   MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
   ui(new Ui::MainWindow)
   {
     ui-&gt;setupUi(this);
  
     QGraphicsView *view = new QGraphicsView(this);
     QGraphicsScene *scene=new QGraphicsScene();
     scene-&gt;setBackgroundBrush(Qt::red);
     view-&gt;setScene(scene);
  
     }
  
    MainWindow::~MainWindow()
   {
     delete ui;
    }
  
    void MainWindow::changeEvent(QEvent *e)
    {
    QMainWindow::changeEvent(e);
     switch (e-&gt;type()) {
     case QEvent::LanguageChange:
        ui-&gt;retranslateUi(this);
        break;
     default:
        break;
     }
     }
  </code></pre>
  
  <p>Please suggest me.Thanks in advance</p>