Solved
Can we declare structure in model.hpp and how to use it in model.cpp ? any syntax , example or something
..
..
Just to do something simple:
//Model.hpp
#ifndef MODEL_HPP
#define MODEL_HPP
class ModelListener;
struct MyStruct
{
int a;
int b;
};
class Model
{
public:
Model();
void bind(ModelListener* listener)
{
modelListener = listener;
}
void tick();
protected:
ModelListener* modelListener;
MyStruct s;
};
#endif // MODEL_HPP//Model.cpp
#include <gui/model/Model.hpp>
#include <gui/model/ModelListener.hpp>
Model::Model() : modelListener(0)
{
s.a = 1;
s.b = 2;
}
void Model::tick()
{
modelListener->setStructValue1(s);
}Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.