Python PyQt4.QtGui 模块,QProgressBar() 实例源码

我们从Python开源项目中,提取了以下30个代码示例,用于说明如何使用PyQt4.QtGui.QProgressBar()

项目:PH5    作者:PIC-IRIS    | 项目源码 | 文件源码
def __init__ (self, title, mmax=100) :
        super (FamilyProgress, self).__init__ ()

        self.setWindowTitle (title)
        self.setFixedHeight (48)
        self.pbar = QtGui.QProgressBar ()
        self.pbar.setRange (0, mmax - 1)

        self.btn = QtGui.QPushButton ("Starting", self)

        pbarvbox = QtGui.QVBoxLayout()
        pbarvbox.addStretch (False)
        pbarvbox.addWidget (self.pbar)
        buttonvbox = QtGui.QVBoxLayout ()
        buttonvbox.addStretch (True)
        buttonvbox.addWidget (self.btn)
        hbox = QtGui.QHBoxLayout ()
        hbox.addLayout(pbarvbox, stretch=False)
        hbox.addLayout(buttonvbox)

        self.setLayout (hbox)
        self.pbar.setStyleSheet(START_STYLE)        
        #self.show()
项目:HistoricalMap    作者:lennepkade    | 项目源码 | 文件源码
def __init__(self,inMsg=' Loading...',inMaxStep=1):
            # initialize progressBar            
            """
            """# Save reference to the QGIS interface
            QApplication.processEvents() # Help to keep UI alive

            widget = iface.messageBar().createMessage('Please wait  ',inMsg)            
            prgBar = QProgressBar()
            self.prgBar=prgBar
            self.iface=iface
            widget.layout().addWidget(self.prgBar)
            iface.messageBar().pushWidget(widget, iface.messageBar().WARNING)
            QApplication.setOverrideCursor(QtCore.Qt.WaitCursor)

            # if Max 0 and value 0, no progressBar, only cursor loading
            # default is set to 0
            prgBar.setValue(1)
            # set Maximum for progressBar
            prgBar.setMaximum(inMaxStep)
项目:base_function    作者:Rockyzsu    | 项目源码 | 文件源码
def __init__(self, parent=None):
        QtGui.QWidget.__init__(self)
        self.setGeometry(300, 300, 250, 150)

        self.pBar = QtGui.QProgressBar(self)
        self.pBar.setGeometry(30, 40, 200, 25)

        self.button = QtGui.QPushButton('start', self)
        self.button.setFocusPolicy(QtCore.Qt.NoFocus)
        self.button.move(40, 80)

        self.connect(self.button, QtCore.SIGNAL('clicked()'), self.onStart)
        self.timer = QtCore.QBasicTimer()
        self.step = 0
项目:siren    作者:ozsolarwind    | 项目源码 | 文件源码
def __init__(self, stations, plots, show_progress, year=None, selected=None, status=None):
        super(ProgressModel, self).__init__()
        self.plots = plots
        self.model = SuperPower(stations, self.plots, False, year=year, selected=selected, status=status)
        self._active = False
        self.power_summary = []
        self.model.show_progress = show_progress
        self.progressbar = QtGui.QProgressBar()
        self.progressbar.setMinimum(1)
        try:
            self.progressbar.setMaximum(len(self.model.selected))
        except:
            self.progressbar.setMaximum(len(self.model.stations))
        self.button = QtGui.QPushButton('Start')
        self.button.clicked.connect(self.handleButton)
        self.progress_stn = QtGui.QLabel('Note: Solar Thermal Stations take a while to process')
        main_layout = QtGui.QGridLayout()
        main_layout.addWidget(self.button, 0, 0)
        main_layout.addWidget(self.progressbar, 0, 1)
        main_layout.addWidget(self.progress_stn, 1, 1)
        self.setLayout(main_layout)
        self.setWindowTitle('SIREN - Power Model Progress')
        self.resize(250, 30)
项目:pslab-desktop-apps    作者:fossasia    | 项目源码 | 文件源码
def __fixPVCH__(self,DAC,ADC,row):
        self.curdacrow = row
        pg = QtGui.QProgressBar()
        pg.setMaximum(4096)
        self.evalLayout.addWidget(pg)
        self.I.DAC.__ignoreCalibration__(DAC)
        self.tabs.setEnabled(False)

        ########Experimental thread########
        def slot(p): pg.setValue(p)
        self.thread = Worker()
        self.thread.setup(I=self.I,DAC=DAC,ADC=ADC)
        self.thread.prog.connect(slot)
        self.thread.calResult.connect(self.calFinished)
        self.thread.finished.connect(self.wrapUpDACCal)
        self.thread.start()     
        ########Experimental thread########
项目:PyFRAP    作者:alexblaessle    | 项目源码 | 文件源码
def __init__(self,parent):
        super(progressDialog,self).__init__(parent)

        #Labels
        self.lblName = QtGui.QLabel("Something in progress...", self)

        #Buttons
        self.btnCancel=QtGui.QPushButton('Cancel')
        self.btnCancel.connect(self.btnCancel, QtCore.SIGNAL('clicked()'), self.cancel) 

        #ProgressBar
        self.progressbar = QtGui.QProgressBar()
        self.progressbar.setMinimum(1)
        self.progressbar.setMaximum(100)

        #Layout
        self.vbox = QtGui.QVBoxLayout()
        self.vbox.addWidget(self.lblName)
        self.vbox.addWidget(self.progressbar)
        self.vbox.addWidget(self.btnCancel)

        self.setLayout(self.vbox)
        self.setWindowTitle('Progress Dialog')

        self.show()
项目:EasyStorj    作者:lakewik    | 项目源码 | 文件源码
def add_row_files_queue_table(self, row_data):


        self.files_queue_progressbar_list.append(QtGui.QProgressBar())

        self.files_queue_table_row_count = self.ui_single_file_upload.files_queue_table_widget.rowCount()

        self.ui_single_file_upload.files_queue_table_widget.setRowCount(
            self.files_queue_table_row_count + 1)

        self.ui_single_file_upload.files_queue_table_widget.setItem(
            self.files_queue_table_row_count, 0, QtGui.QTableWidgetItem(os.path.split(str(row_data['file_path']))[1]))
        self.ui_single_file_upload.files_queue_table_widget.setItem(
            self.files_queue_table_row_count, 1, QtGui.QTableWidgetItem(row_data['file_path']))

        self.ui_single_file_upload.files_queue_table_widget.setItem(
            self.files_queue_table_row_count, 2, QtGui.QTableWidgetItem(str(self.tools.human_size(os.path.getsize(str(row_data['file_path']))))))

        self.ui_single_file_upload.files_queue_table_widget.setCellWidget(
            self.files_queue_table_row_count, 3, self.files_queue_progressbar_list[self.files_queue_table_row_count])
项目:dxf2gcode    作者:cnc-club    | 项目源码 | 文件源码
def __init__(self, parent=None):
        super(MyCustomWidget, self).__init__(parent)
        layout = QtGui.QVBoxLayout(self)
        self.setWindowFlags(QtCore.Qt.FramelessWindowHint)
        #self.setAttribute(QtCore.Qt.WA_TranslucentBackground)

        self.progressBar = QtGui.QProgressBar(self)
        self.progressBar.setRange(0,100)
        button = QtGui.QPushButton("Start", self)
        layout.addWidget(self.progressBar)
        layout.addWidget(button)

        button.clicked.connect(self.onStart)

        self.myLongTask = TaskThread()
        print(self.myLongTask.result)
        self.myLongTask.notifyProgress.connect(self.onProgress)
        self.myLongTask.done.connect(self.finPBar)
项目:picasso    作者:jungmannlab    | 项目源码 | 文件源码
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 = QtGui.QProgressDialog(text, 'Cancel', 0, n_movies, self)
        progress_bar = QtGui.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()
项目:dzetsaka    作者:lennepkade    | 项目源码 | 文件源码
def __init__(self,inMsg=' Loading...',inMaxStep=1):
            # initialize progressBar            
            """
            """# Save reference to the QGIS interface
            QApplication.processEvents() # Help to keep UI alive

            widget = iface.messageBar().createMessage('Please wait  ',inMsg)            
            prgBar = QProgressBar()
            self.prgBar=prgBar
            self.iface=iface

            widget.layout().addWidget(self.prgBar)
            iface.messageBar().pushWidget(widget, iface.messageBar().WARNING)
            QApplication.setOverrideCursor(QtCore.Qt.WaitCursor)

            # if Max 0 and value 0, no progressBar, only cursor loading
            # default is set to 0
            prgBar.setValue(1)
            # set Maximum for progressBar
            prgBar.setMaximum(inMaxStep)
项目:Smart-Grid-Analytics    作者:Merit-Research    | 项目源码 | 文件源码
def __init__(self):
        super(LoadingWindow, self).__init__(None, QtCore.Qt.WindowStaysOnTopHint)
        self.setWindowTitle(' ')
        self.setWindowIcon(QtGui.QIcon(ICON_FILE))

        layout = QtGui.QVBoxLayout()
        layout.addWidget(QtGui.QLabel("Updating. Please wait...", self))
        progress = QtGui.QProgressBar(self)
        progress.setMinimum(0)
        progress.setMaximum(0)
        layout.addWidget(progress)
        self.setLayout(layout)
        self.show()


#==================== MAIN ====================#
项目:pslab-desktop-apps    作者:fossasia    | 项目源码 | 文件源码
def addAddress(self):
        addr = int(str(self.addressBox.text()),16)
        if addr in self.slds:
            print('Already added')
            return

        Frame=QtGui.QFrame()
        Holder=QtGui.QHBoxLayout()
        Frame.setLayout(Holder)
        Holder.setMargin(0)
        self.Holder.addWidget(Frame)
        sld = QtGui.QProgressBar()
        btn = QtGui.QPushButton('X');btn.setMaximumWidth(20);btn.setStyleSheet("color:'red';")
        lbl = QtGui.QLabel(hex(addr))

        Holder.addWidget(sld)
        Holder.addWidget(lbl)
        Holder.addWidget(btn)
        btn.clicked.connect(functools.partial(self.pop,addr))
        sld.setRange(0,100)

        newlink = self.I.newRadioLink(address = addr)
        self.slds[addr]=[sld,newlink ,Frame]

        self.timer.stop()
        self.I.NRF.write_register(self.I.NRF.SETUP_RETR,0x21)
        for a in range(0,127):  #Sweep all channels and set the node channel to the one in use
            self.I.NRF.write_register(self.I.NRF.RF_CH,a)
            res = newlink.write_register(self.I.NRF.RF_CH,self.last_chan)
        self.I.NRF.write_register(self.I.NRF.RF_CH,self.last_chan)
        self.I.NRF.write_register(self.I.NRF.SETUP_RETR,0x25)
        self.timer.start(1)


        self.addrLabel.setText('Last Added: '+hex(addr))
项目:pslab-desktop-apps    作者:fossasia    | 项目源码 | 文件源码
def showSplash(self):
        import pkg_resources
        splash_pix = QtGui.QPixmap(pkg_resources.resource_filename('PSL_Apps.stylesheets', "ipy_splash.png"))
        self.splash = QtGui.QSplashScreen(splash_pix, QtCore.Qt.WindowStaysOnTopHint)
        # adding progress bar
        self.progressBar = QtGui.QProgressBar(self.splash)
        self.progressBar.resize(self.splash.width(),20)
        css = pkg_resources.resource_string('PSL_Apps', "stylesheets/splash.css").decode("utf-8")
        if css:
            self.splash.setStyleSheet(css)
        self.splashMsg = QtGui.QLabel(self.splash);self.splashMsg.setStyleSheet("font-weight:bold;color:purple")
        self.splash.setMask(splash_pix.mask())
        self.splashMsg.setText('Loading....');self.splashMsg.resize(self.progressBar.width(),20)
        self.splash.show()
        self.splash.repaint()
项目:EasyStorj    作者:lakewik    | 项目源码 | 文件源码
def add_row_upload_queue_table(self, row_data):
        self.upload_queue_progressbar_list.append(QtGui.QProgressBar())

        self.upload_queue_table_row_count = self.ui_single_file_upload.shard_queue_table_widget.rowCount()

        self.ui_single_file_upload.shard_queue_table_widget.setRowCount(
            self.upload_queue_table_row_count + 1)
        self.ui_single_file_upload.shard_queue_table_widget.setCellWidget(
            self.upload_queue_table_row_count, 0, self.upload_queue_progressbar_list[self.upload_queue_table_row_count])
        self.ui_single_file_upload.shard_queue_table_widget.setItem(
            self.upload_queue_table_row_count, 1, QtGui.QTableWidgetItem(row_data['hash']))
        self.ui_single_file_upload.shard_queue_table_widget.setItem(
            self.upload_queue_table_row_count, 2, QtGui.QTableWidgetItem(
                '%s:%d' % (row_data['farmer_address'], row_data['farmer_port']) + "/" + row_data['farmer_id']))
        self.ui_single_file_upload.shard_queue_table_widget.setItem(
            self.upload_queue_table_row_count, 3, QtGui.QTableWidgetItem(
                str(row_data['state'])))
        self.ui_single_file_upload.shard_queue_table_widget.setItem(
            self.upload_queue_table_row_count, 4, QtGui.QTableWidgetItem(
                str(row_data['token'])))
        self.ui_single_file_upload.shard_queue_table_widget.setItem(
            self.upload_queue_table_row_count, 5, QtGui.QTableWidgetItem(
                str(row_data['shard_index'])))

        if AUTO_SCROLL_UPLOAD_DOWNLOAD_QUEUE:
            self.ui_single_file_upload.shard_queue_table_widget.scrollToBottom()

        self.upload_queue_progressbar_list[self.upload_queue_table_row_count].setValue(0)

        self.__logger.info(row_data)
项目:EasyStorj    作者:lakewik    | 项目源码 | 文件源码
def add_row_download_queue_table(self, row_data):
        """
        Add a row to the download queue table
        """
        self.download_queue_progressbar_list.append(QtGui.QProgressBar())
        self.download_queue_table_row_count = \
            self.ui_single_file_download.shard_queue_table.rowCount()
        self.ui_single_file_download.shard_queue_table.setRowCount(
            self.download_queue_table_row_count + 1)
        self.ui_single_file_download.shard_queue_table.setCellWidget(
            self.download_queue_table_row_count, 0,
            self.download_queue_progressbar_list[
                self.download_queue_table_row_count])
        self.ui_single_file_download.shard_queue_table.setItem(
            self.download_queue_table_row_count, 1,
            QtGui.QTableWidgetItem(row_data['hash']))
        self.ui_single_file_download.shard_queue_table.setItem(
            self.download_queue_table_row_count, 2,
            QtGui.QTableWidgetItem('%s:%s' % (
                row_data['farmer_address'],
                row_data['farmer_port']) + "/" + row_data['farmer_id']))
        self.ui_single_file_download.shard_queue_table.setItem(
            self.download_queue_table_row_count, 3,
            QtGui.QTableWidgetItem(str(row_data['state'])))
        self.ui_single_file_download.shard_queue_table.setItem(
            self.download_queue_table_row_count, 4,
            QtGui.QTableWidgetItem(str(row_data['shard_index'])))
        self.download_queue_progressbar_list[
            self.download_queue_table_row_count].setValue(0)
项目:pyGrav    作者:basileh    | 项目源码 | 文件源码
def __init__(self, parent=None, total=20, textmess='Progress'):
        super(ProgressBar, self).__init__(parent)
        self.progressbar = QtGui.QProgressBar()
        self.progressbar.setMinimum(1)
        self.progressbar.setMaximum(total)
        main_layout = QtGui.QGridLayout()
        main_layout.addWidget(self.progressbar, 0, 1)
        self.setLayout(main_layout)
        self.setWindowTitle(textmess)
项目:pyGrav    作者:basileh    | 项目源码 | 文件源码
def __init__(self, parent=None, total=20, textmess='Progress'):
        super(ProgressBar, self).__init__(parent)
        self.progressbar = QtGui.QProgressBar()
        self.progressbar.setMinimum(1)
        self.progressbar.setMaximum(total)
        main_layout = QtGui.QGridLayout()
        main_layout.addWidget(self.progressbar, 0, 1)
        self.setLayout(main_layout)
        self.setWindowTitle(textmess)
项目:picasso    作者:jungmannlab    | 项目源码 | 文件源码
def __init__(self, parent=None):
        super(CalibrationDialog, self).__init__(parent)

        layout = QtGui.QVBoxLayout(self)

        self.table = QtGui.QTableWidget()
        tableitem = QtGui.QTableWidgetItem()
        self.table.setWindowTitle('Noise Model Calibration')
        self.setWindowTitle('Noise Model Calibration')
        self.resize(800, 400)

        layout.addWidget(self.table)

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

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

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

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

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

        layout.addWidget(self.buttons)

        self.buttons.accepted.connect(self.accept)
        self.buttons.rejected.connect(self.reject)
项目:Python-GUI-examples    作者:swharden    | 项目源码 | 文件源码
def setupUi(self, MainWindow):
        MainWindow.setObjectName(_fromUtf8("MainWindow"))
        MainWindow.resize(993, 692)
        self.centralwidget = QtGui.QWidget(MainWindow)
        self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
        self.horizontalLayout = QtGui.QHBoxLayout(self.centralwidget)
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.pbLevel = QtGui.QProgressBar(self.centralwidget)
        self.pbLevel.setMaximum(1000)
        self.pbLevel.setProperty("value", 123)
        self.pbLevel.setTextVisible(False)
        self.pbLevel.setOrientation(QtCore.Qt.Vertical)
        self.pbLevel.setObjectName(_fromUtf8("pbLevel"))
        self.horizontalLayout.addWidget(self.pbLevel)
        self.frame = QtGui.QFrame(self.centralwidget)
        self.frame.setFrameShape(QtGui.QFrame.NoFrame)
        self.frame.setFrameShadow(QtGui.QFrame.Plain)
        self.frame.setObjectName(_fromUtf8("frame"))
        self.verticalLayout = QtGui.QVBoxLayout(self.frame)
        self.verticalLayout.setMargin(0)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.label = QtGui.QLabel(self.frame)
        self.label.setObjectName(_fromUtf8("label"))
        self.verticalLayout.addWidget(self.label)
        self.grFFT = PlotWidget(self.frame)
        self.grFFT.setObjectName(_fromUtf8("grFFT"))
        self.verticalLayout.addWidget(self.grFFT)
        self.label_2 = QtGui.QLabel(self.frame)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.verticalLayout.addWidget(self.label_2)
        self.grPCM = PlotWidget(self.frame)
        self.grPCM.setObjectName(_fromUtf8("grPCM"))
        self.verticalLayout.addWidget(self.grPCM)
        self.horizontalLayout.addWidget(self.frame)
        MainWindow.setCentralWidget(self.centralwidget)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)
项目:prophet    作者:MKLab-ITI    | 项目源码 | 文件源码
def setupUi(self, UpdatesDownloader):
        UpdatesDownloader.setObjectName(_fromUtf8("UpdatesDownloader"))
        UpdatesDownloader.resize(456, 136)
        self.gridLayout = QtGui.QGridLayout(UpdatesDownloader)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.verticalLayout = QtGui.QVBoxLayout()
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.lblMessage = QtGui.QLabel(UpdatesDownloader)
        font = QtGui.QFont()
        font.setPointSize(9)
        self.lblMessage.setFont(font)
        self.lblMessage.setObjectName(_fromUtf8("lblMessage"))
        self.verticalLayout.addWidget(self.lblMessage)
        self.lblCurrentJob = QtGui.QLabel(UpdatesDownloader)
        font = QtGui.QFont()
        font.setPointSize(9)
        self.lblCurrentJob.setFont(font)
        self.lblCurrentJob.setObjectName(_fromUtf8("lblCurrentJob"))
        self.verticalLayout.addWidget(self.lblCurrentJob)
        self.progressBarUpdate = QtGui.QProgressBar(UpdatesDownloader)
        self.progressBarUpdate.setProperty("value", 24)
        self.progressBarUpdate.setOrientation(QtCore.Qt.Horizontal)
        self.progressBarUpdate.setObjectName(_fromUtf8("progressBarUpdate"))
        self.verticalLayout.addWidget(self.progressBarUpdate)
        spacerItem = QtGui.QSpacerItem(20, 28, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.verticalLayout.addItem(spacerItem)
        self.gridLayout.addLayout(self.verticalLayout, 0, 0, 1, 1)
        self.btnCancel = QtGui.QPushButton(UpdatesDownloader)
        self.btnCancel.setObjectName(_fromUtf8("btnCancel"))
        self.gridLayout.addWidget(self.btnCancel, 1, 0, 1, 1, QtCore.Qt.AlignRight)

        self.retranslateUi(UpdatesDownloader)
        QtCore.QMetaObject.connectSlotsByName(UpdatesDownloader)
项目:sardana    作者:sardana-org    | 项目源码 | 文件源码
def __init__(self, parent=None):
        QtGui.QWizardPage.__init__(self, parent)
        self.setPixmap(QtGui.QWizard.WatermarkPixmap,
                       QtGui.QPixmap(":/watermark.jpg"))
        self._valid = True
        self._layout = QtGui.QVBoxLayout()
        self._spacerItem = QtGui.QSpacerItem(
            20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self._layout.addItem(self._spacerItem)
        self._horizontalLayout_1 = QtGui.QHBoxLayout()
        self._label = QtGui.QLabel("\nInitializing...")
        self._label.setWordWrap(True)
        self._horizontalLayout_1.addWidget(self._label)
        self._layout.addLayout(self._horizontalLayout_1)
        self._pbar = QtGui.QProgressBar(self)
        self._layout.addWidget(self._pbar)
        self._horizontalLayout_2 = QtGui.QHBoxLayout()
        self._spacerItem1 = QtGui.QSpacerItem(
            40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self._horizontalLayout_2.addItem(self._spacerItem1)
        self._cancelButton = QtGui.QPushButton("Cancel")
        self._horizontalLayout_2.addWidget(self._cancelButton)
        self._spacerItem2 = QtGui.QSpacerItem(
            40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self._horizontalLayout_2.addItem(self._spacerItem2)
        self._layout.addLayout(self._horizontalLayout_2)
        self._spacerItem3 = QtGui.QSpacerItem(
            20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self._layout.addItem(self._spacerItem3)
        self.setLayout(self._layout)
#        self.setTitle('The new instance of Sardana has been successfully created.')
项目:FC    作者:JanusWind    | 项目源码 | 文件源码
def __init__( self, time_strt, time_stop ) :

        # Inherit all attributes of an instance of "QDialog".

        super( dialog_auto_prog, self ).__init__( )

        # Make this a non-modal dialog (i.e., allow the user to still
        # interact with the main application window).

        self.setModal( False )

        # Set the title of this dialog window.

        self.setWindowTitle( 'Progress' )

        # Give this widget a grid layout, "self.grd".

        self.grd = QGridLayout( )

        self.grd.setContentsMargins( 6, 6, 6, 6 )

        self.setLayout( self.grd )

        # Initialize the progress bar and set its minimum, maximum, and
        # initial values.

        self.bar = QProgressBar( )

        self.bar.setMinimum( calc_time_val( time_strt ) )
        self.bar.setMaximum( calc_time_val( time_stop ) )

        self.bar.setValue( self.bar.minimum( ) )

        # Initialize the event button.

        self.btn_exit = event_PushButton( self, 'exit', 'Close' )

        # Initialize the label.

        self.lab = QLabel( 'Note: closing this window will *NOT* ' +
                           'interrupt the automated analysis.'       )

        self.lab.setWordWrap( True )

        # Row by row, add the bar and buttons to the grid layout.

        self.grd.addWidget( self.bar     , 0, 0, 1, 1 )
        self.grd.addWidget( self.btn_exit, 0, 1, 1, 1 )

        self.grd.addWidget( self.lab     , 1, 0, 1, 2 )

        # Display this dialog.

        self.show( )

    #-----------------------------------------------------------------------
    # DEFINE THE FUNCTION FOR UPDATING THE PROGRESS BAR.
    #-----------------------------------------------------------------------
项目:certificate_generator    作者:juliarizza    | 项目源码 | 文件源码
def __init__(self, save_folder, cert_data, clients,
                 responsible, preview=False):
        """
            Setup all widgets.
        """
        super(GenerateCertificateProgress, self).__init__()

        # Window config
        self.setWindowTitle(u"Gerando certificados")
        self.setGeometry(450, 300, 400, 200)
        self.preview = preview
        self.n = 0
        self.total = len(clients)+1

        # Creates the new thread
        self.generate_thread = GenerateThread(self.preview)
        self.generate_thread._get_info(save_folder, cert_data,
                                       clients, responsible)
        # Connect the signals with slots
        self.connect(
            self.generate_thread,
            QtCore.SIGNAL("finished()"),
            self.done
        )
        self.connect(
            self.generate_thread,
            QtCore.SIGNAL("update"),
            self.update
        )

        # Defines the layouts
        self.mainLayout = QtGui.QVBoxLayout()

        # Widget config
        self.titleLabel = QtGui.QLabel(u"Gerando certificados", self)
        self.titleLabel.setFont(titleFont)

        # Make the progress bar from 0 to 100
        self.progress_bar = QtGui.QProgressBar()
        self.progress_bar.setRange(0, 100)
        self.status = QtGui.QLabel(u"Carregando...", self)

        # Make the cancel button
        self.cancelBtn = QtGui.QPushButton(u"Cancelar")
        self.cancelBtn.clicked.connect(self.generate_thread.terminate)

        # Add all widgets to the mainLayout
        self.mainLayout.addWidget(self.titleLabel)
        self.mainLayout.addWidget(self.progress_bar)
        self.mainLayout.addWidget(self.status)
        self.mainLayout.addWidget(self.cancelBtn)

        # Runs the thread
        self.generate_thread.start()

        # Set the mainLayout as the visible layout
        self.setLayout(self.mainLayout)
项目:Bigglesworth    作者:MaurizioB    | 项目源码 | 文件源码
def __init__(self, parent=None):
        QtGui.QDialog.__init__(self, parent)
        self.setModal(True)
        self.setMinimumWidth(150)
        self.setWindowTitle('Sound dump')
        grid = QtGui.QGridLayout(self)
        grid.addWidget(QtGui.QLabel('Dumping sounds...'), 0, 0, 1, 2)
        grid.addWidget(QtGui.QLabel('Bank: '), 1, 0, 1, 1)
        self.bank_lbl = QtGui.QLabel()
        grid.addWidget(self.bank_lbl, 1, 1, 1, 1)
        grid.addWidget(QtGui.QLabel('Sound: '), 2, 0, 1, 1)
        self.sound_lbl = QtGui.QLabel()
        grid.addWidget(self.sound_lbl, 2, 1, 1, 1)
        grid.addWidget(QtGui.QLabel('Remaining: '), 3, 0, 1, 1)
        self.time = QtGui.QLabel()
        grid.addWidget(self.time, 3, 1, 1, 1)
        self.progress = QtGui.QProgressBar()
        self.progress.setMaximum(128)
        grid.addWidget(self.progress, 4, 0, 1, 2)

        self.button_box = QtGui.QWidget(self)
        button_box_layout = QtGui.QHBoxLayout()
        self.button_box.setLayout(button_box_layout)
        grid.addWidget(self.button_box, 5, 0, 1, 2)

        self.toggle_btn = QtGui.QPushButton('Pause', self)
        self.pause_icon = PauseIcon()
        self.resume_icon = ResumeIcon()
        self.toggle_btn.setIcon(self.pause_icon)
        self.toggle_btn.clicked.connect(self.toggle)
        button_box_layout.addWidget(self.toggle_btn)

        stop = QtGui.QPushButton('Stop', self)
        stop.setIcon(self.style().standardIcon(QtGui.QStyle.SP_DialogCloseButton))
        stop.clicked.connect(self.accept)
        button_box_layout.addWidget(stop)

        cancel = QtGui.QPushButton('Cancel', self)
        cancel.setIcon(self.style().standardIcon(QtGui.QStyle.SP_DialogCancelButton))
        cancel.setSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
        cancel.clicked.connect(self.reject)
        button_box_layout.addWidget(cancel)

        self.paused = False
项目:Offline-Typeracer    作者:softwareengpro    | 项目源码 | 文件源码
def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(800, 600)
        self.label = QtGui.QLabel(Form)
        self.label.setGeometry(QtCore.QRect(170, 310, 50, 14))
        self.label.setStyleSheet(_fromUtf8("color: rgb(0, 0, 49);"))
        self.label.setObjectName(_fromUtf8("label"))
        #self.q = 0
        #self.finish_para = 0

        #Add progress bar
        self.progressBar = QtGui.QProgressBar(Form)
        self.progressBar.setGeometry(QtCore.QRect(680, 0, 121, 23))
        self.progressBar.setMinimumSize(QtCore.QSize(118, 23))
        self.progressBar.setStyleSheet(_fromUtf8("color: rgb(0, 0, 50);"))
        self.progressBar.setObjectName(_fromUtf8("progressBar"))
        self.progressBar.setProperty("value", 0)
        self.progressBar.setMinimum(0)
        self.progressBar.setMaximum(5)

        #Add text box
        self.timeToStart = QtGui.QTextEdit(Form)
        self.timeToStart.setGeometry(QtCore.QRect(80, 40, 111, 31))
        self.timeToStart.setObjectName(_fromUtf8("timeToStart"))
        self.timeToStart.setReadOnly(True)
        self.timeToStart.setText(" Start in ")

        # Add show text paragraph
        self.showPara = QtGui.QTextEdit(Form)
        self.showPara.setGeometry(QtCore.QRect(170, 130, 581, 161))
        self.showPara.setObjectName(_fromUtf8("showPara"))
        self.showPara.setReadOnly(True)

        # Add Edit text box
        self.editPara = QtGui.QTextEdit(Form)
        self.editPara.setGeometry(QtCore.QRect(170, 325, 581, 161))
        self.editPara.setObjectName(_fromUtf8("editPara"))
        self.editPara.setReadOnly(True)
        #if self.finish_para == 0:
        #self.editPara.textChanged.connect(self.text_changed)

        self.label_2 = QtGui.QLabel(Form)
        self.label_2.setGeometry(QtCore.QRect(170, 110, 81, 16))
        self.label_2.setStyleSheet(_fromUtf8("color: rgb(0, 0, 49);"))
        self.label_2.setObjectName(_fromUtf8("label_2"))

        # add Ok button
        self.finish = QtGui.QPushButton(Form)
        self.finish.setGeometry(QtCore.QRect(670, 530, 51, 27))
        self.finish.setStyleSheet(_fromUtf8("color: rgb(0, 0, 49);"))
        self.finish.setObjectName(_fromUtf8("finish"))

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
项目:Offline-Typeracer    作者:softwareengpro    | 项目源码 | 文件源码
def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(800, 600)
        self.label = QtGui.QLabel(Form)
        self.label.setGeometry(QtCore.QRect(170, 310, 50, 14))
        self.label.setStyleSheet(_fromUtf8("color: rgb(0, 0, 49);"))
        self.label.setObjectName(_fromUtf8("label"))
        #self.q = 0
        #self.finish_para = 0

        #Add progress bar
        self.progressBar = QtGui.QProgressBar(Form)
        self.progressBar.setGeometry(QtCore.QRect(680, 0, 121, 23))
        self.progressBar.setMinimumSize(QtCore.QSize(118, 23))
        self.progressBar.setStyleSheet(_fromUtf8("color: rgb(0, 0, 50);"))
        self.progressBar.setObjectName(_fromUtf8("progressBar"))
        self.progressBar.setProperty("value", 0)
        self.progressBar.setMinimum(0)
        self.progressBar.setMaximum(5)

        #Add text box
        self.timeToStart = QtGui.QTextEdit(Form)
        self.timeToStart.setGeometry(QtCore.QRect(80, 40, 111, 31))
        self.timeToStart.setObjectName(_fromUtf8("timeToStart"))
        self.timeToStart.setReadOnly(True)
        self.timeToStart.setText(" Start in ")

        # Add show text paragraph
        self.showPara = QtGui.QTextEdit(Form)
        self.showPara.setGeometry(QtCore.QRect(170, 130, 581, 161))
        self.showPara.setObjectName(_fromUtf8("showPara"))
        self.showPara.setReadOnly(True)

        # Add Edit text box
        self.editPara = QtGui.QTextEdit(Form)
        self.editPara.setGeometry(QtCore.QRect(170, 325, 581, 161))
        self.editPara.setObjectName(_fromUtf8("editPara"))
        self.editPara.setReadOnly(True)
        #if self.finish_para == 0:
        #self.editPara.textChanged.connect(self.text_changed)

        self.label_2 = QtGui.QLabel(Form)
        self.label_2.setGeometry(QtCore.QRect(170, 110, 81, 16))
        self.label_2.setStyleSheet(_fromUtf8("color: rgb(0, 0, 49);"))
        self.label_2.setObjectName(_fromUtf8("label_2"))

        # add Ok button
        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
项目:dzetsaka    作者:lennepkade    | 项目源码 | 文件源码
def processAlgorithm(self, progress):
        """Here is where the processing itself takes place."""

        INPUT_RASTER = self.getParameterValue(self.INPUT_RASTER)
        OUTPUT_RASTER = self.getOutputValue(self.OUTPUT_RASTER)
        CLOSING_SIZE = self.getParameterValue(self.CLOSING_SIZE)



        # First we create the output layer. The output value entered by
        # the user is a string containing a filename, so we can use it
        # directly

        from scipy import ndimage
        data,im=dataraster.open_data_band(INPUT_RASTER)

        # get proj,geo and dimension (d) from data
        proj = data.GetProjection()
        geo = data.GetGeoTransform()
        d = data.RasterCount

        # add progress bar
        # And now we can process
        from PyQt4.QtGui import QProgressBar
        pb = QProgressBar()
        pb.setMaximum(d)
        pbNow = 0

        outFile=dataraster.create_empty_tiff(OUTPUT_RASTER,im,d,geo,proj)

        for i in range(d):
            # Read data from the right band
            pbNow+=1
            pb.setValue(pbNow)

            tempBand = data.GetRasterBand(i+1).ReadAsArray()
            tempBand = ndimage.morphology.grey_closing(tempBand,size=(CLOSING_SIZE,CLOSING_SIZE))

            # Save bandand outFile
            out=outFile.GetRasterBand(i+1)
            out.WriteArray(tempBand)
            out.FlushCache()
            tempBand = None
项目:dzetsaka    作者:lennepkade    | 项目源码 | 文件源码
def processAlgorithm(self, progress):
        """Here is where the processing itself takes place."""

        INPUT_RASTER = self.getParameterValue(self.INPUT_RASTER)
        OUTPUT_RASTER = self.getOutputValue(self.OUTPUT_RASTER)
        MEDIAN_ITER = self.getParameterValue(self.MEDIAN_ITER)
        MEDIAN_SIZE = self.getParameterValue(self.MEDIAN_SIZE)

        # First we create the output layer. The output value entered by
        # the user is a string containing a filename, so we can use it
        # directly

        from scipy import ndimage
        data,im=dataraster.open_data_band(INPUT_RASTER)

        # get proj,geo and dimension (d) from data
        proj = data.GetProjection()
        geo = data.GetGeoTransform()
        d = data.RasterCount

        # add progress bar
        # And now we can process
        from PyQt4.QtGui import QProgressBar
        pb = QProgressBar()
        pb.setMaximum(d*MEDIAN_ITER)
        pbNow = 0

        outFile=dataraster.create_empty_tiff(OUTPUT_RASTER,im,d,geo,proj)

        for i in range(d):
            # Read data from the right band
            pbNow+=1
            pb.setValue(pbNow)

            tempBand = data.GetRasterBand(i+1).ReadAsArray()
            tempBand = ndimage.filters.median_filter(tempBand,size=(MEDIAN_SIZE,MEDIAN_SIZE))

            # Save bandand outFile
            out=outFile.GetRasterBand(i+1)
            out.WriteArray(tempBand)
            out.FlushCache()
            tempBand = None
项目:ocr-db    作者:tristancalderbank    | 项目源码 | 文件源码
def setupUi(self, Dialog):
        Dialog.setObjectName(_fromUtf8("Dialog"))
        Dialog.resize(500, 185)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(2)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(Dialog.sizePolicy().hasHeightForWidth())
        Dialog.setSizePolicy(sizePolicy)
        Dialog.setMinimumSize(QtCore.QSize(500, 185))
        Dialog.setMaximumSize(QtCore.QSize(500, 185))
        self.verticalLayout = QtGui.QVBoxLayout(Dialog)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.progressBar = QtGui.QProgressBar(Dialog)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.progressBar.sizePolicy().hasHeightForWidth())
        self.progressBar.setSizePolicy(sizePolicy)
        self.progressBar.setCursor(QtGui.QCursor(QtCore.Qt.WaitCursor))
        self.progressBar.setProperty("value", 24)
        self.progressBar.setObjectName(_fromUtf8("progressBar"))
        self.verticalLayout.addWidget(self.progressBar)
        self.currentTask = QtGui.QLabel(Dialog)
        self.currentTask.setAlignment(QtCore.Qt.AlignCenter)
        self.currentTask.setObjectName(_fromUtf8("currentTask"))
        self.verticalLayout.addWidget(self.currentTask)
        self.currentFile = QtGui.QLabel(Dialog)
        self.currentFile.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
        self.currentFile.setObjectName(_fromUtf8("currentFile"))
        self.verticalLayout.addWidget(self.currentFile)
        self.filesProcessed = QtGui.QLabel(Dialog)
        self.filesProcessed.setObjectName(_fromUtf8("filesProcessed"))
        self.verticalLayout.addWidget(self.filesProcessed)
        self.elapsedTime = QtGui.QLabel(Dialog)
        self.elapsedTime.setObjectName(_fromUtf8("elapsedTime"))
        self.verticalLayout.addWidget(self.elapsedTime)
        self.timeRemaining = QtGui.QLabel(Dialog)
        self.timeRemaining.setObjectName(_fromUtf8("timeRemaining"))
        self.verticalLayout.addWidget(self.timeRemaining)
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.stopButton = QtGui.QPushButton(Dialog)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.stopButton.sizePolicy().hasHeightForWidth())
        self.stopButton.setSizePolicy(sizePolicy)
        self.stopButton.setMinimumSize(QtCore.QSize(0, 30))
        self.stopButton.setMaximumSize(QtCore.QSize(200, 200))
        self.stopButton.setObjectName(_fromUtf8("stopButton"))
        self.horizontalLayout.addWidget(self.stopButton)
        self.verticalLayout.addLayout(self.horizontalLayout)

        self.retranslateUi(Dialog)
        QtCore.QMetaObject.connectSlotsByName(Dialog)
项目:pslab-desktop-apps    作者:fossasia    | 项目源码 | 文件源码
def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(216, 338)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(Form.sizePolicy().hasHeightForWidth())
        Form.setSizePolicy(sizePolicy)
        Form.setStyleSheet(_fromUtf8(""))
        self.verticalLayout = QtGui.QVBoxLayout(Form)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.frame = QtGui.QFrame(Form)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.frame.sizePolicy().hasHeightForWidth())
        self.frame.setSizePolicy(sizePolicy)
        self.frame.setStyleSheet(_fromUtf8(""))
        self.frame.setFrameShape(QtGui.QFrame.StyledPanel)
        self.frame.setFrameShadow(QtGui.QFrame.Raised)
        self.frame.setObjectName(_fromUtf8("frame"))
        self.formLayout = QtGui.QFormLayout(self.frame)
        self.formLayout.setObjectName(_fromUtf8("formLayout"))
        self.progress = QtGui.QProgressBar(self.frame)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.progress.sizePolicy().hasHeightForWidth())
        self.progress.setSizePolicy(sizePolicy)
        self.progress.setStyleSheet(_fromUtf8(""))
        self.progress.setProperty("value", 0)
        self.progress.setObjectName(_fromUtf8("progress"))
        self.formLayout.setWidget(0, QtGui.QFormLayout.SpanningRole, self.progress)
        self.pushButton = QtGui.QPushButton(self.frame)
        self.pushButton.setMinimumSize(QtCore.QSize(0, 50))
        self.pushButton.setStyleSheet(_fromUtf8(""))
        self.pushButton.setObjectName(_fromUtf8("pushButton"))
        self.formLayout.setWidget(1, QtGui.QFormLayout.SpanningRole, self.pushButton)
        self.frame_2 = QtGui.QFrame(self.frame)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Maximum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.frame_2.sizePolicy().hasHeightForWidth())
        self.frame_2.setSizePolicy(sizePolicy)
        self.frame_2.setFrameShape(QtGui.QFrame.StyledPanel)
        self.frame_2.setFrameShadow(QtGui.QFrame.Raised)
        self.frame_2.setObjectName(_fromUtf8("frame_2"))
        self.horizontalLayout = QtGui.QHBoxLayout(self.frame_2)
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.VLabel = QtGui.QLabel(self.frame_2)
        self.VLabel.setObjectName(_fromUtf8("VLabel"))
        self.horizontalLayout.addWidget(self.VLabel)
        self.ILabel = QtGui.QLabel(self.frame_2)
        self.ILabel.setObjectName(_fromUtf8("ILabel"))
        self.horizontalLayout.addWidget(self.ILabel)
        self.formLayout.setWidget(2, QtGui.QFormLayout.SpanningRole, self.frame_2)
        self.verticalLayout.addWidget(self.frame)

        self.retranslateUi(Form)
        QtCore.QObject.connect(self.pushButton, QtCore.SIGNAL(_fromUtf8("clicked(bool)")), Form.start)
        QtCore.QMetaObject.connectSlotsByName(Form)