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


Python QLabel.setText方法代码示例

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


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

示例1: RunnerWidget

# 需要导入模块: from qt import QLabel [as 别名]
# 或者: from qt.QLabel import setText [as 别名]
class RunnerWidget(QWidget):
    def __init__(self, parent, umlmachines, name='RunnerWidget'):
        QWidget.__init__(self, parent, name)
        self.app = get_application_pointer()
        self.umlmachines = umlmachines
        self.proc = self.umlmachines.run_machine()
        self._mainbox = QVBoxLayout(self, 5, 7)
        # add label
        self.mainlabel = QLabel(self)
        self.mainlabel.setText('Running Umlmachine %s' % self.umlmachines.current)
        self._mainbox.addWidget(self.mainlabel)
        # add stdout viewer
        logfile = self.umlmachines.stdout_logfile.name
        self.logbrowser = LogBrowser(self, logfile)
        self._mainbox.addWidget(self.logbrowser)
        self.timer = QTimer(self)
        self.connect(self.timer, SIGNAL('timeout()'), self.update_progress)
        self.timer.startTimer(1000)
        
    def update_progress(self):
        #retval = self.proc.poll()
        #print retval
        retval = None
        if retval is not None:
            print retval
            self.close()
开发者ID:joelsefus,项目名称:paella,代码行数:28,代码来源:runner.py

示例2: BootStrapperWidget

# 需要导入模块: from qt import QLabel [as 别名]
# 或者: from qt.QLabel import setText [as 别名]
class BootStrapperWidget(QWidget):
    def __init__(self, parent, suite, name="RunnerWidget"):
        QWidget.__init__(self, parent, name)
        self.app = get_application_pointer()
        cfg = self.app.umlcfg
        basefile = make_base_filesystem(suite, "%s.base" % suite, cfg=cfg, size=300, mkfs="mke2fs")
        self.bootstrapper = UmlBootstrapper(suite, basefile, cfg=self.cfg)
        self._mainbox = QVBoxLayout(self, 5, 7)
        # add label
        self.mainlabel = QLabel(self)
        self.mainlabel.setText("Bootstrapping suite %s" % suite)
        self._mainbox.addWidget(self.mainlabel)
        # add stdout viewer
        logfile = self.umlmachines.stdout_logfile.name
        self.logbrowser = LogBrowser(self, logfile)
        self._mainbox.addWidget(self.logbrowser)
        self.timer = QTimer(self)
        self.connect(self.timer, SIGNAL("timeout()"), self.update_progress)
        self.timer.startTimer(1000)

    def update_progress(self):
        # retval = self.proc.poll()
        # print retval
        retval = None
        if retval is not None:
            print retval
            self.close()
开发者ID:joelsefus,项目名称:paella,代码行数:29,代码来源:bootstrapper.py

示例3: _make_box

# 需要导入模块: from qt import QLabel [as 别名]
# 或者: from qt.QLabel import setText [as 别名]
 def _make_box(self, text, choices):
     lbl = QLabel(self.frame)
     lbl.setText(text)
     box = KComboBox(self.frame)
     box.insertStrList(choices)
     self.vbox.addWidget(lbl)
     self.vbox.addWidget(box)
     return lbl, box
开发者ID:BackupTheBerlios,项目名称:paella-svn,代码行数:10,代码来源:base.py

示例4: WidgetSeleccionCaja

# 需要导入模块: from qt import QLabel [as 别名]
# 或者: from qt.QLabel import setText [as 别名]
class WidgetSeleccionCaja(QVBox):
    """El elemento de seleccion más sencillo.
    Solo contiene una caja"""
    def __init__(self, nombre, parent = None):
        from Driza.iuqt3.widgetsqt import WidgetListaListBox
        QVBox.__init__(self, parent)
        self.label = QLabel(self)
        self.label.setText(nombre)
        self.caja = WidgetListaListBox(self)
开发者ID:,项目名称:,代码行数:11,代码来源:

示例5: __init_widgets_categorias

# 需要导入模块: from qt import QLabel [as 别名]
# 或者: from qt.QLabel import setText [as 别名]
 def __init_widgets_categorias(self):
     """Inicializa los widgets de cada categoria"""
     from sets import ImmutableSet
     for categoria in self.__gestorcategorias.listacategorias:
         tmpset = ImmutableSet(categoria.etiquetas)
         label = QLabel(None, "")
         label.setAlignment(QLabel.WordBreak)
         label.setText(categoria.descripcion)
         self.__diccionariowidgets["categorias"][tmpset] = label
         self.widgetStack1.addWidget(label)
开发者ID:,项目名称:,代码行数:12,代码来源:

示例6: NewMachineDialog

# 需要导入模块: from qt import QLabel [as 别名]
# 或者: from qt.QLabel import setText [as 别名]
class NewMachineDialog(BaseMachineDialog):
    def __init__(self, parent, handler):
        BaseMachineDialog.__init__(self, parent, handler)
        self.machnameLbl = QLabel(self.frame)
        self.machnameLbl.setText('Machine Name')
        self.machnameEntry = KLineEdit(self.frame)
        self.vbox.addWidget(self.machnameLbl)
        self.vbox.addWidget(self.machnameEntry)
        self._make_common_boxes()
        self.dbaction = 'insert'
开发者ID:BackupTheBerlios,项目名称:paella-svn,代码行数:12,代码来源:base.py

示例7: __init_dic_widgets_otros

# 需要导入模块: from qt import QLabel [as 别名]
# 或者: from qt.QLabel import setText [as 别名]
 def __init_dic_widgets_otros(self):
     """Inicializa el diccionario de widgets en la categoria otros"""
     noimplementado = QLabel(None, "No implementado")
     noimplementado.setText("No implementado")
     condicionesincorrectas = QLabel(None, "No se dan las condiciones adecuadas")
     condicionesincorrectas.setText("No se dan las condiciones adecuadas")
     self.__diccionariowidgets["otros"]["condicionesincorrectas"] = condicionesincorrectas
     self.__diccionariowidgets["otros"]["noimplementado"] = noimplementado
     self.widgetStack1.addWidget(noimplementado)
     self.widgetStack1.addWidget(condicionesincorrectas)
开发者ID:,项目名称:,代码行数:12,代码来源:

示例8: MachineParentDialog

# 需要导入模块: from qt import QLabel [as 别名]
# 或者: from qt.QLabel import setText [as 别名]
class MachineParentDialog(BaseMachineDialog):
    def __init__(self, parent, handler):
        BaseMachineDialog.__init__(self, parent, handler)
        self.parentLbl = QLabel(self.frame)
        self.parentLbl.setText("parent")
        self.parentEntry = KLineEdit(self.frame)
        self.vbox.addWidget(self.parentLbl)
        self.vbox.addWidget(self.parentEntry)

    def slotOkClicked(self):
        pass
开发者ID:joelsefus,项目名称:paella,代码行数:13,代码来源:base.py

示例9: AuditGameDialog

# 需要导入模块: from qt import QLabel [as 别名]
# 或者: from qt.QLabel import setText [as 别名]
class AuditGameDialog(BaseDialogWindow):
    def __init__(self, parent, name='AuditGameDialog'):
        BaseDialogWindow.__init__(self, parent, name=name)
        #self.grid = QGridLayout(self, 2, 1, 5, 7)
        self.frame = KTextBrowser(self)
        self.frame.setNotifyClick(True)
        self.frame.setSource = self.setSource
        self.doc = AuditGameDocument(self.app)
        #self.grid.addWidget(self.frame, 0, 0)
        self.progress_label = QLabel(self)
        self.progress = KProgress(self)
        #self.grid.addWidget(self.progress, 1, 0)
        self.setMainWidget(self.frame)
        layout = self.layout()
        # we use insertWidget instead of
        # addWidget here so the widgets
        # are above the dialog buttons
        # self frame should be at 0 index in the layout
        # we set the progress and label below this
        layout.insertWidget(1, self.progress)
        # inserting into index 1 here knocks self.progress down to 2
        layout.insertWidget(1, self.progress_label)
        # disable and hide extra buttons
        self.enableButtonApply(False)
        self.showButtonApply(False)
        self.enableButtonCancel(False)
        self.showButtonCancel(False)
        # the dialog should be a little taller than what
        # it defaults to
        self.resize(0, 300)
        
    def report_md5check(self, filename, count):
        self.progress_label.setText('checking %s' % filename)
        self.progress.setProgress(count)
        self.app.processEvents()
    
    def audit_game(self, name, from_install=True, time='now'):
        filehandler = self.app.make_new_fileshandler()
        total = len(filehandler.datahandler.get_installed_files(name))
        self.progress.setTotalSteps(total)
        filehandler.archivehelper.report_installed_file_handled = self.report_md5check
        unchanged, changed, extra = filehandler.audit_game_files(name,
                                                                 from_install=from_install, time=time)
        self.doc.set_info(unchanged, changed, extra)
        self.frame.setText(self.doc.output())
        self.progress_label.setText('Audit Completed')

    def setSource(self, url):
        print url
        if url == 'show':
            self.doc.append_unchanged_files()
            self.frame.setText(self.doc.output())
开发者ID:BackupTheBerlios,项目名称:dosbox-pykde-svn,代码行数:54,代码来源:infobrowser.py

示例10: NewKernelDialog

# 需要导入模块: from qt import QLabel [as 别名]
# 或者: from qt.QLabel import setText [as 别名]
class NewKernelDialog(BaseMachineDialog):
    def __init__(self, parent, handler):
        BaseMachineDialog.__init__(self, parent, handler)
        self.kernelLbl = QLabel(self.frame)
        self.kernelLbl.setText('Name of kernel package')
        self.kernelEntry = KLineEdit(self.frame)
        self.vbox.addWidget(self.kernelLbl)
        self.vbox.addWidget(self.kernelEntry)
        self.dbaction = 'insert'

    def slotOkClicked(self):
        kernel = str(self.kernelEntry.text())
        self.handler.add_kernel(kernel)
开发者ID:joelsefus,项目名称:paella,代码行数:15,代码来源:base.py

示例11: NewMachineDialog

# 需要导入模块: from qt import QLabel [as 别名]
# 或者: from qt.QLabel import setText [as 别名]
class NewMachineDialog(BaseMachineDialog):
    def __init__(self, parent, handler):
        BaseMachineDialog.__init__(self, parent, handler)
        self.machnameLbl = QLabel(self.frame)
        self.machnameLbl.setText('Machine Name')
        self.machnameEntry = KLineEdit(self.frame)
        self.vbox.addWidget(self.machnameLbl)
        self.vbox.addWidget(self.machnameEntry)
        self.dbaction = 'insert'

    def slotOkClicked(self):
        machine = str(self.machnameEntry.text())
        print "slotOkClicked", machine
        self.handler.make_a_machine(machine)
开发者ID:joelsefus,项目名称:paella,代码行数:16,代码来源:base.py

示例12: EditMachineDIalog

# 需要导入模块: from qt import QLabel [as 别名]
# 或者: from qt.QLabel import setText [as 别名]
class EditMachineDIalog(BaseMachineDialog):
    def __init__(self, parent, handler, machine):
        BaseMachineDialog.__init__(self, parent, handler)
        self.machine = machine
        self.machLbl = QLabel(self.frame)
        self.machLbl.setText('Edit Machine %s' % machine)
        self.vbox.addWidget(self.machLbl)
        self._make_common_boxes()
        self._set_combo_boxes(self.handler.current)
        self.dbaction = 'update'
        
    def _set_combo_boxes(self, row):
        kernel = self._lists['kernels'].index(row.kernel)
        self.kernelBox.setCurrentItem(kernel)
        profile = self._lists['profiles'].index(row.profile)
        self.profileBox.setCurrentItem(profile)
开发者ID:joelsefus,项目名称:paella,代码行数:18,代码来源:base.py

示例13: LabeledProgress

# 需要导入模块: from qt import QLabel [as 别名]
# 或者: from qt.QLabel import setText [as 别名]
class LabeledProgress(QWidget):
    def __init__(self, parent, text='', name='LabeledProgress'):
        QWidget.__init__(self, parent, name)
        self.grid = QGridLayout(self, 2, 1, 5, 7)
        self.label = QLabel(self)
        if text:
            self.label.setText(text)
        self.progressbar = SimpleProgress(self)
        self.grid.addWidget(self.label, 0, 0)
        self.grid.addWidget(self.progressbar, 1, 0)
                  
    def setTotalSteps(self, total):
        self.progressbar.setTotalSteps(total)

    def step_progress(self, *args):
        self.progressbar.step_progress(*args)
开发者ID:BackupTheBerlios,项目名称:paella-svn,代码行数:18,代码来源:progress.py

示例14: NewDiskConfigDialog

# 需要导入模块: from qt import QLabel [as 别名]
# 或者: from qt.QLabel import setText [as 别名]
class NewDiskConfigDialog(VboxDialog):
    def __init__(self, parent, handler):
        VboxDialog.__init__(self, parent)
        self.diskconfig = handler
        self.diskconfigLbl = QLabel(self.frame)
        self.diskconfigLbl.setText('DiskConfig Name')
        self.diskconfigEntry = KLineEdit(self.frame)
        self.contentLbl = QLabel(self.frame)
        self.contentLbl.setText('DiskConfig Content')
        self.contentEntry = KTextEdit(self.frame)
        self.vbox.addWidget(self.diskconfigLbl)
        self.vbox.addWidget(self.diskconfigEntry)
        self.vbox.addWidget(self.contentLbl)
        self.vbox.addWidget(self.contentEntry)
        self.connect(self, SIGNAL('okClicked()'), self.slotOkClicked)

    def slotOkClicked(self):
        name = str(self.diskconfigEntry.text())
        content = str(self.contentEntry.text())
        self.diskconfig.set(name, dict(content=content))
开发者ID:joelsefus,项目名称:paella,代码行数:22,代码来源:base.py

示例15: BaseMachineAttributeDialog

# 需要导入模块: from qt import QLabel [as 别名]
# 或者: from qt.QLabel import setText [as 别名]
class BaseMachineAttributeDialog(BaseMachineDialog):
    def __init__(self, parent, handler, attribute):
        BaseMachineDialog.__init__(self, parent, handler)
        self.attributeLbl = QLabel(self.frame)
        self.attributeLbl.setText(attribute)
        self.attributeEntry = KLineEdit(self.frame)
        self.vbox.addWidget(self.attributeLbl)
        self.vbox.addWidget(self.attributeEntry)
        self.attribute = attribute

    def slotOkClicked(self):
        value = str(self.attributeEntry.text())
        try:
            self.handler.set_attribute(self.attribute, value)
        except OperationalError, inst:
            if 'violates foreign key constraint' in inst.message:
                KMessageBox.error(self, '%s is not a valid %s' % (value, self.attribute))
            else:
                raise OperationalError(inst)
        except NoSuchKernelError, inst:
            KMessageBox.error("There's no such kernel: %s" % value)
开发者ID:joelsefus,项目名称:paella,代码行数:23,代码来源:base.py


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