Hello everyone,
I want to make presentation of sorting algorithms in QT. I've written algorithms for example (only overview):
In paintEvent function there are rectangles changing it's places after every move - redrawing after every `update()`Qt Code:
for( int r=count-1; r>0; --r ){ for( int i=0; i<r; ++i ){ if( elements[i]>elements[i+1] ) exch(elements[i], elements[i+1]); update(); } }To copy to clipboard, switch view to plain text mode
But, unfortunately it is going so fast that I can only see the final effect of sorting.
All I want is to WAIT for a second before every `update`. It really doesn't matter if it should be pure C++ or QT code.
Thanks in advance.
Bookmarks