Hello folks,

I'm experiencing a strange trouble with Qt 4.3.

I created a class which inheritates from QMainWindow:

[HTML]#include <QtGui>
#include <QtCore/QVariant>

#include "population.h"
#include "myGraphicsView.h"

class Ui_MainWindow : public QMainWindow {

Q_OBJECT

public:

// (Simil)Constructor
void setupUi(QMainWindow *MainWindow);
...
Population currentPopulation;
...[/HTML]

I also created a different class, called "Population", defined in the file population.h as follows:

[HTML]#include "mainWindow.h"

class Population : public QWidget {

Q_OBJECT

public:

// Constructor
Population(Ui_MainWindow* myWindow);
...[/HTML]

The population.cpp file starts in this way:

[HTML]#include "population.h"
#include "mainWindow.h"

// Constructor
Population::Population(Ui_MainWindow* myWindow) {
...[/HTML]

What I'd like to do is to be able to access the members of the Main Window inside the Population's class constructor (i.e., the statusbar, the filemenu and so on). Instead, when I try to compile, gcc gives me two times the same error: "expected ')' before '*' token", referring to the "Population(Ui_MainWindow* myWindow);" line of population.h. The error comes out when gcc tries to compile two different files, main.cpp and mainWindow.cpp: two files that have something in common with the MainWindow.

Could someone please give me some hints on how to solve this problem?

Thanks,
Fabio