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