[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Wed Aug 11 21:38:18 CEST 2004


On Wednesday 11 August 2004 14:50, Andrew Walker wrote:
> CVS commit by arwalker:
>
> Added a progress bar and progress string indicator to the status bar.
> Use the aforementioned to display the progress of the data wizard.

  This is exactly why we shouldn't include this code in CVS yet.  
processEvents() is going to cause us huge nightmares because we will receive 
update events from the threads, among other things.  I spent lots of time 
removing these because of the crashes and bugs they introduced in the past.

+void KstApp::slotUpdateProgress(int iTotal, int iStep, const QString &msg) {
+  if (iStep > 0) {
+    if (!_progressBar->percentageVisible()) {
+      _progressBar->setPercentageVisible(true);
+    }
+    if (iTotal != _progressBar->totalSteps()) {
+      _progressBar->setTotalSteps(iTotal);
+    }
+    _progressMsg->setText(QString::null);
+    _progressBar->setProgress(iStep);
+    _progressMsg->setText(msg);
+  } else {
+    _progressBar->setPercentageVisible(false);
+    _progressMsg->setText(msg);
+    _progressBar->reset();
+  }
+
+  while (kapp->eventLoop()->processEvents(QEventLoop::ExcludeUserInput));
+}
+
+


-- 
George Staikos
KDE Developer			http://www.kde.org/
Staikos Computing Services Inc.	http://www.staikos.net/



More information about the Kst mailing list