17 """ |
17 """ |
18 Class implementing a progress dialog allowing a customized progress bar |
18 Class implementing a progress dialog allowing a customized progress bar |
19 label. |
19 label. |
20 """ |
20 """ |
21 def __init__(self, labelText, cancelButtonText, minimum, maximum, |
21 def __init__(self, labelText, cancelButtonText, minimum, maximum, |
22 format=None, parent=None, flags=Qt.WindowFlags()): |
22 labelFormat=None, parent=None, flags=Qt.WindowFlags()): |
23 """ |
23 """ |
24 Constructor |
24 Constructor |
25 |
25 |
26 @param labelText text of the dialog label (string) |
26 @param labelText text of the dialog label (string) |
27 @param cancelButtonText text of the cancel button (string) |
27 @param cancelButtonText text of the cancel button (string) |
28 @param minimum minimum value (integer) |
28 @param minimum minimum value (integer) |
29 @param maximum maximum value (integer) |
29 @param maximum maximum value (integer) |
30 @keyparam format label format of the progress bar (string) |
30 @keyparam labelFormat label format of the progress bar (string) |
31 @keyparam parent reference to the parent widget (QWidget) |
31 @keyparam parent reference to the parent widget (QWidget) |
32 @keyparam flags window flags of the dialog (Qt.WindowFlags) |
32 @keyparam flags window flags of the dialog (Qt.WindowFlags) |
33 """ |
33 """ |
34 super(E5ProgressDialog, self).__init__( |
34 super(E5ProgressDialog, self).__init__( |
35 labelText, cancelButtonText, minimum, maximum, parent, flags) |
35 labelText, cancelButtonText, minimum, maximum, parent, flags) |
36 |
36 |
37 self.__progressBar = QProgressBar(self) |
37 self.__progressBar = QProgressBar(self) |
38 self.__progressBar.setMinimum(minimum) |
38 self.__progressBar.setMinimum(minimum) |
39 self.__progressBar.setMaximum(maximum) |
39 self.__progressBar.setMaximum(maximum) |
40 if format: |
40 if labelFormat: |
41 self.__progressBar.setFormat(format) |
41 self.__progressBar.setFormat(labelFormat) |
42 |
42 |
43 self.setBar(self.__progressBar) |
43 self.setBar(self.__progressBar) |
44 |
44 |
45 def format(self): |
45 def format(self): |
46 """ |
46 """ |
48 |
48 |
49 @return progress bar format (string) |
49 @return progress bar format (string) |
50 """ |
50 """ |
51 return self.__progressBar.format() |
51 return self.__progressBar.format() |
52 |
52 |
53 def setFormat(self, format): |
53 def setFormat(self, labelFormat): |
54 """ |
54 """ |
55 Public method to set the progress bar format. |
55 Public method to set the progress bar format. |
56 |
56 |
57 @param format progress bar format (string) |
57 @param labelFormat progress bar format (string) |
58 """ |
58 """ |
59 self.__progressBar.setFormat(format) |
59 self.__progressBar.setFormat(labelFormat) |