src/eric7/EricWidgets/EricProgressDialog.py

branch
eric7
changeset 11035
e1e1d6e317c7
parent 10439
21c28b0f9e41
child 11090
f5f5f5803935
equal deleted inserted replaced
11034:7b8a21fd2d58 11035:e1e1d6e317c7
5 5
6 """ 6 """
7 Module implementing a progress dialog allowing a customized progress bar label. 7 Module implementing a progress dialog allowing a customized progress bar label.
8 """ 8 """
9 9
10 from PyQt6.QtCore import Qt 10 from PyQt6.QtCore import QCoreApplication, Qt
11 from PyQt6.QtWidgets import QProgressBar, QProgressDialog 11 from PyQt6.QtWidgets import QProgressBar, QProgressDialog
12 12
13 13
14 class EricProgressDialog(QProgressDialog): 14 class EricProgressDialog(QProgressDialog):
15 """ 15 """
43 @param parent reference to the parent widget 43 @param parent reference to the parent widget
44 @type QWidget 44 @type QWidget
45 @param flags window flags of the dialog 45 @param flags window flags of the dialog
46 @type Qt.WindowFlags 46 @type Qt.WindowFlags
47 """ 47 """
48 if parent is None:
49 parent = QCoreApplication.instance().getMainWindow()
50
48 if flags is None: 51 if flags is None:
49 flags = Qt.WindowType(0) 52 flags = Qt.WindowType(0)
50 super().__init__(labelText, cancelButtonText, minimum, maximum, parent, flags) 53 super().__init__(labelText, cancelButtonText, minimum, maximum, parent, flags)
51 54
52 self.__progressBar = QProgressBar(self) 55 self.__progressBar = QProgressBar(self)

eric ide

mercurial