thanks for your reply;
i have another problem , while inserting items in the scene all items are added at the same time but not one after another like i want them to be added, i've tried to controll this adding action of the scene by controlling the QTimeLine of Container :
something like this:
the variable QTimeLine timeline is declared public in the class container; i use it to controll the animation of the containers.
{
for(int i=0;i<containerNum; i++)
{
Container*[i];
scene1->addItem(c[i]);
c[i]->timeline->start();
c[i+1]->timeline->setPaused(true);
l_items(c[i]);
c[i]->timeline->stop();
scene1->addItem(c[i+1]);
c[i+1]->timeline->start();
l_items()
}
}
void MainGui::addnextContainer(int i, QGraphicsScene *scene1)
{
for(int i=0;i<containerNum; i++)
{
Container*[i];
scene1->addItem(c[i]);
c[i]->timeline->start();
c[i+1]->timeline->setPaused(true);
l_items(c[i]);
c[i]->timeline->stop();
scene1->addItem(c[i+1]);
c[i+1]->timeline->start();
l_items()
}
}
To copy to clipboard, switch view to plain text mode
puting the items in a range in the scene
{
QList<QGraphicsItem*>listing=scene->items();
listing.clear();
for(int i=0; i<listing.size();i++)
{
listing.append(item1);
}
return listing;
}
QList<QGraphicsItem*>MainGui:: l_items(QGraphicsItem *item1)
{
QList<QGraphicsItem*>listing=scene->items();
listing.clear();
for(int i=0; i<listing.size();i++)
{
listing.append(item1);
}
return listing;
}
To copy to clipboard, switch view to plain text mode
and i changed the MainGui.cpp
...
Scene scene= new Scene(this);
addnextContainer(5, scene)
...
...
Scene scene= new Scene(this);
addnextContainer(5, scene)
...
To copy to clipboard, switch view to plain text mode
can someone take a look at this code and tell me please what i'm doing wrong please? now i even cannot see any item anymore.
thanks in advance
Bookmarks