Hello forum
I tries for the first time at the Model View Controller programming.
I create three classes one for the logic, one for the Gui
and one for the controlling.
But i have a problem by the parameter handover in the logic class.
The application crashed after click button.
My test programm.
Header:
#ifndef LOGIC_H
#define LOGIC_H
#include <QDebug>
#include "gui.h"
class Gui;
class logic
{
Gui *testgui;
public:
logic(Gui *myGui);
void writeTEST();
};
#endif // LOGIC_H
#ifndef LOGIC_H
#define LOGIC_H
#include <QDebug>
#include "gui.h"
class Gui;
class logic
{
Gui *testgui;
public:
logic(Gui *myGui);
void writeTEST();
};
#endif // LOGIC_H
To copy to clipboard, switch view to plain text mode
CPP:
#include "logic.h"
logic::logic(Gui *myGui)
{
testgui = myGui;
}
void logic::writeTEST()
{
testgui->testTE->setText("test"); //application crashed
//testgui->testTE->setText("test"); //application run if it comment out
}
#include "logic.h"
logic::logic(Gui *myGui)
{
testgui = myGui;
}
void logic::writeTEST()
{
testgui->testTE->setText("test"); //application crashed
//testgui->testTE->setText("test"); //application run if it comment out
}
To copy to clipboard, switch view to plain text mode
Since the proplem is unmistakable by the function call exist.
I don't to see the wood for the trees.
I hope anybody can help me.
I do apologize for my bad english
best regards
Basti1990
Bookmarks