本文整理汇总了Python中PyQt5.QtWidgets.QProgressBar.format方法的典型用法代码示例。如果您正苦于以下问题:Python QProgressBar.format方法的具体用法?Python QProgressBar.format怎么用?Python QProgressBar.format使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets.QProgressBar
的用法示例。
在下文中一共展示了QProgressBar.format方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: E5ProgressDialog
# 需要导入模块: from PyQt5.QtWidgets import QProgressBar [as 别名]
# 或者: from PyQt5.QtWidgets.QProgressBar import format [as 别名]
class E5ProgressDialog(QProgressDialog):
"""
Class implementing a progress dialog allowing a customized progress bar
label.
"""
def __init__(self, labelText, cancelButtonText, minimum, maximum,
format=None, parent=None, flags=Qt.WindowFlags()):
"""
Constructor
@param labelText text of the dialog label (string)
@param cancelButtonText text of the cancel button (string)
@param minimum minimum value (integer)
@param maximum maximum value (integer)
@keyparam format label format of the progress bar (string)
@keyparam parent reference to the parent widget (QWidget)
@keyparam flags window flags of the dialog (Qt.WindowFlags)
"""
super(E5ProgressDialog, self).__init__(
labelText, cancelButtonText, minimum, maximum, parent, flags)
self.__progressBar = QProgressBar(self)
self.__progressBar.setMinimum(minimum)
self.__progressBar.setMaximum(maximum)
if format:
self.__progressBar.setFormat(format)
self.setBar(self.__progressBar)
def format(self):
"""
Public method to get the progress bar format.
@return progress bar format (string)
"""
return self.__progressBar.format()
def setFormat(self, format):
"""
Public method to set the progress bar format.
@param format progress bar format (string)
"""
self.__progressBar.setFormat(format)