May 3, 2012

ahura_24 ahura_24
Ant Farmer
98 posts

update question

 

hi every body. i have one thread or function that change the location of one button in ‘for’ statement or ….. i want to show this change like animation . (exactly in recursion function i want update my forms to show my data)
i do this in .net with refresh() function.i use update() and repaint() int Qt but dont works!
please help me.

for example

  1. for (int i = 0; i < 10; i++) {
  2.         listWidget->addItem( "--" );
  3.         this->update();  // i want in each step display changes in my application!
  4.  
  5.         Sleep( 100 );
  6.     }

4 replies

May 4, 2012

1+1=2 1+1=2
Ant Farmer
316 posts

;-) Never try to use Sleep() in your main thread (gui thread).

——
In addition,

You can try to use QTimer, or call QCoreApplication::processEvents() manually.

May 4, 2012

ahura_24 ahura_24
Ant Farmer
98 posts

but how can i show movement of button in my widget ?!! i want show this movement like animation :-(

May 4, 2012

1+1=2 1+1=2
Ant Farmer
316 posts

ahura_24 wrote:
but how can i show movement of button in my widget ?!! i want show this movement like animation :-(

QTimer

or

QTimeLine

or

the powerful Animation Framework provided by Qt 4.6 +

or

May 4, 2012

ahura_24 ahura_24
Ant Farmer
98 posts

ummm tnx but do you have article about of ? how can i learn ?

 
  ‹‹ Panel (hide/show)      converting to execution character set: Illegal byte sequence Erorr ?!!! ››

You must log in to post a reply. Not a member yet? Register here!