Hi there !

I am trying to change the value of a QProgressBar from a class named anotherClass (not from my gui class, which is guiClass).

It builds, but the resulting build crashes !

Here is the error in QT Creator :

Qt Code:
  1. ... exited with code -1073741819
To copy to clipboard, switch view to plain text mode 

=> -1073741819 indicates an access violation in windows. An access violation means your process has tried to access memory (ie dereference a pointer) that does not belong to it.


Here is my code :


Qt Code:
  1. class guiClass : public QMainWindow
  2. {
  3. Q_OBJECT
  4.  
  5. public:
  6. guiClass(QWidget *parent = 0);
  7. ~guiClass
  8. Ui::guiClass *ui;
  9.  
  10. };
  11.  
  12. class anotherClass : public QProgressBar {
  13.  
  14. Q_OBJECT
  15.  
  16. public:
  17. anotherClass(QObject* parent);
  18. void anything();
  19. guiClass *guiClass;
  20.  
  21. };
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. void anotherClass::anything(){
  2. this->guiClass->ui->progressBar->setValue(80); // THIS IS THE WRONG PART
  3. }
To copy to clipboard, switch view to plain text mode