so the fallowing code seems to be missing 1 of the strings in the list
From Debugger:
[0] "fb70a926de17ed214dcbe1edd64c2d96.png" QString [1] "cd3eb7c9403913bf59b414dff8f64d54.png" QString
sClientz2_300_300Data <2 items> QStringList
[0] "fb70a926de17ed214dcbe1edd64c2d96.png" QString
[1] "cd3eb7c9403913bf59b414dff8f64d54.png" QString
To copy to clipboard, switch view to plain text mode
so the stringlist sClientz2_300_300Data has 2 items 0,1 but when the following is executed
in main()
z2_300_300
= new QLabel(this);
z2s1_Iterator = new QStringListIterator(sClientz2_300_300Data);
z2_300_300
->setGeometry
(QRect(781,
34,
475,
360));
connect(timerZ2S1, SIGNAL(timeout()), this, SLOT(startZ2S1()));
timerZ2S1->start(4000);
z2_300_300 = new QLabel(this);
timerZ2S1 = new QTimer(this);
z2s1_Iterator = new QStringListIterator(sClientz2_300_300Data);
z2_300_300->setGeometry(QRect(781,34,475,360));
connect(timerZ2S1, SIGNAL(timeout()), this, SLOT(startZ2S1()));
timerZ2S1->start(4000);
To copy to clipboard, switch view to plain text mode
in startZ2S1()
if(z2s1_Iterator->hasNext())
{
z2_300_300->clear();
//QPixmap *pixmap = new QPixmap("/ttm/images/" + z2s1_Iterator->next());
QString pixpath
= "/ttm/images/" + z2s1_Iterator
->next
();
z2_300_300
->setPixmap
(QPixmap(pixpath
));
}
if(!z2s1_Iterator->hasNext())
{
z2s1_Iterator->toFront();
}
if(z2s1_Iterator->hasNext())
{
z2_300_300->clear();
//QPixmap *pixmap = new QPixmap("/ttm/images/" + z2s1_Iterator->next());
QString pixpath = "/ttm/images/" + z2s1_Iterator->next();
z2_300_300->setPixmap(QPixmap(pixpath));
}
if(!z2s1_Iterator->hasNext())
{
z2s1_Iterator->toFront();
}
To copy to clipboard, switch view to plain text mode
when the above code is executed it skips item 0 and goes to item 1 and loops it every time timeout() is called
where am i going wrong ?
Bookmarks