I have a function
	
	- void ex 
- { 
- 	long num = 100000; 
- 	for(int i=0;i<num;i++) 
- 	{ 
- 		// do something 
- 	} 
- } 
        void ex
{
	long num = 100000;
	for(int i=0;i<num;i++)
	{
		// do something
	}
}
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
	
	- void ex() 
- { 
-     long RowCount = 60000; 
-     progress.setLabelText("ProgressBar"); 
-     progress.setRange(0, RowCount); 
-     progress.setModal(true); 
-     progress.show(); 
- 	for (long row = 0; row < RowCount; ++row) { 
-         progress.setValue(row); 
-         qApp->processEvents(); 
-         if (progress.wasCanceled()) { 
-         } 
-     } 
- } 
        void ex()
{
    long RowCount = 60000;
    QProgressDialog progress(this);
    progress.setLabelText("ProgressBar");
    progress.setRange(0, RowCount);
    progress.setModal(true);
    progress.show();
	for (long row = 0; row < RowCount; ++row) {
        progress.setValue(row);
        qApp->processEvents();
        if (progress.wasCanceled()) {
        }
    }
}
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 !
				
			
Bookmarks