Results 1 to 5 of 5

Thread: Progressbar problem

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2006
    Posts
    3
    Thanks
    1

    Default Progressbar problem

    I have a function

    Qt Code:
    1. void ex
    2. {
    3. long num = 100000;
    4. for(int i=0;i<num;i++)
    5. {
    6. // do something
    7. }
    8. }
    To copy to clipboard, switch view to plain text mode 

    In the mainWindow when I call this function
    I want to have a progress bar that indicates this function is running

    I've used these code


    Qt Code:
    1. void ex()
    2. {
    3. long RowCount = 60000;
    4. QProgressDialog progress(this);
    5. progress.setLabelText("ProgressBar");
    6. progress.setRange(0, RowCount);
    7. progress.setModal(true);
    8. progress.show();
    9. for (long row = 0; row < RowCount; ++row) {
    10. progress.setValue(row);
    11. qApp->processEvents();
    12. if (progress.wasCanceled()) {
    13. }
    14. }
    15. }
    To copy to clipboard, switch view to plain text mode 

    But the progress bar isn't running except it's increasing percentage
    ( it shows up but not progressing )

    can't you help me !

    thanks in advance !
    Last edited by thae; 4th November 2006 at 04:50.

Similar Threads

  1. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 12:45
  2. Problem with bitBlt
    By yellowmat in forum Newbie
    Replies: 1
    Last Post: 5th April 2006, 14:08
  3. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 21:36
  4. Replies: 16
    Last Post: 7th March 2006, 15:57
  5. Problem with screen update...
    By mysearch05 in forum Qt Programming
    Replies: 2
    Last Post: 27th January 2006, 18:24

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.