Python PySide.QtGui.QProgressBar() Examples

The following are 3 code examples of PySide.QtGui.QProgressBar(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module PySide.QtGui , or try the search function .
Example #1
Source File: Toolbox.py    From CANalyzat0r with GNU General Public License v3.0 5 votes vote down vote up
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 
Example #2
Source File: flowNode.py    From Animation with GNU General Public License v2.0 5 votes vote down vote up
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 
Example #3
Source File: utils.py    From Satori with Artistic License 2.0 4 votes vote down vote up
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)