// mainwindow.cpp for(int i=0; i0 ) { QString tmpKeyword = rx.cap(1); winChannel *tmpChannel = new winChannel(this); --> HERE IS THE PROBLEM tmpChannel->configureWithKeyword(&cl, tmpKeyword); tmpChannel->show(); pChannelWindows.append(tmpChannel); } } // winchannel.h class winChannel : public QDialog, private Ui::winChannel { Q_OBJECT public: winChannel(MainWindow *, QWidget *parent=0); ~winChannel(); QPointer pWorld; QPointer pChannel; public slots: void configureWithKeyword(classChannel*, QString); void onUserInput(); }; // winchannel.cpp void winChannel::configureWithKeyword(classChannel *theChannel, QString theKeyword) { pChannel = theChannel; setWindowTitle(theKeyword); fStatusTitle->setText( tr("Conversation with %1").arg(theKeyword) ); }