Python PyQt5.QtWidgets.QProgressBar() Examples

The following are 30 code examples for showing how to use PyQt5.QtWidgets.QProgressBar(). These examples are extracted from open source projects. 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 check out the related API usage on the sidebar.

You may also want to check out all available functions/classes of the module PyQt5.QtWidgets , or try the search function .

Example 1
Project: DevilYuan   Author: moyuanz   File: DySubInfoWidget.py    License: MIT License 6 votes vote down vote up
def _initUi(self):
        """初始化界面"""

        self._progressTotal = QProgressBar(self)
        self._logDescriptionLabel = QLabel()
        self._logTimeLabel = QLabel()
        self._logWarningLabel = QLabel()
        self._logErrorLabel = QLabel()

        self._logWarningLabel.setStyleSheet('color:#FF6100')
        self._logErrorLabel.setStyleSheet('color:red')

        grid = QGridLayout()
        grid.addWidget(self._progressTotal, 0, 0)
        grid.addWidget(self._logErrorLabel, 0, 1)
        grid.addWidget(self._logWarningLabel, 0, 2)
        grid.addWidget(self._logTimeLabel, 0, 3)
        grid.addWidget(self._logDescriptionLabel, 0, 4)

        self.setLayout(grid)

        self._initMenu() 
Example 2
Project: DevilYuan   Author: moyuanz   File: DyProgressWidget.py    License: MIT License 6 votes vote down vote up
def _initUi(self):
        """初始化界面"""
        self.setWindowTitle('进度')

        labelTotal = QLabel('总体进度')
        labelSingle = QLabel('个体进度')

        self._progressSingle = QProgressBar(self)
        self._progressTotal = QProgressBar(self)

        vbox = QVBoxLayout()
        vbox.addWidget(labelTotal)
        vbox.addWidget(self._progressTotal)
        vbox.addWidget(labelSingle)
        vbox.addWidget(self._progressSingle)
        vbox.addStretch()

        self.setLayout(vbox) 
Example 3
Project: PyQt5-Apps   Author: taseikyo   File: main.py    License: GNU General Public License v3.0 6 votes vote down vote up
def singleDownload(self):
        print('single')
        row = self.downloadWidget.rowCount()
        self.downloadWidget.setRowCount(row+1)
        item = QTableWidgetItem(self.title)
        self.downloadWidget.setItem(row, 0, item)
        item = QTableWidgetItem('p{}'.format(self.page))
        self.downloadWidget.setItem(row, 1, item)
        item = QTableWidgetItem('0/{}'.format(self.slices))
        self.downloadWidget.setItem(row, 2, item)
        qpb = QProgressBar()
        qpb.setValue(0)
        self.downloadWidget.setCellWidget(row, 3, qpb)
        # print(self.links)
        t = Downloader(self.av, self.links)
        self.row2qthread[row] = t
        t.finish.connect(self.downloaded)
        t.signal.connect(self.updateItem)
        t.cur_slice.connect(self.updateItem)
        t.start()
        # print(int(t.currentThreadId())) 
Example 4
Project: eddy   Author: danielepantaleone   File: progress.py    License: GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, title='', mtime=0.5, parent=None):
        """
        Initialize the form dialog.
        :type title: str
        :type mtime: float
        :type parent: QWidget
        """
        super().__init__(parent)
        self.mtime = time() + mtime
        self.progressBar = QtWidgets.QProgressBar(self)
        self.progressBar.setAlignment(QtCore.Qt.AlignHCenter)
        self.progressBar.setRange(0, 0)
        self.progressBar.setFixedSize(300, 30)
        self.progressBar.setTextVisible(True)
        self.progressBar.setFormat(title or 'Busy ...')
        self.mainLayout = QtWidgets.QVBoxLayout(self)
        self.mainLayout.addWidget(self.progressBar)
        self.setWindowIcon(QtGui.QIcon(':/icons/128/ic_eddy'))
        self.setWindowTitle(title or 'Busy ...')
        self.setFixedSize(self.sizeHint())

    #############################################
    #   INTERFACE
    ################################# 
Example 5
Project: Qt5-Python-GUI-Programming-Cookbook   Author: PacktPublishing   File: demoProgressBar.py    License: MIT License 6 votes vote down vote up
def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(350, 153)
        self.progressBar = QtWidgets.QProgressBar(Dialog)
        self.progressBar.setGeometry(QtCore.QRect(40, 60, 281, 23))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.progressBar.setFont(font)
        self.progressBar.setProperty("value", 0)
        self.progressBar.setObjectName("progressBar")
        self.label = QtWidgets.QLabel(Dialog)
        self.label.setGeometry(QtCore.QRect(80, 20, 181, 21))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label.setFont(font)
        self.label.setObjectName("label")
        self.pushButtonStart = QtWidgets.QPushButton(Dialog)
        self.pushButtonStart.setGeometry(QtCore.QRect(80, 110, 151, 31))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.pushButtonStart.setFont(font)
        self.pushButtonStart.setObjectName("pushButtonStart")

        self.retranslateUi(Dialog)
        QtCore.QMetaObject.connectSlotsByName(Dialog) 
Example 6
Project: picasso   Author: jungmannlab   File: toraw.py    License: MIT License 6 votes vote down vote up
def to_raw(self):
        text = self.path_edit.toPlainText()
        paths = text.splitlines()
        movie_groups = io.get_movie_groups(paths)
        n_movies = len(movie_groups)
        if n_movies == 1:
            text = "Converting 1 movie..."
        else:
            text = "Converting {} movies...".format(n_movies)
        self.progress_dialog = QtWidgets.QProgressDialog(
            text, "Cancel", 0, n_movies, self
        )
        progress_bar = QtWidgets.QProgressBar(self.progress_dialog)
        progress_bar.setTextVisible(False)
        self.progress_dialog.setBar(progress_bar)
        self.progress_dialog.setMaximum(n_movies)
        self.progress_dialog.setWindowTitle("Picasso: ToRaw")
        self.progress_dialog.setWindowModality(QtCore.Qt.WindowModal)
        self.progress_dialog.canceled.connect(self.cancel)
        self.progress_dialog.closeEvent = self.cancel
        self.worker = Worker(movie_groups)
        self.worker.progressMade.connect(self.update_progress)
        self.worker.finished.connect(self.on_finished)
        self.worker.start()
        self.progress_dialog.show() 
Example 7
Project: tierpsy-tracker   Author: ver228   File: AnalysisProgress_ui.py    License: MIT License 6 votes vote down vote up
def setupUi(self, AnalysisProgress):
        AnalysisProgress.setObjectName("AnalysisProgress")
        AnalysisProgress.resize(594, 465)
        self.verticalLayout_2 = QtWidgets.QVBoxLayout(AnalysisProgress)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.verticalLayout = QtWidgets.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.progressBar = QtWidgets.QProgressBar(AnalysisProgress)
        self.progressBar.setProperty("value", 0)
        self.progressBar.setInvertedAppearance(False)
        self.progressBar.setObjectName("progressBar")
        self.verticalLayout.addWidget(self.progressBar)
        self.textEdit = QtWidgets.QTextEdit(AnalysisProgress)
        self.textEdit.setReadOnly(True)
        self.textEdit.setObjectName("textEdit")
        self.verticalLayout.addWidget(self.textEdit)
        self.verticalLayout_2.addLayout(self.verticalLayout)

        self.retranslateUi(AnalysisProgress)
        QtCore.QMetaObject.connectSlotsByName(AnalysisProgress) 
Example 8
Project: PyQt   Author: PyQt5   File: SuspendThread.py    License: GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, *args, **kwargs):
        super(Window, self).__init__(*args, **kwargs)
        layout = QVBoxLayout(self)
        self.progressBar = QProgressBar(self)
        self.progressBar.setRange(0, 100)
        layout.addWidget(self.progressBar)
        self.startButton = QPushButton('开启线程', self, clicked=self.onStart)
        layout.addWidget(self.startButton)
        self.suspendButton = QPushButton(
            '挂起线程', self, clicked=self.onSuspendThread, enabled=False)
        layout.addWidget(self.suspendButton)
        self.resumeButton = QPushButton(
            '恢复线程', self, clicked=self.onResumeThread, enabled=False)
        layout.addWidget(self.resumeButton)
        self.stopButton = QPushButton(
            '终止线程', self, clicked=self.onStopThread, enabled=False)
        layout.addWidget(self.stopButton)

        # 当前线程id
        print('main id', int(QThread.currentThreadId()))

        # 子线程
        self._thread = Worker(self)
        self._thread.finished.connect(self._thread.deleteLater)
        self._thread.valueChanged.connect(self.progressBar.setValue) 
Example 9
Project: PyQt   Author: PyQt5   File: moveToThread.py    License: GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, *args, **kwargs):
        super(Window, self).__init__(*args, **kwargs)
        layout = QVBoxLayout(self)
        self.progressBar = QProgressBar(self)
        self.progressBar.setRange(0, 100)
        layout.addWidget(self.progressBar)
        layout.addWidget(QPushButton('开启线程', self, clicked=self.onStart))

        # 当前线程id
        print('main id', int(QThread.currentThreadId()))

        # 启动线程更新进度条值
        self._thread = QThread(self)
        self._worker = Worker()
        self._worker.moveToThread(self._thread)  # 移动到线程中执行
        self._thread.finished.connect(self._worker.deleteLater)
        self._worker.valueChanged.connect(self.progressBar.setValue) 
Example 10
Project: qomui   Author: corrad1nho   File: widgets.py    License: GNU General Public License v3.0 6 votes vote down vote up
def setupUi(self, ProgessBarWidget):
        self.horizontalLayout = QtWidgets.QHBoxLayout(ProgessBarWidget)
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.taskLabel = QtWidgets.QLabel(ProgessBarWidget)
        self.taskLabel.setObjectName(_fromUtf8("taskLabel"))
        bold_font = QtGui.QFont()
        bold_font.setPointSize(13)
        bold_font.setBold(True)
        bold_font.setWeight(75)
        self.taskLabel.setFont(bold_font)
        self.horizontalLayout.addWidget(self.taskLabel)
        self.waitBar = QtWidgets.QProgressBar(ProgessBarWidget)
        self.waitBar.setObjectName(_fromUtf8("waitBar"))
        self.horizontalLayout.addWidget(self.waitBar)
        self.cancelButton = QtWidgets.QPushButton(ProgessBarWidget)
        self.cancelButton.setObjectName(_fromUtf8("cancelButton"))
        self.horizontalLayout.addWidget(self.cancelButton)

        self.cancelButton.clicked.connect(self.cancel)
        self.waitBar.setRange(0, 0) 
Example 11
Project: DevilYuan   Author: shakenetwork   File: DySubInfoWidget.py    License: MIT License 6 votes vote down vote up
def _initUi(self):
        """初始化界面"""

        self._progressTotal = QProgressBar(self)
        self._logDescriptionLabel = QLabel()
        self._logTimeLabel = QLabel()
        self._logWarningLabel = QLabel()
        self._logErrorLabel = QLabel()

        self._logWarningLabel.setStyleSheet('color:#FF6100')
        self._logErrorLabel.setStyleSheet('color:red')

        grid = QGridLayout()
        grid.addWidget(self._progressTotal, 0, 0)
        grid.addWidget(self._logErrorLabel, 0, 1)
        grid.addWidget(self._logWarningLabel, 0, 2)
        grid.addWidget(self._logTimeLabel, 0, 3)
        grid.addWidget(self._logDescriptionLabel, 0, 4)

        self.setLayout(grid)

        self._initMenu() 
Example 12
Project: DevilYuan   Author: shakenetwork   File: DyProgressWidget.py    License: MIT License 6 votes vote down vote up
def _initUi(self):
        """初始化界面"""
        self.setWindowTitle('进度')

        labelTotal = QLabel('总体进度')
        labelSingle = QLabel('个体进度')

        self._progressSingle = QProgressBar(self)
        self._progressTotal = QProgressBar(self)

        vbox = QVBoxLayout()
        vbox.addWidget(labelTotal)
        vbox.addWidget(self._progressTotal)
        vbox.addWidget(labelSingle)
        vbox.addWidget(self._progressSingle)
        vbox.addStretch()

        self.setLayout(vbox) 
Example 13
Project: code-jam-5   Author: python-discord   File: seeker.py    License: MIT License 6 votes vote down vote up
def __init__(self, player: 'MusicPlayer'):  # noqa: F821
        super().__init__()
        self.player = player
        self.player.positionChanged.connect(self.update_position)
        self.setTextVisible(False)
        self.setRange(0, 1000)
        self.setFixedHeight(25)
        self.dragging = False

        self.setStyleSheet(
            """
            QProgressBar {
                margin: 10px;
                height: 5px;
                border: 0px solid #555;
                border-radius: 2px;
                background-color: #666;
            }

            QProgressBar::chunk {
                background-color: white;
                width: 1px;
            }
            """
        ) 
Example 14
Project: simnibs   Author: simnibs   File: head_model_OGL.py    License: GNU General Public License v3.0 5 votes vote down vote up
def setProgressBar(self):

        self.progressBar = QtWidgets.QProgressBar(self)
        self.progressBar.setValue(0)
        self.progressBar.setVisible(False)

        self.glHeadModel.loadStage.connect(self.updateProgressBar)


    #Updates the progress bar using the signals (stage) from the glHeadModel 
Example 15
Project: idasec   Author: RobinDavid   File: static_opaque_analysis.py    License: GNU Lesser General Public License v2.1 5 votes vote down vote up
def make_progress_bar(self, parent):
        horizontalLayout_2 = QtWidgets.QHBoxLayout()
        horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.loading_stat = QtWidgets.QLabel(parent)
        horizontalLayout_2.addWidget(self.loading_stat)
        self.progressbar_loading = QtWidgets.QProgressBar(parent)
        horizontalLayout_2.addWidget(self.progressbar_loading)
        self.stop_button = QtWidgets.QPushButton(parent)
        self.stop_button.setMaximumSize(QtCore.QSize(50, 30))
        self.stop_button.setText("stop")
        horizontalLayout_2.addWidget(self.stop_button)
        self.stop_button.clicked.connect(self.stop_button_clicked)
        return horizontalLayout_2 
Example 16
Project: uPyLoader   Author: BetaRavener   File: file_transfer.py    License: MIT License 5 votes vote down vote up
def setupUi(self, FileTransferDialog):
        FileTransferDialog.setObjectName("FileTransferDialog")
        FileTransferDialog.resize(400, 120)
        self.verticalLayout_2 = QtWidgets.QVBoxLayout(FileTransferDialog)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.label = QtWidgets.QLabel(FileTransferDialog)
        self.label.setObjectName("label")
        self.verticalLayout_2.addWidget(self.label)
        self.verticalLayout = QtWidgets.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.progressBar = QtWidgets.QProgressBar(FileTransferDialog)
        self.progressBar.setProperty("value", 24)
        self.progressBar.setObjectName("progressBar")
        self.verticalLayout.addWidget(self.progressBar)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem)
        self.cancelButton = QtWidgets.QPushButton(FileTransferDialog)
        self.cancelButton.setEnabled(False)
        self.cancelButton.setCheckable(False)
        self.cancelButton.setObjectName("cancelButton")
        self.horizontalLayout.addWidget(self.cancelButton)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.verticalLayout_2.addLayout(self.verticalLayout)

        self.retranslateUi(FileTransferDialog)
        QtCore.QMetaObject.connectSlotsByName(FileTransferDialog) 
Example 17
Project: dash-masternode-tool   Author: Bertrand256   File: ui_thread_fun_dlg.py    License: MIT License 5 votes vote down vote up
def setupUi(self, ThreadFunDlg):
        ThreadFunDlg.setObjectName("ThreadFunDlg")
        ThreadFunDlg.setWindowModality(QtCore.Qt.NonModal)
        ThreadFunDlg.resize(391, 101)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(ThreadFunDlg.sizePolicy().hasHeightForWidth())
        ThreadFunDlg.setSizePolicy(sizePolicy)
        ThreadFunDlg.setModal(True)
        self.verticalLayout = QtWidgets.QVBoxLayout(ThreadFunDlg)
        self.verticalLayout.setSpacing(3)
        self.verticalLayout.setObjectName("verticalLayout")
        self.lblText = QtWidgets.QLabel(ThreadFunDlg)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.lblText.sizePolicy().hasHeightForWidth())
        self.lblText.setSizePolicy(sizePolicy)
        self.lblText.setText("")
        self.lblText.setWordWrap(False)
        self.lblText.setOpenExternalLinks(True)
        self.lblText.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByKeyboard|QtCore.Qt.TextSelectableByMouse)
        self.lblText.setObjectName("lblText")
        self.verticalLayout.addWidget(self.lblText)
        self.progressBar = QtWidgets.QProgressBar(ThreadFunDlg)
        self.progressBar.setProperty("value", 0)
        self.progressBar.setInvertedAppearance(False)
        self.progressBar.setObjectName("progressBar")
        self.verticalLayout.addWidget(self.progressBar)
        self.btnBox = QtWidgets.QDialogButtonBox(ThreadFunDlg)
        self.btnBox.setOrientation(QtCore.Qt.Horizontal)
        self.btnBox.setStandardButtons(QtWidgets.QDialogButtonBox.Ok)
        self.btnBox.setCenterButtons(False)
        self.btnBox.setObjectName("btnBox")
        self.verticalLayout.addWidget(self.btnBox)

        self.retranslateUi(ThreadFunDlg)
        self.btnBox.accepted.connect(ThreadFunDlg.accept)
        self.btnBox.rejected.connect(ThreadFunDlg.reject)
        QtCore.QMetaObject.connectSlotsByName(ThreadFunDlg) 
Example 18
Project: stytra   Author: portugueslab   File: protocol_control.py    License: GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, protocol_runner: ProtocolRunner, main_window=None):
        """ """
        super().__init__("Protocol running")
        self.setIconSize(QSize(32, 32))
        self.main_window = main_window
        self.protocol_runner = protocol_runner

        self.update_duration_each = 120
        self._update_duration_i = 0

        self.toggleStatus = ToggleIconButton(
            icon_off="play", icon_on="stop", action_on="play", on=False
        )
        self.toggleStatus.clicked.connect(self.toggle_protocol_running)
        self.addWidget(self.toggleStatus)

        # Progress bar for monitoring the protocol:
        self.progress_bar = QProgressBar()
        self.addSeparator()
        self.addWidget(self.progress_bar)

        # Window with the protocol parameters:
        self.act_edit = IconButton(
            action_name="Edit protocol parameters", icon_name="edit_protocol"
        )
        self.act_edit.clicked.connect(self.show_stim_params_gui)
        self.addWidget(self.act_edit)

        # Connect events and signals from the ProtocolRunner to update the GUI:
        self.update_progress()
        self.protocol_runner.sig_timestep.connect(self.update_progress)

        self.protocol_runner.sig_protocol_finished.connect(self.toggle_icon)
        self.protocol_runner.sig_protocol_updated.connect(self.update_progress)
        self.protocol_runner.sig_protocol_interrupted.connect(self.toggle_icon) 
Example 19
Project: awesometts-anki-addon   Author: AwesomeTTS   File: generator.py    License: GNU General Public License v3.0 5 votes vote down vote up
def _ui(self):
        """
        Builds the interface with a status label and progress bar.
        """

        self.setMinimumWidth(500)

        status = Note("Please wait...")
        status.setAlignment(QtCore.Qt.AlignCenter)
        status.setObjectName('status')

        progress_bar = QtWidgets.QProgressBar()
        progress_bar.setMaximum(self._maximum)
        progress_bar.setObjectName('bar')

        detail = Note("")
        detail.setAlignment(QtCore.Qt.AlignCenter)
        detail.setFixedHeight(100)
        detail.setFont(self._FONT_INFO)
        detail.setObjectName('detail')
        detail.setScaledContents(True)

        layout = super(_Progress, self)._ui()
        layout.addStretch()
        layout.addWidget(status)
        layout.addStretch()
        layout.addWidget(progress_bar)
        layout.addStretch()
        layout.addWidget(detail)
        layout.addStretch()
        layout.addWidget(self._ui_buttons())

        return layout 
Example 20
Project: awesometts-anki-addon   Author: AwesomeTTS   File: generator.py    License: GNU General Public License v3.0 5 votes vote down vote up
def update(self, label, value, detail=None):
        """
        Update the status text and bar.
        """

        self.findChild(Note, 'status').setText(label)
        self.findChild(QtWidgets.QProgressBar, 'bar').setValue(value)
        if detail:
            self.findChild(Note, 'detail').setText(detail) 
Example 21
Project: pip-gui   Author: GDGVIT   File: progressScreen.py    License: GNU General Public License v3.0 5 votes vote down vote up
def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(582, 317)
        self.verticalLayoutWidget = QtWidgets.QWidget(Form)
        self.verticalLayoutWidget.setGeometry(
            QtCore.QRect(10, 10, 561, 261))
        self.verticalLayoutWidget.setObjectName(
            _fromUtf8("verticalLayoutWidget"))
        self.verticalLayout = QtWidgets.QVBoxLayout(
            self.verticalLayoutWidget)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.labelProgress = QtWidgets.QLabel(self.verticalLayoutWidget)
        font = QtGui.QFont()
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.labelProgress.setFont(font)
        self.labelProgress.setObjectName(_fromUtf8("labelProgress"))
        self.verticalLayout.addWidget(self.labelProgress)
        self.textEdit = QtWidgets.QTextEdit(self.verticalLayoutWidget)
        self.textEdit.setObjectName(_fromUtf8("textEdit"))
        self.verticalLayout.addWidget(self.textEdit)
        self.progressBar = QtWidgets.QProgressBar(self)
        self.progressBar.setRange(0,1)
        self.progressBar.setGeometry(QtCore.QRect(30, 30, 1050, 35))
        self.progressBar.setObjectName(_fromUtf8("progressBar"))
        self.verticalLayout.addWidget(self.progressBar)
        self.btnContinue = QtWidgets.QPushButton(Form)
        self.btnContinue.setGeometry(QtCore.QRect(450, 280, 90, 28))
        self.btnContinue.setObjectName(_fromUtf8("btnContinue"))

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form) 
Example 22
Project: eddy   Author: danielepantaleone   File: session.py    License: GNU General Public License v3.0 5 votes vote down vote up
def initWidgets(self):
        """
        Configure application built-in widgets.
        """
        button = QtWidgets.QToolButton(objectName='button_set_brush')
        button.setIcon(QtGui.QIcon(':/icons/24/ic_format_color_fill_black'))
        button.setMenu(self.menu('brush'))
        button.setPopupMode(QtWidgets.QToolButton.InstantPopup)
        button.setStatusTip('Change the background color of the selected predicate nodes')
        button.setEnabled(False)
        self.addWidget(button)

        combobox = ComboBox(objectName='profile_switch')
        combobox.setEditable(False)
        combobox.setFont(Font('Roboto', 12))
        combobox.setFocusPolicy(QtCore.Qt.StrongFocus)
        combobox.setScrollEnabled(False)
        combobox.setStatusTip('Change the profile of the active project')
        combobox.addItems(self.profileNames())
        connect(combobox.activated, self.doSetProfile)
        self.addWidget(combobox)

        progressBar = QtWidgets.QProgressBar(objectName='progress_bar')
        progressBar.setContentsMargins(0, 0, 0, 0)
        progressBar.setFixedSize(222, 14)
        progressBar.setRange(0, 0)
        progressBar.setVisible(False)
        self.addWidget(progressBar)

    #############################################
    #   SLOTS
    ################################# 
Example 23
Project: peakonly   Author: Arseha   File: auxilary_utils.py    License: MIT License 5 votes vote down vote up
def __init__(self, text, pb=None, parent=None):
        super().__init__(parent)
        self.pb = pb
        if self.pb is None:
            self.pb = QtWidgets.QProgressBar()

        self.label = QtWidgets.QLabel(self)
        self.label.setText(text)

        main_layout = QtWidgets.QHBoxLayout()
        main_layout.addWidget(self.label, 30)
        main_layout.addWidget(self.pb, 70)

        self.setLayout(main_layout) 
Example 24
Project: picasso   Author: jungmannlab   File: simulate.py    License: MIT License 5 votes vote down vote up
def __init__(self, parent=None):
        super(CalibrationDialog, self).__init__(parent)

        layout = QtWidgets.QVBoxLayout(self)

        self.table = QtWidgets.QTableWidget()
        self.table.setWindowTitle("Noise Model Calibration")
        self.setWindowTitle("Noise Model Calibration")
        # self.resize(800, 400)

        layout.addWidget(self.table)

        # ADD BUTTONS:
        self.loadTifButton = QtWidgets.QPushButton("Load Tifs")
        layout.addWidget(self.loadTifButton)

        self.evalTifButton = QtWidgets.QPushButton("Evaluate Tifs")
        layout.addWidget(self.evalTifButton)

        self.pbar = QtWidgets.QProgressBar(self)
        layout.addWidget(self.pbar)

        self.loadTifButton.clicked.connect(self.loadTif)
        self.evalTifButton.clicked.connect(self.evalTif)

        self.buttons = QtWidgets.QDialogButtonBox(
            QtWidgets.QDialogButtonBox.ActionRole
            | QtWidgets.QDialogButtonBox.Ok
            | QtWidgets.QDialogButtonBox.Cancel,
            self,
        )

        layout.addWidget(self.buttons)

        self.buttons.accepted.connect(self.accept)
        self.buttons.rejected.connect(self.reject) 
Example 25
Project: bap-ida-python   Author: BinaryAnalysisPlatform   File: bap_trace.py    License: MIT License 5 votes vote down vote up
def __init__(self, parent=None):
        super(TraceLoaderController, self).__init__(parent)
        self.loader = None
        box = QtWidgets.QVBoxLayout(self)
        self.location = TraceFileSelector(self)
        self.handlers = HandlerSelector(self)
        self.machines = MachineSelector(self)
        box.addWidget(self.location)
        box.addWidget(self.handlers)
        box.addWidget(self.machines)
        self.load = QtWidgets.QPushButton('&Load')
        self.load.setDefault(True)
        self.load.setEnabled(self.location.is_ready())
        self.cancel = QtWidgets.QPushButton('&Stop')
        self.cancel.setVisible(False)
        hor = QtWidgets.QHBoxLayout()
        hor.addWidget(self.load)
        hor.addWidget(self.cancel)
        self.progress = QtWidgets.QProgressBar()
        self.progress.setVisible(False)
        hor.addWidget(self.progress)
        hor.addStretch(2)
        box.addLayout(hor)

        def enable_load():
            self.load.setEnabled(self.location.is_ready() and
                                 self.machines.is_ready())
        self.location.updated.connect(enable_load)
        self.machines.updated.connect(enable_load)
        enable_load()
        self.processor = QTimer()
        self.processor.timeout.connect(self.process)
        self.load.clicked.connect(self.processor.start)
        self.cancel.clicked.connect(self.stop)
        self.setLayout(box) 
Example 26
Project: legion   Author: GoVanguard   File: ancillaryDialog.py    License: GNU General Public License v3.0 5 votes vote down vote up
def setupLayout(self):
        vbox = QtWidgets.QVBoxLayout()
        self.label = QtWidgets.QLabel(self.text)
        self.progressBar = QtWidgets.QProgressBar()
        vbox.addWidget(self.label)
        vbox.addWidget(self.progressBar)
        hbox = QtWidgets.QHBoxLayout()
        hbox.addStretch(1)
        vbox.addLayout(hbox)
        self.setLayout(vbox) 
Example 27
Project: PyQt   Author: PyQt5   File: InheritQThread.py    License: GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, *args, **kwargs):
        super(Window, self).__init__(*args, **kwargs)
        layout = QVBoxLayout(self)
        self.progressBar = QProgressBar(self)
        self.progressBar.setRange(0, 100)
        layout.addWidget(self.progressBar)
        layout.addWidget(QPushButton('开启线程', self, clicked=self.onStart))

        # 当前线程id
        print('main id', int(QThread.currentThreadId()))

        # 子线程
        self._thread = Worker(self)
        self._thread.finished.connect(self._thread.deleteLater)
        self._thread.valueChanged.connect(self.progressBar.setValue) 
Example 28
Project: PyQt   Author: PyQt5   File: WakeupThread.py    License: GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, *args, **kwargs):
        super(Window, self).__init__(*args, **kwargs)
        layout = QVBoxLayout(self)
        self.progressBar = QProgressBar(self)
        layout.addWidget(self.progressBar)
        layout.addWidget(QPushButton('休眠', self, clicked=self.doWait))
        layout.addWidget(QPushButton('唤醒', self, clicked=self.doWake))

        self.t = Thread(self)
        self.t.valueChange.connect(self.progressBar.setValue)
        self.t.start() 
Example 29
Project: PyQt   Author: PyQt5   File: QtThreading.py    License: GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, *args, **kwargs):
        super(Window, self).__init__(*args, **kwargs)
        self.resize(400, 400)
        layout = QVBoxLayout(self)
        self.progressBar = QProgressBar(self)
        layout.addWidget(self.progressBar)
        Signals.updateProgress.connect(
            self.progressBar.setValue, type=Qt.QueuedConnection)

        QTimer.singleShot(2000, self.doStart) 
Example 30
Project: pySPM   Author: scholi   File: timer_display.py    License: Apache License 2.0 5 votes vote down vote up
def setupUi(self, ToF_Timer):
        ToF_Timer.setObjectName("ToF_Timer")
        ToF_Timer.resize(466, 108)
        self.centralWidget = QtWidgets.QWidget(ToF_Timer)
        self.centralWidget.setObjectName("centralWidget")
        self.verticalLayout = QtWidgets.QVBoxLayout(self.centralWidget)
        self.verticalLayout.setContentsMargins(11, 11, 11, 11)
        self.verticalLayout.setSpacing(6)
        self.verticalLayout.setObjectName("verticalLayout")
        self.progressBar = QtWidgets.QProgressBar(self.centralWidget)
        self.progressBar.setProperty("value", 0)
        self.progressBar.setObjectName("progressBar")
        self.verticalLayout.addWidget(self.progressBar)
        self.label = QtWidgets.QLabel(self.centralWidget)
        self.label.setObjectName("label")
        self.verticalLayout.addWidget(self.label)
        self.label_2 = QtWidgets.QLabel(self.centralWidget)
        self.label_2.setObjectName("label_2")
        self.verticalLayout.addWidget(self.label_2)
        self.label_3 = QtWidgets.QLabel(self.centralWidget)
        self.label_3.setObjectName("label_3")
        self.verticalLayout.addWidget(self.label_3)
        ToF_Timer.setCentralWidget(self.centralWidget)

        self.retranslateUi(ToF_Timer)
        QtCore.QMetaObject.connectSlotsByName(ToF_Timer)