當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。