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 :
... exited with code -1073741819
... 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 :
{
Q_OBJECT
public:
~guiClass
Ui::guiClass *ui;
};
Q_OBJECT
public:
void anything();
guiClass *guiClass;
};
class guiClass : public QMainWindow
{
Q_OBJECT
public:
guiClass(QWidget *parent = 0);
~guiClass
Ui::guiClass *ui;
};
class anotherClass : public QProgressBar {
Q_OBJECT
public:
anotherClass(QObject* parent);
void anything();
guiClass *guiClass;
};
To copy to clipboard, switch view to plain text mode
void anotherClass::anything(){
this->guiClass->ui->progressBar->setValue(80); // THIS IS THE WRONG PART
}
void anotherClass::anything(){
this->guiClass->ui->progressBar->setValue(80); // THIS IS THE WRONG PART
}
To copy to clipboard, switch view to plain text mode
Bookmarks