Both objects appear on the form, for temp1 works as a slot createNewSet () and connect. For _firstSet, neither works. Fields class Cows:
class Cows : public QMainWindow { Q_OBJECT public: Cows(QWidget *parent = 0); ~Cows(); private: Ui::CowsClass ui; estimatedSet* _firstSet; QList<estimatedSet*> * _otherSets; }; In the constructor of the Cows class, I initialize the objects of the estimatedSet class:
Cows::Cows(QWidget *parent) : QMainWindow(parent) { ui.setupUi(this); estimatedSet * temp1 = new estimatedSet(this); estimatedSet temp2 = new estimatedSet(this); _firstSet = &temp2; temp1.last()->createNewSet(); connect(temp1, SIGNAL(fillComplete()), this, SLOT(prepareShift())); }