Coverage for cclib/progress/qt4progress.py : 0%
Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1# -*- coding: utf-8 -*-
2#
3# Copyright (c) 2017, the cclib development team
4#
5# This file is part of cclib (http://cclib.github.io) and is distributed under
6# the terms of the BSD 3-Clause License.
8from PyQt4 import QtGui, QtCore
11class Qt4Progress(QtGui.QProgressDialog):
13 def __init__(self, title, parent=None):
15 QtGui.QProgressDialog.__init__(self, parent)
17 self.nstep = 0
18 self.text = None
19 self.oldprogress = 0
20 self.progress = 0
21 self.calls = 0
22 self.loop=QtCore.QEventLoop(self)
23 self.setWindowTitle(title)
25 def initialize(self, nstep, text=None):
27 self.nstep = nstep
28 self.text = text
29 self.setRange(0,nstep)
30 if text:
31 self.setLabelText(text)
32 self.setValue(1)
33 #sys.stdout.write("\n")
35 def update(self, step, text=None):
37 if text:
38 self.setLabelText(text)
39 self.setValue(step)
40 self.loop.processEvents(QtCore.QEventLoop.ExcludeUserInputEvents)