本文整理汇总了Python中PyQt4.Qt.QLabel方法的典型用法代码示例。如果您正苦于以下问题:Python Qt.QLabel方法的具体用法?Python Qt.QLabel怎么用?Python Qt.QLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.Qt
的用法示例。
在下文中一共展示了Qt.QLabel方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt4 import Qt [as 别名]
# 或者: from PyQt4.Qt import QLabel [as 别名]
def __init__(self, wgt, x, y, name, logscale=0):
if logscale:
self.knob = LogKnob(wgt)
else:
self.knob = Qwt.QwtKnob(wgt)
color = Qt.QColor(200, 200, 210)
self.knob.palette().setColor(Qt.QPalette.Active,
Qt.QPalette.Button,
color)
self.lbl = Qt.QLabel(name, wgt)
self.knob.setGeometry(x, y, 140, 100)
# oooh, eliminate this ...
if name[0] == 'o':
self.knob.setKnobWidth(40)
self.lbl.setGeometry(x, y+90, 140, 15)
self.lbl.setAlignment(Qt.Qt.AlignCenter)
示例2: _addToTab
# 需要导入模块: from PyQt4 import Qt [as 别名]
# 或者: from PyQt4.Qt import QLabel [as 别名]
def _addToTab(self, submission, submissionURL, lst):
"""
Add a submission and its representative image to the lst under its tab.
:type submission: praw.objects.Submission
:type submissionURL: str
:type lst: QListWidget
"""
imagePath = submission.representativeImage
if imagePath is not None and imagePath.exists():
item = QListWidgetItem(submissionURL, lst)
item.setTextColor(Qt.transparent)
labelWidget = QLabel()
labelWidget.setOpenExternalLinks(True)
labelWidget.setTextFormat(Qt.RichText)
size = QSize(128, 158)
item.setSizeHint(size)
size = QSize(128, 128)
if imagePath.suffix == ".webm":
imagePath = pathlib.Path("RedditDataExtractor", "images", "videoImage.png").resolve()
pixmap = QPixmap(str(imagePath))
pixmap = pixmap.scaled(size, Qt.KeepAspectRatio)
height = pixmap.height()
width = pixmap.width()
submissionTitle = submissionURL[submissionURL[0:-1].rfind("/") + 1:-1]
labelWidget.setText(
'<a href="' + submissionURL + '"><img src="' + str(imagePath) + '" height="' + str(
height) + '" width="' + str(width) + '"><p>' + submissionTitle)
lst.setItemWidget(item, labelWidget)
示例3: start
# 需要导入模块: from PyQt4 import Qt [as 别名]
# 或者: from PyQt4.Qt import QLabel [as 别名]
def start(self, message):
self.d = QDialog()
self.d.setModal(1)
self.d.setWindowTitle('Please Wait')
self.d.setWindowFlags(self.d.windowFlags() | QtCore.Qt.WindowStaysOnTopHint)
l = QLabel(message)
vbox = QVBoxLayout(self.d)
vbox.addWidget(l)
self.d.show()
if not self.waiting:
self.waiting = True
self.d.connect(waitDialog, SIGNAL('dongle_done'), self.stop)
示例4: settings_dialog
# 需要导入模块: from PyQt4 import Qt [as 别名]
# 或者: from PyQt4.Qt import QLabel [as 别名]
def settings_dialog(self):
get_label = lambda: self.wallet.get_client().features.label
update_label = lambda: current_label_label.setText("Label: %s" % get_label())
d = QDialog()
layout = QGridLayout(d)
layout.addWidget(QLabel("Trezor Options"),0,0)
layout.addWidget(QLabel("ID:"),1,0)
layout.addWidget(QLabel(" %s" % self.wallet.get_client().get_device_id()),1,1)
def modify_label():
response = QInputDialog().getText(None, "Set New Trezor Label", "New Trezor Label: (upon submission confirm on Trezor)")
if not response[1]:
return
new_label = str(response[0])
twd.start("Please confirm label change on Trezor")
status = self.wallet.get_client().apply_settings(label=new_label)
twd.stop()
update_label()
current_label_label = QLabel()
update_label()
change_label_button = QPushButton("Modify")
change_label_button.clicked.connect(modify_label)
layout.addWidget(current_label_label,3,0)
layout.addWidget(change_label_button,3,1)
def remove_pin():
# twd.start("Please confirm pin removal on Trezor")
try:
status = self.wallet.get_client().change_pin(True)
print_error(status)
self.show_message(status)
except Exception, e:
give_error(e)
finally:
示例5: pin_dialog
# 需要导入模块: from PyQt4 import Qt [as 别名]
# 或者: from PyQt4.Qt import QLabel [as 别名]
def pin_dialog(self, msg):
d = QDialog(None)
d.setModal(1)
d.setWindowTitle(_("Enter PIN"))
d.setWindowFlags(d.windowFlags() | QtCore.Qt.WindowStaysOnTopHint)
matrix = PinMatrixWidget()
vbox = QVBoxLayout()
vbox.addWidget(QLabel(msg))
vbox.addWidget(matrix)
vbox.addLayout(ok_cancel_buttons(d))
d.setLayout(vbox)
if not d.exec_(): return
return str(matrix.get_value())
示例6: start
# 需要导入模块: from PyQt4 import Qt [as 别名]
# 或者: from PyQt4.Qt import QLabel [as 别名]
def start(self, message):
self.d = QDialog()
self.d.setModal(1)
self.d.setWindowTitle('Please Check Trezor Device')
self.d.setWindowFlags(self.d.windowFlags() | QtCore.Qt.WindowStaysOnTopHint)
l = QLabel(message)
vbox = QVBoxLayout(self.d)
vbox.addWidget(l)
self.d.show()
if not self.waiting:
self.waiting = True
self.d.connect(twd, SIGNAL('trezor_done'), self.stop)
示例7: main
# 需要导入模块: from PyQt4 import Qt [as 别名]
# 或者: from PyQt4.Qt import QLabel [as 别名]
def main():
app = Qt.QApplication(sys.argv)
read_formats = ', '.join([unicode(format).lower() \
for format in QtGui.QImageReader.supportedImageFormats()])
print("Qt4 plugin paths: " + unicode(list(app.libraryPaths())))
print("Qt4 image read support: " + read_formats)
print('Qt4 Libraries path: ' + unicode(QtCore.QLibraryInfo.location(QtCore.QLibraryInfo.LibrariesPath)))
label = Qt.QLabel("Hello World from PyQt4", None)
label.setWindowTitle("Hello World from PyQt4")
label.resize(300, 300)
label.show()
app.exec_()