Python PyQt5.QtWidgets.QProgressBar() Examples

The following are 30 code examples of PyQt5.QtWidgets.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 PyQt5.QtWidgets , or try the search function .
Example #1
Source File: toraw.py    From picasso with MIT License 8 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 #2
Source File: AnalysisProgress_ui.py    From tierpsy-tracker with 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 #3
Source File: seeker.py    From code-jam-5 with 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 #4
Source File: DySubInfoWidget.py    From DevilYuan with 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 #5
Source File: DyProgressWidget.py    From DevilYuan with 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 #6
Source File: main.py    From PyQt5-Apps with 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 #7
Source File: DyProgressWidget.py    From DevilYuan with 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 #8
Source File: DySubInfoWidget.py    From DevilYuan with 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 #9
Source File: widgets.py    From qomui with 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 #10
Source File: SuspendThread.py    From PyQt with 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 #11
Source File: progress.py    From eddy with 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 #12
Source File: demoProgressBar.py    From Qt5-Python-GUI-Programming-Cookbook with 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 #13
Source File: moveToThread.py    From PyQt with 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 #14
Source File: timer_display.py    From pySPM with 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) 
Example #15
Source File: InheritQThread.py    From PyQt with 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 #16
Source File: WakeupThread.py    From PyQt with 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 #17
Source File: QtThreading.py    From PyQt with 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 #18
Source File: simulate.py    From picasso with 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 #19
Source File: StatusBar.py    From PyRAT with Mozilla Public License 2.0 5 votes vote down vote up
def __init__(self, parent):
        self.parent = parent
        self.statusBar = parent.statusBar()


        self.pixmap_green  = QtGui.QPixmap("icons/green.png", "PNG")
        self.pixmap_yellow = QtGui.QPixmap("icons/yellow.png", "PNG")
        self.pixmap_red    = QtGui.QPixmap("icons/red.png", "PNG")
        self.statusPixmap = QtWidgets.QLabel("image", self.statusBar)
        self.statusPixmap.setPixmap(self.pixmap_green)
        
        self.__statusTimer = QtCore.QTimer(self.parent)
        # self.parent.connect(self.__statusTimer, QtCore.SIGNAL("timeout()"), self.resetMessage)
        self.__statusLabel = QtWidgets.QLabel("Default", self.statusBar)
        self.progressbar = QtWidgets.QProgressBar(self.statusBar)
        self.progressbar.setMinimum(0)
        self.progressbar.setMaximum(100)
        self.progressbar.setValue(0)
        self.progressbar.setTextVisible(False)

        self.lastMessage = ''
       
        self.statusSize  = QtWidgets.QLabel("", self.statusBar)
        self.statusZoom  = QtWidgets.QLabel("", self.statusBar)
        self.statusScale = QtWidgets.QLabel("", self.statusBar)
        self.statusLevel = QtWidgets.QLabel("", self.statusBar)
      
        self.statusBar.addWidget(self.statusPixmap, 0)
        self.statusBar.addWidget(self.__statusLabel, 0)
        self.statusBar.addWidget(self.progressbar, 1)
        self.statusBar.addWidget(self.statusSize, 0)
        self.statusBar.addWidget(self.statusZoom, 0)
        self.statusBar.addWidget(self.statusScale, 0)
        self.statusBar.addWidget(self.statusLevel, 0) 
Example #20
Source File: ui_updater.py    From ETS2Autopilot with MIT License 5 votes vote down vote up
def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(400, 131)
        MainWindow.setLocale(QtCore.QLocale(QtCore.QLocale.German, QtCore.QLocale.Germany))
        self.pb_progress = QtWidgets.QProgressBar(MainWindow)
        self.pb_progress.setGeometry(QtCore.QRect(10, 60, 381, 23))
        self.pb_progress.setProperty("value", 0)
        self.pb_progress.setAlignment(QtCore.Qt.AlignCenter)
        self.pb_progress.setOrientation(QtCore.Qt.Horizontal)
        self.pb_progress.setObjectName("pb_progress")
        self.b_run = QtWidgets.QPushButton(MainWindow)
        self.b_run.setEnabled(False)
        self.b_run.setGeometry(QtCore.QRect(210, 90, 181, 30))
        self.b_run.setCheckable(False)
        self.b_run.setChecked(False)
        self.b_run.setObjectName("b_run")
        self.label = QtWidgets.QLabel(MainWindow)
        self.label.setGeometry(QtCore.QRect(10, 10, 81, 16))
        self.label.setObjectName("label")
        self.label_2 = QtWidgets.QLabel(MainWindow)
        self.label_2.setGeometry(QtCore.QRect(10, 30, 81, 16))
        self.label_2.setObjectName("label_2")
        self.b_check = QtWidgets.QPushButton(MainWindow)
        self.b_check.setGeometry(QtCore.QRect(10, 90, 181, 30))
        self.b_check.setObjectName("b_check")
        self.l_newVersion = QtWidgets.QLabel(MainWindow)
        self.l_newVersion.setGeometry(QtCore.QRect(100, 30, 81, 16))
        self.l_newVersion.setText("")
        self.l_newVersion.setObjectName("l_newVersion")
        self.l_currentVersion = QtWidgets.QLabel(MainWindow)
        self.l_currentVersion.setGeometry(QtCore.QRect(100, 10, 81, 16))
        self.l_currentVersion.setText("")
        self.l_currentVersion.setObjectName("l_currentVersion")

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow) 
Example #21
Source File: ancillaryDialog.py    From legion with 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 #22
Source File: bap_trace.py    From bap-ida-python with 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 #23
Source File: head_model_OGL.py    From simnibs with 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 #24
Source File: auxilary_utils.py    From peakonly with 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 #25
Source File: session.py    From eddy with 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 #26
Source File: progressScreen.py    From pip-gui with 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 #27
Source File: generator.py    From awesometts-anki-addon with 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 #28
Source File: generator.py    From awesometts-anki-addon with 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 #29
Source File: protocol_control.py    From stytra with 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 #30
Source File: ui_thread_fun_dlg.py    From dash-masternode-tool with 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)