I did it, but there's no change, nothing moves.
can someone post me an example that works please?
what i want is to move the item upper in the vertical direction.
thanks for help.
I did it, but there's no change, nothing moves.
can someone post me an example that works please?
what i want is to move the item upper in the vertical direction.
thanks for help.
it works now! thanks very much for the last idea!
but there's another problem, the item is moving down. How can i get it moving up first and then moving down and the movement should be inside the lines (i mean the item should remain inside the lines when moving) .
thanks for your help.
The movement is controlled by the animation object:
Qt Code:
for( int i = 0; i < 50; ++i ) { anim.setTranslationAt( i / 100.0, 0, i ); } for( int i = 50; i < 100; ++i ) { anim.setTranslationAt( i / 100.0, 0, 50 - i ); }To copy to clipboard, switch view to plain text mode
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.
puting the items in a range in the sceneQt Code:
{ 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
and i changed the MainGui.cppQt Code:
{ 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
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.Qt Code:
... Scene scene= new Scene(this); addnextContainer(5, scene) ...To copy to clipboard, switch view to plain text mode
thanks in advance
Last edited by jpn; 17th June 2008 at 15:16. Reason: missing [code] tags
What is l_items() method supposed to do? Now it just returns an empty list.
apology for the late reply, i did something else as i didn't get the solution of this problem.
back to your question.
the l_items() method is supposed to list the containers objects which are added to the scene. Can you also help me by controlling the addItem() method so that the containers should be added one by one and not all at the same time?
thanks in advance.
the items are already animated and it works very well, but what i need now is to get control over the addItem() method of scene, so that when i add n items in the scene for instance, i should get them added one after another and not as a group of n added of course as animation.
i also tried to remove listing.clear() completely but it doesn't do anything different.
From Guru:Would it be enough if there was some delay between calls to addItem()?
i don't understand what you mean , can you please send me the example code to compile myself and see what you exactly mean with"some delay between calls to addItem()"
I have another question concerning Qt4.3 Network. There is an example named :"blockingFortuneclient" , i've tried to run that with eclipse on window(vista) but i cannot run it succesfully. wenn i try to input a port number it breaks, i mean it doesn't enable to input the port number.Can someone tell me please what is the problem.
Another question is : can i implement a middleware of RFID-System in the same way as this example to receive Data from a RFID-Reader?
or does someone know how to implement an RFID-receiver with Qt ? i will be very thankfull if someone send me an example code.
thanks for your reply.
As a result user would see that one item appears on the scene, after a while another one appears, then another and so on. Is that what you want by writing "one after another"?
In Qt applications you usually add delay with QTimer.
What "breaks" mean in exactly this case? Does the application crash or it starts properly but you can't enter anything into line edits?
Everything depends on the RFID reader and its drivers. Some readers have USB or RS-232C interfaces and for these you don't need any networking code.
Next time please ask unrelated questions in new threads.
Guru
As a result user would see that one item appears on the scene, after a while another one appears, then another and so on. Is that what you want by writing "one after another"?
Holy:
it's exactly what i mean .
Guru:
In Qt applications you usually add delay with QTimer.
Holy:
Isn't it possible with QTimeLine? can i get an example please?
Guru:
What "breaks" mean in exactly this case? Does the application crash or it starts properly but you can't enter anything into line edits?
Holy: I don't know what the problem was, i've just closed Eclipse and now it's alright,it's working again.
Thanks for your answer.
Bookmarks