ich habe ein programm, inwelchem ich einen Thread starte, welche in einer schleife im Hauptfenster ein Bild austauschen soll.
MainWindow Threads starten:
Code: Alles auswählen
//start the ChannelListAdsChanger
channelBarAd = new AdsChanger(this,this->msmAdsManager,this->datahandler,this->properties);
channelBarAd->start();
QObject::connect(this->channelBarAd, SIGNAL(sigChangeAdd()), this, SLOT(slotChangeAdChannelBar()));
Code: Alles auswählen
void slotChangeAdChannelBar();//QPixmap *pixCode: Alles auswählen
void MainWindow::slotChangeAdChannelBar(){//QPixmap *pix
qDebug() << "+++++++++++++++++++++++ imageLoaded: ";// << pix->height();
//this->ui->lblChannelAd->setPixmap(*pix);
}Code: Alles auswählen
void AdsChanger::run(){
QString adsPath = properties->getAdsPath();
int actRuns = 0;
qDebug() << "AdsChanger: started";
while(!this->stopped && (this->adsRepeats == -1 || actRuns <= this->adsRepeats)){
//change ads
QPixmap *pix = this->msmAdsManager->getNextAdsPicture(this->adsType,this->adsChannel,this->adsFormat);
//send signal back to the calling function
emit this->sigChangeAdd();//pix
this->wait(this->adsInterval);
actRuns++;
}
this->stopped = false;
}Code: Alles auswählen
signals:
void sigChangeAdd();//QPixmap *pixHabe ich hier irgendwas wichtiges vergessen?
Georg