Hello to everyone.
I'm trying to write a piece of C++/Qt code and I always seem to get stuck at the same thing.
I'm creating a DAQ System for my MSc thesis, who's purpose is to present and get some variables from the user interface (class name Interface) and when a pushbutton is clicked() to pass them to a class named DAQCycle that needs them in order to operate properly. So for example:
# interface.h
class Interface{
public:
Interface();
~Interface();
void doThat();
uint32_t VAR1;
int VAR2;
std::string VAR3;
std::vector<CLASSNAME*> VAR4;
};
#DAQCycle.h
class DAQCycle{...}
# DAQCycle.cpp
DAQCycle::DAQCycle(){
for(int k=0; k<Interface.VAR2; k++){
// doSomething..
}
The problem is of course that I don't create (and I actually I cannot see how to create) an object of the class Interface in order to instantiate its variables that I need for my other class.
Is there any way to circumvent that?
PS. My main() is the standard Qt main function
#main.cpp
#include <QtGui/QApplication>
#include "Interface.h"
#include "DAQCycle.h"
using namespace Ui;
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Interface w;
w.show();
return a.exec();
}
Thanks in advance.