hello,
i want to know how to debug with Qt because i want to execute this code but it gives an error.
imageViewer.h
Qt Code:
  1. #ifndef IMAGEVIEWER_H
  2. #define IMAGEVIEWER_H
  3. #include<QtWidgets>
  4.  
  5. class ImageViewer : public QMainWindow
  6. {
  7. Q_OBJECT
  8. public:
  9. ImageViewer();
  10. public slots:
  11. void ouvrir();
  12. private:
  13. QLabel *label;
  14. QImage *image;
  15. QVBoxLayout *layout;
  16. };
  17.  
  18. #endif // IMAGEVIEWER_H
To copy to clipboard, switch view to plain text mode 
imageViewer.cpp
Qt Code:
  1. #include "imageviewer.h"
  2.  
  3. ImageViewer::ImageViewer(): QMainWindow()
  4. {
  5. label = new QLabel(this);
  6.  
  7. label->move(100,100);
  8. label->setFixedSize(500,500);
  9. layout = new QVBoxLayout(this);
  10. layout->addWidget(label);
  11. this->setLayout(layout);
  12. QMenu *fichier = menuBar()->addMenu("Fichier");
  13. QMenu *edition = menuBar()->addMenu("Edition");
  14.  
  15. QAction *ouvrir = new QAction("Ouvrir",this);
  16. fichier->addAction(ouvrir);
  17. connect(ouvrir,SIGNAL(triggered(bool)),this,SLOT(ouvrir()));
  18.  
  19.  
  20.  
  21. }
  22.  
  23. void ImageViewer::ouvrir()
  24. {
  25. QString nomFichier = QFileDialog::getOpenFileName(this,"Open file", "C://");
  26. image = new QImage(nomFichier);
  27. label->setPixmap(QPixmap::fromImage(QImage(nomFichier)));
  28. }
To copy to clipboard, switch view to plain text mode 
and the error is
cannot open output file debug\app.exe: Permission denied
error: ld returned 1 exit status

Thank you.