Hey !

I am trying to display what my webcam views in a gridLayout. Here is my code : it compiles but doesn't work : it display a window with the different buttons but not the video from my camera. Can anyone help me to make it work ? I have already seen the Qt documentation and Qt examples but it didn't help me. I am a very beginner in Qt. I work on Windows and Qt5.

Qt Code:
  1. #include "fenetre.h"
  2.  
  3. Fenetre::Fenetre(): QWidget()
  4. {
  5.  
  6. m_up= new QPushButton("up", this);
  7. m_right= new QPushButton("right", this);
  8. m_down= new QPushButton("down", this);
  9. m_left= new QPushButton("left", this);
  10. m_mode= new QPushButton("deplacement", this);
  11.  
  12. //QLabel *image = new QLabel(this);
  13. //image->setPixmap(QPixmap("smile.png"));
  14.  
  15. camera = new QCamera;
  16. cvf = new QCameraViewfinder;
  17. camera->start();
  18.  
  19.  
  20. layout = new QGridLayout;
  21. layout-> addWidget(m_up,0,1);
  22. layout-> addWidget(m_right,1,2);
  23. layout-> addWidget(m_down,2,1);
  24. layout-> addWidget(m_left,1,0);
  25. layout-> addWidget(m_mode,0,0);
  26. //layout->addWidget(image,1,1);
  27. layout-> addWidget(cvf,1,1);
  28. setLayout(layout);
  29.  
  30. QObject::connect(m_mode, SIGNAL(clicked()), this, SLOT(changerMode()));
  31. }
  32.  
  33. void Fenetre::changerMode()
  34. {
  35. if (m_mode->text()=="deplacement")
  36. {
  37. m_up->setText("accelerer");
  38. m_down->setText("ralentir");
  39. m_mode->setText("vision");
  40. }
  41. else
  42. {
  43. m_up->setText("up");
  44. m_down->setText("down");
  45. m_mode->setText("deplacement");
  46. }
  47. }
To copy to clipboard, switch view to plain text mode 

Thank you very much for your help !