rendered paste body// mainwindow.cpp
for(int i=0; i<pChannels.size(); i++) {
classChannel cl = pChannels.value(i);
QRegExp rx(cl.channelActivator);
if( rx.indexIn(theLine)>0 ) {
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<MainWindow> pWorld;
QPointer<classChannel> 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) );
}