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


Python QtWidgets.QProgressBar方法代码示例

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


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

示例1: __init__

# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QProgressBar [as 别名]
def __init__(self, remotePath: str, targetPath: str, isMultipleDownload: bool, parent: QObject):
        super().__init__(parent, Qt.CustomizeWindowHint | Qt.WindowTitleHint)
        self.titleLabel = QLabel(f"Downloading {remotePath} to {targetPath}")

        self.progressBar = QProgressBar()
        self.progressBar.setMinimum(0)
        self.progressBar.setMaximum(0)


        self.actualProgress = 0
        self.actualMaximum = 0
        self.isComplete = False

        self.isMultipleDownload = isMultipleDownload
        self.downloadCount = 0
        self.downloadTotal = 0

        self.progressLabel = QLabel(f"{self.downloadCount} / {self.downloadTotal} files downloaded")
        self.progressSizeLabel = QLabel("0 bytes")

        self.widgetLayout = QVBoxLayout()
        self.widgetLayout.addWidget(self.titleLabel)
        self.widgetLayout.addWidget(self.progressLabel)
        self.widgetLayout.addWidget(self.progressBar)
        self.widgetLayout.addWidget(self.progressSizeLabel)

        self.closeButton = QPushButton("Continue download in background")
        self.closeButton.clicked.connect(self.hide)
        self.widgetLayout.addWidget(self.closeButton)

        self.setLayout(self.widgetLayout) 
开发者ID:GoSecure,项目名称:pyrdp,代码行数:33,代码来源:FileDownloadDialog.py

示例2: __init__

# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QProgressBar [as 别名]
def __init__ (self, parent):
        QtWidgets.QDialog.__init__(self, parent)
        self.setWindowTitle("Export depth maps")

        self.btnQuit = QtWidgets.QPushButton("&Close")
        self.btnP1 = QtWidgets.QPushButton("&Export")
        self.pBar = QtWidgets.QProgressBar()
        self.pBar.setTextVisible(False)

        # self.selTxt =QtWidgets.QLabel()
        # self.selTxt.setText("Apply to:")
        self.radioBtn_all = QtWidgets.QRadioButton("Apply to all cameras")
        self.radioBtn_sel = QtWidgets.QRadioButton("Apply to selected")
        self.radioBtn_all.setChecked(True)
        self.radioBtn_sel.setChecked(False)

        self.formTxt = QtWidgets.QLabel()
        self.formTxt.setText("Export format:")
        self.formCmb = QtWidgets.QComboBox()
        self.formCmb.addItem("1-band F32")
        self.formCmb.addItem("Grayscale 8-bit")
        self.formCmb.addItem("Grayscale 16-bit")

        # creating layout
        layout = QtWidgets.QGridLayout()
        layout.setSpacing(10)
        layout.addWidget(self.radioBtn_all, 0, 0)
        layout.addWidget(self.radioBtn_sel, 1, 0)
        layout.addWidget(self.formTxt, 0, 1)
        layout.addWidget(self.formCmb, 1, 1)
        layout.addWidget(self.btnP1, 2, 0)
        layout.addWidget(self.btnQuit, 2, 1)
        layout.addWidget(self.pBar, 3, 0, 1, 2)
        self.setLayout(layout)  

        QtCore.QObject.connect(self.btnP1, QtCore.SIGNAL("clicked()"), self.export_depth)
        QtCore.QObject.connect(self.btnQuit, QtCore.SIGNAL("clicked()"), self, QtCore.SLOT("reject()"))    

        self.exec() 
开发者ID:agisoft-llc,项目名称:metashape-scripts,代码行数:41,代码来源:export_depth_maps_dialog.py

示例3: _init_statusbar

# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QProgressBar [as 别名]
def _init_statusbar(self):

        self._progressbar = QProgressBar()

        self._progressbar.setMinimum(0)
        self._progressbar.setMaximum(100)
        self._progressbar.hide()

        self.statusBar().addPermanentWidget(self._progressbar) 
开发者ID:angr,项目名称:angr-management,代码行数:11,代码来源:main_window.py

示例4: __init__

# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QProgressBar [as 别名]
def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent)

        icon_location = os.path.join(IMG_LOCATION, 'angr.png')
        self.setWindowIcon(QIcon(icon_location))

        GlobalInfo.main_window = self

        # initialization
        self.setMinimumSize(QSize(400, 400))
        self.setDockNestingEnabled(True)

        self.workspace = None
        self.central_widget = None
        self.central_widget2 = None

        self._file_toolbar = None  # type: FileToolbar
        self._states_toolbar = None  # type: StatesToolbar
        self._analysis_toolbar = None  # type: AnalysisToolbar
        self._progressbar = None  # type: QProgressBar
        self._load_binary_dialog = None

        self._status = ""
        self._progress = None

        self.defaultWindowFlags = None

        # menus
        self._file_menu = None
        self._analyze_menu = None
        self._view_menu = None
        self._help_menu = None
        self._plugin_menu = None
        self._sync_menu = None

        self._init_toolbars()
        self._init_statusbar()
        self._init_workspace()
        self._init_shortcuts()
        self._init_menus()
        self._init_plugins()

        self.showMaximized()

        # event handlers
        self.windowHandle().screenChanged.connect(self.on_screen_changed)

        # I'm ready to show off!
        self.show()

        self.status = "Ready." 
开发者ID:angr,项目名称:angr-management,代码行数:53,代码来源:main_window.py


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