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


Python Qt.QLabel方法代码示例

本文整理汇总了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) 
开发者ID:ggventurini,项目名称:dualscope123,代码行数:18,代码来源:main.py

示例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) 
开发者ID:NSchrading,项目名称:redditDataExtractor,代码行数:31,代码来源:downloadedContentGUI.py

示例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) 
开发者ID:mazaclub,项目名称:encompass,代码行数:14,代码来源:btchipwallet.py

示例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: 
开发者ID:mazaclub,项目名称:encompass,代码行数:38,代码来源:trezor.py

示例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()) 
开发者ID:mazaclub,项目名称:encompass,代码行数:17,代码来源:trezor.py

示例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) 
开发者ID:mazaclub,项目名称:encompass,代码行数:14,代码来源:trezor.py

示例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_() 
开发者ID:Lithium876,项目名称:ConTroll_Remote_Access_Trojan,代码行数:14,代码来源:test_pyqt4.py


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