I have one class:
field.h
#ifndef FIELD_H
#define FIELD_H
etc
#endif
#ifndef FIELD_H
#define FIELD_H
class Field : public QWidget
etc
#endif
To copy to clipboard, switch view to plain text mode
And then I have another class that uses this class as composition:
Page.h
#ifndef PAGE_H
#define PAGE_H
#include "field.h"
{
Field array[10];
}
#endif
#ifndef PAGE_H
#define PAGE_H
#include "field.h"
class Page : public QWidget
{
Field array[10];
}
#endif
To copy to clipboard, switch view to plain text mode
At compile I get the error of 'Field' does not name a type, I don't know how to fix this? Internet seems to spring up a lot of circular includes as being the culprit however I don't understand how this is the case given that this is composition and I've got all my includes all up and running and it seems to work here:
http://www.learncpp.com/cpp-tutorial/102-composition/
!!!!!!!!!!!!!!!!!!!!!!!!! << sorry coding a line a week is frustrating. Every time something is added, a new error comes about and it's just beyond frustrating. Programing isn't my forte I don't think.
Bookmarks