当前位置: 首页>>代码示例>>Python>>正文


Python QtGui.QProgressBar方法代码示例

本文整理汇总了Python中PySide.QtGui.QProgressBar方法的典型用法代码示例。如果您正苦于以下问题:Python QtGui.QProgressBar方法的具体用法?Python QtGui.QProgressBar怎么用?Python QtGui.QProgressBar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PySide.QtGui的用法示例。


在下文中一共展示了QtGui.QProgressBar方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: getWorkingDialog

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QProgressBar [as 别名]
def getWorkingDialog(text):
        """
        Generates a working dialog object which blocks the UI.

        :param text: Text to display while working
        :return: The created working dialog widget
        """

        progressDialog = QProgressDialog(
            text, "", 0, 0, parent=Globals.ui.tabWidgetMain)

        progressDialog.setMinimumDuration(0)
        progressDialog.setMinimum(0)
        progressDialog.setMaximum(0)
        progressDialog.setRange(0, 0)

        progressDialog.setFixedSize(progressDialog.width(),
                                    progressDialog.height())

        # No cancel button <:
        progressDialog.setCancelButton(None)
        # No X button
        progressDialog.setWindowFlags(
            progressDialog.windowFlags() & ~QtCore.Qt.WindowCloseButtonHint)

        progressBar = progressDialog.findChild(QProgressBar)
        # :S:S
        progressBar.setMinimumWidth(progressDialog.width() + 20)

        return progressDialog 
开发者ID:schutzwerk,项目名称:CANalyzat0r,代码行数:32,代码来源:Toolbox.py

示例2: createProgressBar

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QProgressBar [as 别名]
def createProgressBar(label=None):
	w=QtGui.QWidget()
	hbox = QtGui.QHBoxLayout()
	w.setLayout(hbox)
	pb=QtGui.QProgressBar()
	w.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)
	if label!=None:
		lab=QtGui.QLabel(label)
		hbox.addWidget(lab)
	hbox.addWidget(pb)
	w.show()
	FreeCAD.w=w
	pb.setValue(0)
	w.pb=pb
	return w 
开发者ID:microelly2,项目名称:Animation,代码行数:17,代码来源:flowNode.py

示例3: __init__

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QProgressBar [as 别名]
def __init__(self, software_data, parent):
        super(SoftwareLabel, self).__init__()
        self._data = software_data
        self.parent = parent
        self.setText(software_data['title'])
        font = self.parent.get_default_font(14)
        #font.setUnderline(True)
        self.setFont(font)
        self.setStyleSheet("QLabel {color:white; background-color:transparent; }QLabel::hover {color:rgb(220, 220, 220);}")
        #  parent.set_shadow_effect(self)
        self._showing = False
        self.description_panel = QtGui.QWidget(self.parent)
        self.description_panel.setStyleSheet("background:rgba(142, 116, 173, 100)")
        self.description_panel.setVisible(False)
        self.description_layout = QtGui.QVBoxLayout(self.description_panel)
        self.description_layout.setContentsMargins(10,0,0,10)

        self.sha256sum_layout = QtGui.QHBoxLayout()
        self.description_layout.addLayout(self.sha256sum_layout)
        self.sha256sum_edit = QtGui.QLineEdit(self.sha256sum())
        self.sha256sum_edit.setFont(self.parent.get_default_font(8))
        self.sha256sum_edit.setStyleSheet("color:white;background:rgba(142, 116, 173, 0);border: 0px;")
        self.sha256sum_edit.setAutoFillBackground(True)
        self.sha256sum_edit.setReadOnly(True)
        label = QtGui.QLabel('sha256:')
        label.setFont(self.parent.get_default_font(8))
        label.setStyleSheet("color:white;background:rgba(142, 116, 173, 0);")
        label.setAutoFillBackground(False)
        self.sha256sum_layout.addWidget(label)
        self.sha256sum_layout.addWidget(self.sha256sum_edit)
        self.sha256sum_layout.addStretch()
        self.download_layout = QtGui.QHBoxLayout()
        self.description_layout.addLayout(self.download_layout)
        self.download_button = QtGui.QPushButton(self.description_panel)
        self.download_button.setText("Download")
        self.download_button.setIcon(QtGui.QIcon(":/icons/download.png"))
        self.download_button.setFlat(True)
        self.download_button.setStyleSheet("color:white;")
        self.download_button.setFont(self.parent.get_default_font(10))
        self.download_button.setIconSize(QtCore.QSize(30,30))
        self.download_layout.addWidget(self.download_button)
        self.download_progress = QtGui.QProgressBar()
        self.download_progress.setVisible(False)
        self.download_progress.setStyleSheet("QProgressBar {\n	background-color: transparent;\n color:white;   border-radius: 1px;\n	text-align: center;\n}\n\nQProgressBar::chunk {\n    background-color:rgb(62, 63, 94);\n	border-radius: 1px;\n	width: 1px;\n}")
        #self.download_progress.setTextVisible(False)
        self.download_progress.setFormat("Downloading %p%")
        self.download_layout.addWidget(self.download_progress)
        self.download_layout.addStretch()
        self.clicked.connect(lambda: self.set_showing(not self.showing()))
        self.download_button.clicked.connect(self.download_button_clicked)
        self.current_download = None
        self.manager = QtNetwork.QNetworkAccessManager(self.parent) 
开发者ID:glamrock,项目名称:Satori,代码行数:54,代码来源:utils.py


注:本文中的PySide.QtGui.QProgressBar方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。