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


Python QtGui.QLabel方法代码示例

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


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

示例1: initUI

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QLabel [as 别名]
def initUI(self):
        grid = QtGui.QGridLayout()

        grid.addWidget(QtGui.QLabel(u'过滤规则:', parent=self), 0, 0, 1, 1)
        self.filter = QtGui.QLineEdit(parent=self)
        grid.addWidget(self.filter, 0, 1, 1, 1)
        # 创建ButtonBox,用户确定和取消
        buttonBox = QtGui.QDialogButtonBox(parent=self)
        buttonBox.setOrientation(QtCore.Qt.Horizontal) # 设置为水平方向
        buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) # 确定和取消两个按钮
        # 连接信号和槽
        buttonBox.accepted.connect(self.accept) # 确定
        buttonBox.rejected.connect(self.reject) # 取消
        # 垂直布局,布局表格及按钮
        layout = QtGui.QVBoxLayout()
        # 加入前面创建的表格布局
        layout.addLayout(grid)
        # 放一个间隔对象美化布局
        spacerItem = QtGui.QSpacerItem(20, 48, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        layout.addItem(spacerItem)
        # ButtonBox
        layout.addWidget(buttonBox)
        self.setLayout(layout) 
开发者ID:HatBoy,项目名称:SimpleSniffer,代码行数:25,代码来源:Sniffer.py

示例2: __init__

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QLabel [as 别名]
def __init__(self, parent, rect, myname):
        self.myname = myname
        self.rect = rect
        QtGui.QLabel.__init__(self, parent)

        self.pause = False
        self.count = 0
        self.img_list = []
        self.img_inc = 1

        self.get_images()

        self.setObjectName("slideShow")
        self.setGeometry(rect)
        self.setStyleSheet("#slideShow { background-color: " +
                           Config.slide_bg_color + "; }")
        self.setAlignment(Qt.AlignHCenter | Qt.AlignCenter) 
开发者ID:n0bel,项目名称:PiClock,代码行数:19,代码来源:PyQtPiClock.py

示例3: setupUi

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QLabel [as 别名]
def setupUi(self):
        self.connectLayout = QHBoxLayout(self)
        self.connectLayout.setSizeConstraint(QLayout.SetDefaultConstraint)
        self.avatarLB = QLabel(self)
        sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.avatarLB.sizePolicy().hasHeightForWidth())
        self.avatarLB.setSizePolicy(sizePolicy)
        self.avatarLB.setFixedSize(24, 24)
        self.avatarLB.hide()

        self.nameLB = QLabel(self)
        self.nameLB.setFocusPolicy(Qt.ClickFocus)
        self.nameLB.setTextFormat(Qt.RichText)
        self.nameLB.setText("<html><head/><body><p><span style=\"text-decoration: underline; color:#00557f;\">Add Connection</span></p></body></html>")

        self.setCursor(QCursor(Qt.PointingHandCursor))
        self.connectLayout.addWidget(self.avatarLB)
        self.connectLayout.addWidget(self.nameLB) 
开发者ID:gkudos,项目名称:qgis-cartodb,代码行数:22,代码来源:CartoDBToolbar.py

示例4: __init__

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QLabel [as 别名]
def __init__(self, tableName=None, layer=None, size=None, rows=None):
        CartoDBDatasetsListItem.__init__(self, tableName, None, size, rows)

        '''
        self.ui.statusLB = QLabel(self)
        self.ui.statusLB.setMaximumSize(QSize(100, 16777215))
        self.ui.statusLB.setAlignment(Qt.AlignCenter | Qt.AlignTrailing | Qt.AlignVCenter)
        self.ui.statusLB.setWordWrap(True)
        self.ui.horizontalLayout.insertWidget(1, self.ui.statusLB)
        '''

        self.ui.statusBar = QProgressBar(self)
        self.ui.statusBar.setProperty("value", 0)
        self.ui.statusBar.setFormat("Init")
        self.ui.statusBar.setAutoFillBackground(True)
        self.ui.statusBar.hide()
        self.ui.horizontalLayout.insertWidget(1, self.ui.statusBar)

        self.layer = layer 
开发者ID:gkudos,项目名称:qgis-cartodb,代码行数:21,代码来源:ListItemWidgets.py

示例5: setupUi

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QLabel [as 别名]
def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(400, 300)
        self.gridLayout = QtGui.QGridLayout(Form)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.sizeSpin = QtGui.QSpinBox(Form)
        self.sizeSpin.setProperty("value", 10)
        self.sizeSpin.setObjectName(_fromUtf8("sizeSpin"))
        self.gridLayout.addWidget(self.sizeSpin, 1, 1, 1, 1)
        self.pixelModeCheck = QtGui.QCheckBox(Form)
        self.pixelModeCheck.setObjectName(_fromUtf8("pixelModeCheck"))
        self.gridLayout.addWidget(self.pixelModeCheck, 1, 3, 1, 1)
        self.label = QtGui.QLabel(Form)
        self.label.setObjectName(_fromUtf8("label"))
        self.gridLayout.addWidget(self.label, 1, 0, 1, 1)
        self.plot = PlotWidget(Form)
        self.plot.setObjectName(_fromUtf8("plot"))
        self.gridLayout.addWidget(self.plot, 0, 0, 1, 4)
        self.randCheck = QtGui.QCheckBox(Form)
        self.randCheck.setObjectName(_fromUtf8("randCheck"))
        self.gridLayout.addWidget(self.randCheck, 1, 2, 1, 1)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form) 
开发者ID:SrikanthVelpuri,项目名称:tf-pose,代码行数:26,代码来源:ScatterPlotSpeedTestTemplate_pyqt.py

示例6: setupUi

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QLabel [as 别名]
def setupUi(self, EmoticonDialog):
        EmoticonDialog.setObjectName(_fromUtf8("EmoticonDialog"))
        EmoticonDialog.resize(300, 500)
        self.verticalLayout = QtGui.QVBoxLayout(EmoticonDialog)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.label = QtGui.QLabel(EmoticonDialog)
        self.label.setObjectName(_fromUtf8("label"))
        self.verticalLayout.addWidget(self.label)
        self.uiEmoticonTextEdit = QtGui.QTextEdit(EmoticonDialog)
        self.uiEmoticonTextEdit.setObjectName(_fromUtf8("uiEmoticonTextEdit"))
        self.verticalLayout.addWidget(self.uiEmoticonTextEdit)
        self.buttonBox = QtGui.QDialogButtonBox(EmoticonDialog)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
        self.verticalLayout.addWidget(self.buttonBox)

        self.retranslateUi(EmoticonDialog)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), EmoticonDialog.accept)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), EmoticonDialog.reject)
        QtCore.QMetaObject.connectSlotsByName(EmoticonDialog) 
开发者ID:doctorguile,项目名称:pyqtggpo,代码行数:23,代码来源:customemoticonsdialog_ui.py

示例7: __init__

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QLabel [as 别名]
def __init__(self, ecuscanner):
        super(Ecu_finder, self).__init__()
        self.ecuscanner = ecuscanner
        layoutv = widgets.QVBoxLayout()
        layouth = widgets.QHBoxLayout()
        self.setLayout(layoutv)
        layoutv.addLayout(layouth)
        self.ecuaddr = widgets.QLineEdit()
        self.ecuident = widgets.QLineEdit()
        layouth.addWidget(widgets.QLabel("Addr :"))
        layouth.addWidget(self.ecuaddr)
        layouth.addWidget(widgets.QLabel("ID frame :"))
        layouth.addWidget(self.ecuident)
        button = widgets.QPushButton("VALIDATE")
        layouth.addWidget(button)
        button.clicked.connect(self.check) 
开发者ID:cedricp,项目名称:ddt4all,代码行数:18,代码来源:ddt4all.py

示例8: __init__

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QLabel [as 别名]
def __init__(self, dataitem, parent=None):
        super(otherPanel, self).__init__(parent)
        self.setFrameStyle(widgets.QFrame.Sunken)
        self.setFrameShape(widgets.QFrame.Box)
        self.data = dataitem

        layout = widgets.QGridLayout()
        labelnob = widgets.QLabel(_("Number of bytes"))
        lableunit = widgets.QLabel(_("Unit"))

        layout.addWidget(labelnob, 0, 0)
        layout.addWidget(lableunit, 1, 0)
        layout.setRowStretch(2, 1)

        self.inputnob = widgets.QSpinBox()
        self.inputnob.setRange(1, 10240)
        self.inputtype = widgets.QComboBox()
        self.inputtype.addItem("ASCII")
        self.inputtype.addItem("BCD/HEX")

        layout.addWidget(self.inputnob, 0, 1)
        layout.addWidget(self.inputtype, 1, 1)

        self.setLayout(layout)
        self.init() 
开发者ID:cedricp,项目名称:ddt4all,代码行数:27,代码来源:dataeditor.py

示例9: initUi

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QLabel [as 别名]
def initUi(self):
        """"""
        self.setWindowTitle(u'关于VnTrader')
        
        text = u"""
            quantos trade client
            """
        
        label = QLabel()
        label.setText(text)
        label.setMinimumWidth(500)
        
        vbox = QVBoxLayout()
        vbox.addWidget(label)
        
        self.setLayout(vbox) 
开发者ID:quantOS-org,项目名称:TradeSim,代码行数:18,代码来源:uiMainWindow.py

示例10: warningDialog

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QLabel [as 别名]
def warningDialog(self, parent, title='FPS', msg='Adjusting frame rate,\n please wait...'):
		from cross3d.migrate import Window
		# Tell the user what is going on and that they should wait for it to complete.
		# Because of the this system works it can not block keyboard and mouse input to Max
		# TODO: Re-build this in a generic non-blurdev specific way.
		if Window:
			from PyQt4.QtGui import QLabel
			self.uiWarningWND = Window()
			self.uiWarningWND.setWindowTitle(title)
			x,y,w,h = GetWindowRect(parent)
			self.uiWarningWND.setGeometry(x+15, y+40, 303, 80)
			lbl = QLabel(self.uiWarningWND)
			fnt = lbl.font()
			fnt.setPointSize(20)
			lbl.setGeometry(0,0,300,86)
			lbl.setFont(fnt)
			lbl.setText(msg)
			self.uiWarningWND.show() 
开发者ID:blurstudio,项目名称:cross3d,代码行数:20,代码来源:rescaletime.py

示例11: setupUi

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QLabel [as 别名]
def setupUi(self, Window):
        '''被主窗口调用'''
        Window.setWindowTitle(_fromUtf8("便签"))
        Window.setMinimumWidth(400)
        Window.setMaximumWidth(400)

        '''初始化组件'''
        self.layout = QtGui.QVBoxLayout()
        self.topLabelPix = QtGui.QPixmap(setting.topLabelImgPath)
        self.topLabel = QtGui.QLabel()

        '''设置组件属性'''
        self.layout.setMargin(0)
        self.layout.setSpacing(0)
        self.topLabel.setPixmap(self.topLabelPix)

        '''设置布局'''
        self.layout.addWidget(self.topLabel)

        self.setLayout(self.layout) 
开发者ID:cosven,项目名称:memo,代码行数:22,代码来源:window_ui.py

示例12: registerCmap

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QLabel [as 别名]
def registerCmap(self):
        """ Add matplotlib cmaps to the GradientEditors context menu"""
        self.gradientEditorItem.menu.addSeparator()
        savedLength = self.gradientEditorItem.length
        self.gradientEditorItem.length = 100
        
        
        for name in self.mplColorMaps:
            px = QPixmap(100, 15)
            p = QPainter(px)
            self.gradientEditorItem.restoreState(self.mplColorMaps[name])
            grad = self.gradientEditorItem.getGradient()
            brush = QBrush(grad)
            p.fillRect(QtCore.QRect(0, 0, 100, 15), brush)
            p.end()
            label = QLabel()
            label.setPixmap(px)
            label.setContentsMargins(1, 1, 1, 1)
            act =QWidgetAction(self.gradientEditorItem)
            act.setDefaultWidget(label)
            act.triggered.connect(self.cmapClicked)
            act.name = name
            self.gradientEditorItem.menu.addAction(act)
        self.gradientEditorItem.length = savedLength 
开发者ID:qkitgroup,项目名称:qkit,代码行数:26,代码来源:PlotWindow.py

示例13: _addIndicatorLabels

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QLabel [as 别名]
def _addIndicatorLabels(self,Form,sizePolicy,indicators=[]):
        self.IndicatorLayout = QtGui.QVBoxLayout()
        self.IndicatorLayout.setSizeConstraint(QtGui.QLayout.SetMinimumSize)
        self.IndicatorLayout.setObjectName(_fromUtf8("horizontalLayout"))

        self.IndicatorLayout.setContentsMargins(0,0,0,0)
        self.IndicatorLayout.setContentsMargins(QtCore.QMargins(0,0,0,0))
        self.IndicatorLayout.setSpacing(3)
        
        for indicator in indicators:
            setattr(self,indicator,QtGui.QLabel(Form))
            temp_indicator = getattr(self,indicator)
            temp_indicator.setSizePolicy(sizePolicy)
            temp_indicator.setObjectName(_fromUtf8(indicator))
            self.IndicatorLayout.addWidget(temp_indicator)
            
        self.horizontalLayout.addLayout(self.IndicatorLayout,stretch = -10) 
开发者ID:qkitgroup,项目名称:qkit,代码行数:19,代码来源:plot_view.py

示例14: __init__

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QLabel [as 别名]
def __init__(self, text='', imagePath='', size=None, parent=None):
        super(AssetItem, self).__init__(parent=parent)

        self.layout = QtGui.QVBoxLayout(self)
        self.button = QtGui.QPushButton()
        self.text   = QtGui.QLabel()
        self.layout.addWidget(self.button)
        self.layout.addWidget(self.text)

        if text:
            self.setText(text)
        
        if imagePath:
            self.setImage(imagePath)

        if size:
            self.setSize(size)
        else:
            set.setSize(64, 64) 
开发者ID:justinfx,项目名称:tutorials,代码行数:21,代码来源:assetImporterWin.py

示例15: __init__

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QLabel [as 别名]
def __init__(self, app):
        FlatCAMTool.__init__(self, app)

        # self.setContentsMargins(0, 0, 0, 0)
        self.layout.setMargin(0)
        self.layout.setContentsMargins(0, 0, 3, 0)

        self.setSizePolicy(QtGui.QSizePolicy.Ignored, QtGui.QSizePolicy.Maximum)

        self.point1 = None
        self.point2 = None
        self.label = QtGui.QLabel("Click on a reference point ...")
        self.label.setFrameStyle(QtGui.QFrame.StyledPanel | QtGui.QFrame.Plain)
        self.label.setMargin(3)
        self.layout.addWidget(self.label)
        # self.layout.setMargin(0)
        self.setVisible(False)

        self.click_subscription = None
        self.move_subscription = None 
开发者ID:Denvi,项目名称:FlatCAM,代码行数:22,代码来源:MeasurementTool.py


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