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


Python QtGui.QLabel方法代码示例

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


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

示例1: __init__

# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QLabel [as 别名]
def __init__(self, info_data, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.resize(QtCore.QSize(500,500))
        self.info_table = QtGui.QTableWidget()
        self.setCentralWidget(self.info_table)
        self.info_table.setSortingEnabled(False)
        self.info_table.horizontalHeader().setStretchLastSection(True)
        self.info_table.resizeColumnsToContents()
        self.info_table.setColumnCount(2)
        self.info_table.setColumnWidth(0, 120)
        self.info_table.setColumnWidth(1, 50)
        self.info_table.setHorizontalHeaderLabels(['Name', 'value'])
        index = 0
        for name, value in info_data.items():
            self.info_table.insertRow(index)
            self.info_table.setCellWidget(index, 0, QtGui.QLabel(name))
            self.info_table.setCellWidget(index, 1, QtGui.QLabel(str(value)))
            index += 1
#             self.info_table.setCellWidget(index, 0, QtGui.QLabel(des)) 
开发者ID:Marxlp,项目名称:pyFlightAnalysis,代码行数:21,代码来源:widgets.py

示例2: update_table

# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QLabel [as 别名]
def update_table(self):
        self.params_table.setRowCount(0)
        index = 0
        for name, value in self.params_data.items():
            if name in self.params_data_show:
                self.params_table.insertRow(index)
                if name in self.changed_params_data:
                    name_str = "<font color='red'>%s</font>"%(name)
                    value_str = "<font color='red'>%s</font>"%(str(value))
                else:
                    name_str = name
                    value_str = str(value)
                name_lbl = QtGui.QLabel(name_str)
                value_lbl = QtGui.QLabel(value_str)
                self.params_table.setCellWidget(index, 0, name_lbl)
                self.params_table.setCellWidget(index, 1, value_lbl)
                index += 1 
开发者ID:Marxlp,项目名称:pyFlightAnalysis,代码行数:19,代码来源:widgets.py

示例3: initMaskFunctionControls

# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QLabel [as 别名]
def initMaskFunctionControls(self):
        self.maskFunctionControlslayout = QtGui.QHBoxLayout()
        labelsLayout = QtGui.QVBoxLayout()
        slidersLayout = QtGui.QVBoxLayout()
        self.maskFunctionControlslayout.addLayout(labelsLayout)
        self.maskFunctionControlslayout.addLayout(slidersLayout)
        def addSlider(label, changedFunction, minimum, maximum, value):
            labelWidget = QtGui.QLabel(label)
            labelsLayout.addWidget(labelWidget)
            slider = QtGui.QSlider(QtCore.Qt.Horizontal)
            slider.setMinimum(minimum)
            slider.setMaximum(maximum)
            slider.setValue(value)
            slider.sliderReleased.connect(changedFunction)
            slidersLayout.addWidget(slider)
            return slider, labelWidget
        
        self.targetModeWindowTDOASlider, self.targetModeWindowTDOALabel = addSlider('Center:', self.tdoaRegionChanged, 0, 100, 50)
        self.targetModeWindowWidthSlider, _ = addSlider('Width:', self.tdoaRegionChanged, 1, 101, 50)
        self.targetModeWindowBetaSlider, _ = addSlider('Shape:', self.tdoaRegionChanged, 0, 100, 50)
        self.targetModeWindowNoiseFloorSlider, _ = addSlider('Floor:', self.tdoaRegionChanged, 0, 100, 0) 
开发者ID:seanwood,项目名称:gcc-nmf,代码行数:23,代码来源:gccNMFInterface.py

示例4: initNMFControls

# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QLabel [as 别名]
def initNMFControls(self):
        self.nmfControlsLayout = QtGui.QHBoxLayout()
        self.nmfControlsLayout.addStretch(1)
        self.nmfControlsLayout.addWidget(QtGui.QLabel('Dictionary Size:'))
        self.dictionarySizeDropDown = QtGui.QComboBox()
        for dictionarySize in self.dictionarySizes:
            self.dictionarySizeDropDown.addItem( str(dictionarySize) )
        self.dictionarySizeDropDown.setMaximumWidth(75)
        self.dictionarySizeDropDown.setCurrentIndex(self.dictionarySizes.index(self.dictionarySize))
        self.dictionarySizeDropDown.currentIndexChanged.connect(self.dictionarySizeChanged)
        self.nmfControlsLayout.addWidget(self.dictionarySizeDropDown)
        self.nmfControlsLayout.addStretch(1)
        
        self.nmfControlsLayout.addWidget(QtGui.QLabel('Num Updates:'))
        self.numHUpdatesSpinBox = QtGui.QSpinBox()
        self.nmfControlsLayout.addWidget(self.numHUpdatesSpinBox)
        self.nmfControlsLayout.addStretch(1) 
开发者ID:seanwood,项目名称:gcc-nmf,代码行数:19,代码来源:gccNMFInterface.py

示例5: initLocalizationControls

# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QLabel [as 别名]
def initLocalizationControls(self):
        self.localizationControlsLayout = QtGui.QHBoxLayout()
        self.localizationControlsLayout.addStretch(3)
        self.localizationCheckBox = QtGui.QCheckBox('Enable Localization')
        self.localizationCheckBox.setChecked(self.localizationEnabled)
        self.localizationCheckBox.stateChanged.connect(self.localizationStateChanged)
        self.localizationControlsLayout.addWidget(self.localizationCheckBox)

        self.localizationControlsLayout.addStretch(1)
        self.localizationWindowSizeLabel = QtGui.QLabel('Sliding Window Size:')
        self.localizationControlsLayout.addWidget(self.localizationWindowSizeLabel)
        self.localziaitonWindowSizeSpinBox = QtGui.QSpinBox()
        self.localziaitonWindowSizeSpinBox.setMinimum(1)
        self.localziaitonWindowSizeSpinBox.setMaximum(128)
        self.localziaitonWindowSizeSpinBox.setValue(self.localizationWindowSize)
        self.localziaitonWindowSizeSpinBox.valueChanged.connect(self.localizationParamsChanged)
        self.localizationControlsLayout.addWidget(self.localziaitonWindowSizeSpinBox)
        self.localizationControlsLayout.addStretch(3) 
开发者ID:seanwood,项目名称:gcc-nmf,代码行数:20,代码来源:gccNMFInterface.py

示例6: run

# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QLabel [as 别名]
def run(self):
        self.dialog.setText('Loading...')
        self.dialog.setStyleSheet('QLabel{min-width: 100px;}')
        self.dialog.show() 
开发者ID:Marxlp,项目名称:pyFlightAnalysis,代码行数:6,代码来源:widgets.py

示例7: __init__

# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QLabel [as 别名]
def __init__(self, parent):
        QtGui.QLabel.__init__(self, parent)
        self.UIsAreSet = False 
开发者ID:Florian455,项目名称:Astibot,代码行数:5,代码来源:UIWidgets.py

示例8: __init__

# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QLabel [as 别名]
def __init__(self, parent=None):
        super(App, self).__init__(parent)

        #### Create Gui Elements ###########
        self.mainbox = QtGui.QWidget()
        self.setCentralWidget(self.mainbox)
        self.mainbox.setLayout(QtGui.QVBoxLayout())

        self.canvas = pg.GraphicsLayoutWidget()
        self.mainbox.layout().addWidget(self.canvas)

        self.label = QtGui.QLabel()
        self.mainbox.layout().addWidget(self.label)

        self.view = self.canvas.addViewBox()
        self.view.setAspectLocked(True)
        self.view.setRange(QtCore.QRectF(0,0, 100, 100))

        #  image plot
        self.img = pg.ImageItem(border='w')
        self.view.addItem(self.img)

        self.canvas.nextRow()
        #  line plot
        self.otherplot = self.canvas.addPlot()
        self.h2 = self.otherplot.plot(pen='y')


        #### Set Data  #####################

        self.x = np.linspace(0,50., num=100)
        self.X,self.Y = np.meshgrid(self.x,self.x)

        self.counter = 0
        self.fps = 0.
        self.lastupdate = time.time()

        #### Start  #####################
        self._update() 
开发者ID:timctho,项目名称:VNect-tensorflow,代码行数:41,代码来源:plotly_test.py

示例9: initWindowLayout

# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QLabel [as 别名]
def initWindowLayout(self):
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(1)
        sizePolicy.setVerticalStretch(1)
        
        self.infoLabelWidgets = []
        def addWidgetWithLabel(widget, label, fromRow, fromColumn, rowSpan=1, columnSpan=1):
            labeledWidget = QtGui.QWidget()
            widgetLayout = QtGui.QVBoxLayout()
            widgetLayout.setContentsMargins(0, 0, 0, 0)
            widgetLayout.setSpacing(1)
            labeledWidget.setLayout(widgetLayout)
            
            labelWidget = QtGui.QLabel(label)
            labelWidget.setContentsMargins(0, 3, 0, 1)
            labelWidget.setAutoFillBackground(True)
            labelWidget.setAlignment(QtCore.Qt.AlignCenter)
            #labelWidget.setStyleSheet('QLabel { border-top-width: 10px }')       
            self.infoLabelWidgets.append(labelWidget)
            
            widgetLayout.addWidget(labelWidget)
            widgetLayout.addWidget(widget)
            labeledWidget.setSizePolicy(sizePolicy)
            self.mainLayout.addWidget(labeledWidget, fromRow, fromColumn, rowSpan, columnSpan)
        
        addWidgetWithLabel(self.inputSpectrogramWidget, 'Input Spectrogram', 0, 1)
        addWidgetWithLabel(self.outputSpectrogramWidget, 'Output Spectrogram', 1, 1)
        addWidgetWithLabel(self.controlsWidget, 'GCC-NMF Masking Function', 0, 2)
        addWidgetWithLabel(self.gccPHATHistoryWidget, 'GCC PHAT Angular Spectrogram', 0, 3)
        addWidgetWithLabel(self.dictionaryWidget, 'NMF Dictionary', 1, 2)
        addWidgetWithLabel(self.coefficientMaskWidget, 'NMF Dictionary Mask', 1, 3)
        #for widget in self.infoLabelWidgets:
        #    widget.hide()
        #map(lambda widget: widget.hide(), self.infoLabelWidgets) 
开发者ID:seanwood,项目名称:gcc-nmf,代码行数:36,代码来源:gccNMFInterface.py

示例10: update_graph

# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QLabel [as 别名]
def update_graph(self):
        # update tableView
        # clear 
        self.plotting_data_tableView.setRowCount(0)
        # add
        for ind, (item_id, item) in enumerate(self.data_plotting.items()):
            self.plotting_data_tableView.insertRow(ind)
            self.plotting_data_tableView.setCellWidget(ind, 0, QtGui.QLabel(item[0]))
            chkbox = Checkbox(item_id, '')
            chkbox.setChecked(item[1])
            chkbox.sigStateChanged.connect(self.callback_visible_changed)
            self.plotting_data_tableView.setCellWidget(ind, 1, chkbox)
            curve = item[2]
            color = curve.opts['pen']
            if isinstance(color, QtGui.QColor):
                color = color.red(), color.green(), color.blue()
            marker = curve.opts['symbol']
            marker_dict = OrderedDict([(None,'None'), ('s','☐'), ('t','▽'), ('o','○'), ('+','+')])
            color_text = '#{0[0]:02x}{0[1]:02x}{0[2]:02x}'.format(color)
            lbl_txt = "<font color='{0}'>{1}</font> {2}".format(color_text,'▇▇',str(marker_dict[marker]))
            lbl = PropertyLabel(item_id, self, lbl_txt)
            lbl.sigPropertyChanged.connect(self.callback_property_changed)
            self.plotting_data_tableView.setCellWidget(ind, 2, lbl)
        
        # update curve
        # remove curves in graph
        items_to_be_removed = []
        for item in self.main_graph_t.items:
            if isinstance(item, pg.PlotDataItem):
                items_to_be_removed.append(item)
        for item in items_to_be_removed:
            self.main_graph_t.removeItem(item)

        self.main_graph_t.legend.scene().removeItem(self.main_graph_t.legend)
        self.main_graph_t.addLegend()
        # redraw curves
        for ind, (item_id, item) in enumerate(self.data_plotting.items()):
            label, showed, curve = item
            color = curve.opts['pen']
            if isinstance(color, QtGui.QColor):
                color = color.red(), color.green(), color.blue()
            data = curve.xData, curve.yData
            marker = curve.opts['symbol']
            symbolSize = curve.opts['symbolSize']
            if showed:
                curve = self.main_graph_t.plot(data[0], data[1], symbol=marker, pen=color, name=label, symbolSize=symbolSize)
                self.data_plotting[item_id][2] = curve 
        self.update_ROI_graph() 
开发者ID:Marxlp,项目名称:pyFlightAnalysis,代码行数:50,代码来源:analysis.py


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