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


Python QtWidgets.QLabel方法代码示例

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


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

示例1: __init__

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLabel [as 别名]
def __init__(self, parent=None, win=None, session=None):
        super(ResourcesWindow, self).__init__(parent)
        self.mainwin = win
        self.session = session
        self.title = "Resources"

        self.filterPatternLineEdit = QtWidgets.QLineEdit()
        self.filterPatternLabel = QtWidgets.QLabel("&Filter resource integer pattern:")
        self.filterPatternLabel.setBuddy(self.filterPatternLineEdit)
        self.filterPatternLineEdit.textChanged.connect(self.filterRegExpChanged)

        self.resourceswindow = ResourcesValueWindow(self, win, session)

        sourceLayout = QtWidgets.QVBoxLayout()
        sourceLayout.addWidget(self.resourceswindow)
        sourceLayout.addWidget(self.filterPatternLabel)
        sourceLayout.addWidget(self.filterPatternLineEdit)

        self.setLayout(sourceLayout) 
开发者ID:amimo,项目名称:dcc,代码行数:21,代码来源:resourceswindow.py

示例2: setRowValues

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLabel [as 别名]
def setRowValues(self):
        self.conds_dict = {}
        self.cond_values = []
        self.cond_names = []
        i = 0
        j = 0
        for i,cnd in enumerate(self.simulist.cond):
            if cnd.name != '' and cnd.value is not None:
                self.condTable.insertRow(j)
                self.conds_dict[j] = i
                self.condTable.setCellWidget(j, 0, QtWidgets.QLabel(cnd.name))
                ##Setting up spin box for conduictivity
                self.cond_values.append(QtWidgets.QDoubleSpinBox())
                self.cond_values[-1].setSuffix(" S/m")
                self.cond_values[-1].setSingleStep(0.01)
                self.cond_values[-1].setDecimals(3)
                self.cond_values[-1].setValue(cnd.value)
                self.cond_values[-1].setMinimum(1e-5)
                self.condTable.setCellWidget(j, 1, self.cond_values[-1])
                j += 1 
开发者ID:simnibs,项目名称:simnibs,代码行数:22,代码来源:main_gui.py

示例3: __init__

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLabel [as 别名]
def __init__(self):
            super().__init__()
            button_box = QtWidgets.QDialogButtonBox(
            QtWidgets.QDialogButtonBox.Ok|QtWidgets.QDialogButtonBox.Cancel)
            button_box.accepted.connect(self.accept)
            button_box.rejected.connect(self.reject)
            mainLayout = QtWidgets.QVBoxLayout()
            mainLayout.addWidget(
                QtWidgets.QLabel(
                    f'SimNIBS version {__version__} will be uninstalled. '
                    'Are you sure?'))
            mainLayout.addWidget(button_box)
            self.setLayout(mainLayout)
            self.setWindowTitle('SimNIBS Uninstaller')
            gui_icon = os.path.join(SIMNIBSDIR,'resources', 'gui_icon.ico')
            self.setWindowIcon(QtGui.QIcon(gui_icon)) 
开发者ID:simnibs,项目名称:simnibs,代码行数:18,代码来源:postinstall_simnibs.py

示例4: __init__

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLabel [as 别名]
def __init__(self, parent=None, win=None, session=None):
        super(StringsWindow, self).__init__(parent)
        self.mainwin = win
        self.session = session
        self.title = "Strings"

        self.filterPatternLineEdit = QtWidgets.QLineEdit()
        self.filterPatternLabel = QtWidgets.QLabel("&Filter string pattern:")
        self.filterPatternLabel.setBuddy(self.filterPatternLineEdit)
        self.filterPatternLineEdit.textChanged.connect(self.filterRegExpChanged)

        self.stringswindow = StringsValueWindow(self, win, session)

        sourceLayout = QtWidgets.QVBoxLayout()
        sourceLayout.addWidget(self.stringswindow)
        sourceLayout.addWidget(self.filterPatternLabel)
        sourceLayout.addWidget(self.filterPatternLineEdit)

        self.setLayout(sourceLayout) 
开发者ID:amimo,项目名称:dcc,代码行数:21,代码来源:stringswindow.py

示例5: __init__

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLabel [as 别名]
def __init__(self, parent=None, win=None, element="", info=()):
        super(RenameDialog, self).__init__(parent)

        self.sourceWin = parent
        self.info = info
        self.element = element
        title = "Rename: " + element
        self.setWindowTitle(title)

        layout = QtWidgets.QGridLayout()
        question = QtWidgets.QLabel("Please enter new name:")
        layout.addWidget(question, 0, 0)
        self.lineEdit = QtWidgets.QLineEdit()
        layout.addWidget(self.lineEdit, 0, 1)
        self.buttonOK = QtWidgets.QPushButton("OK", self)
        layout.addWidget(self.buttonOK, 1, 1)
        self.buttonCancel = QtWidgets.QPushButton("Cancel", self)
        layout.addWidget(self.buttonCancel, 1, 0)

        self.lineEdit.setText(self.element)

        self.setLayout(layout)

        self.buttonCancel.clicked.connect(self.cancelClicked)
        self.buttonOK.clicked.connect(self.okClicked) 
开发者ID:amimo,项目名称:dcc,代码行数:27,代码来源:renamewindow.py

示例6: __init__

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLabel [as 别名]
def __init__(self, parent=None, win=None, session=None):
        super(MethodsWindow, self).__init__(parent)
        self.mainwin = win
        self.session = session
        self.title = "Methods"

        self.filterPatternLineEdit = QtWidgets.QLineEdit()
        self.filterPatternLabel = QtWidgets.QLabel("&Filter method name pattern:")
        self.filterPatternLabel.setBuddy(self.filterPatternLineEdit)
        self.filterPatternLineEdit.textChanged.connect(self.filterRegExpChanged)

        self.methodswindow = MethodsValueWindow(self, win, session)

        sourceLayout = QtWidgets.QVBoxLayout()
        sourceLayout.addWidget(self.methodswindow)
        sourceLayout.addWidget(self.filterPatternLabel)
        sourceLayout.addWidget(self.filterPatternLineEdit)

        self.setLayout(sourceLayout) 
开发者ID:amimo,项目名称:dcc,代码行数:21,代码来源:methodswindow.py

示例7: __init__

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLabel [as 别名]
def __init__(self, title="Calendar"):
        super(CalendarWidget, self).__init__()

        self.setWindowTitle(title)
        layout = qt_widgets.QGridLayout()
        layout.setColumnStretch(1, 1)

        self.cal = qt_widgets.QCalendarWidget(self)
        self.cal.setGridVisible(True)
        self.cal.clicked[QtCore.QDate].connect(self.show_date)
        layout.addWidget(self.cal, 0, 0, 1, 2)

        self.date_label = qt_widgets.QLabel()
        self.date = self.cal.selectedDate()
        self.date_label.setText(self.date.toString())
        layout.addWidget(self.date_label, 1, 0)

        button_box = qt_widgets.QDialogButtonBox()
        confirm_button = button_box.addButton(qt_widgets.QDialogButtonBox.Ok)
        confirm_button.clicked.connect(self.confirm)
        layout.addWidget(button_box, 1, 1)

        self.setLayout(layout)
        self.show()
        self.raise_() 
开发者ID:aroberge,项目名称:easygui_qt,代码行数:27,代码来源:calendar_widget.py

示例8: initUI

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLabel [as 别名]
def initUI(self):
        self.inputLabel = QLabel("Input your text")
        self.editLine = QLineEdit()
        self.printButton = QPushButton("Print")
        self.clearButton = QPushButton("Clear")

        self.printButton.clicked.connect(self.printText)
        self.clearButton.clicked.connect(self.clearText)

        inputLayout = QHBoxLayout()
        inputLayout.addWidget(self.inputLabel)
        inputLayout.addWidget(self.editLine)

        buttonLayout = QHBoxLayout()
        buttonLayout.addWidget(self.printButton)
        buttonLayout.addWidget(self.clearButton)

        mainLayout = QVBoxLayout()
        mainLayout.addLayout(inputLayout)
        mainLayout.addLayout(buttonLayout)

        self.setLayout(mainLayout)
        self.setWindowTitle('FristWindow')
        self.show() 
开发者ID:makelove,项目名称:Python_Master_Courses,代码行数:26,代码来源:input_button_clear.py

示例9: setupUi

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLabel [as 别名]
def setupUi(self, ScoreWindow):
        ScoreWindow.setObjectName("ScoreWindow")
        ScoreWindow.resize(471, 386)
        self.centralwidget = QtWidgets.QWidget(ScoreWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.Score = QtWidgets.QLineEdit(self.centralwidget)
        self.Score.setGeometry(QtCore.QRect(180, 180, 113, 22))
        self.Score.setObjectName("Score")
        self.teamscore = QtWidgets.QLabel(self.centralwidget)
        self.teamscore.setGeometry(QtCore.QRect(180, 130, 151, 20))
        font = QtGui.QFont()
        font.setBold(True)
        font.setWeight(75)
        self.teamscore.setFont(font)
        self.teamscore.setObjectName("teamscore")
        ScoreWindow.setCentralWidget(self.centralwidget)
        self.statusbar = QtWidgets.QStatusBar(ScoreWindow)
        self.statusbar.setObjectName("statusbar")
        ScoreWindow.setStatusBar(self.statusbar)

        self.retranslateUi(ScoreWindow)
        QtCore.QMetaObject.connectSlotsByName(ScoreWindow) 
开发者ID:arpitj07,项目名称:Python-GUI,代码行数:24,代码来源:scorewidnow.py

示例10: __init__

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLabel [as 别名]
def __init__(self, i_description_str, i_parent = None):
        super(SafeDeleteDialog, self).__init__(i_parent)

        vbox = QtWidgets.QVBoxLayout(self)

        self.description_qll = QtWidgets.QLabel(i_description_str)
        vbox.addWidget(self.description_qll)

        self.button_box = QtWidgets.QDialogButtonBox(
            QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel,
            QtCore.Qt.Horizontal,
            self
        )
        vbox.addWidget(self.button_box)
        self.button_box.accepted.connect(self.accept)
        self.button_box.rejected.connect(self.reject)
        # -accept and reject are "slots" built into Qt 
开发者ID:mindfulness-at-the-computer,项目名称:mindfulness-at-the-computer,代码行数:19,代码来源:experimental_list_widget.py

示例11: __init__

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLabel [as 别名]
def __init__(self, i_description_str: str, i_parent=None) -> None:
        super(SafeDeleteDlg, self).__init__(i_parent)

        vbox = QtWidgets.QVBoxLayout(self)

        self.description_qll = QtWidgets.QLabel(i_description_str)
        vbox.addWidget(self.description_qll)

        self.button_box = QtWidgets.QDialogButtonBox(
            QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel,
            QtCore.Qt.Horizontal,
            self
        )
        vbox.addWidget(self.button_box)
        self.button_box.accepted.connect(self.accept)
        self.button_box.rejected.connect(self.reject)
        # -accept and reject are "slots" built into Qt 
开发者ID:mindfulness-at-the-computer,项目名称:mindfulness-at-the-computer,代码行数:19,代码来源:safe_delete_dlg.py

示例12: _init_ui

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLabel [as 别名]
def _init_ui(self):
        title_qll = QtWidgets.QLabel("Welcome")
        title_qll.setFont(mc.mc_global.get_font_xxlarge(i_bold=True))

        text_qll = QtWidgets.QLabel(
            "<p>Welcome to Mindfulness at the Computer!</p>"
            "<p>This application reminds you to stay aware of your breathing and to take breaks.</p>"
        )
        text_qll.setWordWrap(True)
        text_qll.setFont(mc.mc_global.get_font_xlarge())

        vbox_l2 = QtWidgets.QVBoxLayout()
        vbox_l2.addSpacing(MARGIN_TOP_INT)
        vbox_l2.addWidget(title_qll)
        vbox_l2.addStretch(1)
        vbox_l2.addWidget(text_qll)
        vbox_l2.addSpacing(PARAGRAPH_SPACING_INT)
        vbox_l2.addStretch(1)

        self.setLayout(vbox_l2) 
开发者ID:mindfulness-at-the-computer,项目名称:mindfulness-at-the-computer,代码行数:22,代码来源:intro_dlg.py

示例13: __init__

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLabel [as 别名]
def __init__(self, i_description_str: str, i_parent=None) -> None:
        super(WarningDlg, self).__init__(i_parent)

        vbox = QtWidgets.QVBoxLayout(self)

        self.description_qll = QtWidgets.QLabel(i_description_str)
        vbox.addWidget(self.description_qll)

        self.button_box = QtWidgets.QDialogButtonBox(
            QtWidgets.QDialogButtonBox.Ok ,
            QtCore.Qt.Horizontal,
            self
        )
        vbox.addWidget(self.button_box)
        self.button_box.accepted.connect(self.accept)
        # -accept and reject are "slots" built into Qt 
开发者ID:mindfulness-at-the-computer,项目名称:mindfulness-at-the-computer,代码行数:18,代码来源:warning_dlg.py

示例14: __init__

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLabel [as 别名]
def __init__(self, parent=None):
        super().__init__(parent)
        self.textQVBoxLayout = QtWidgets.QVBoxLayout()
        self.textUpQLabel = QtWidgets.QLabel()
        self.textDownQLabel = QtWidgets.QLabel()
        self.textQVBoxLayout.addWidget(self.textUpQLabel)
        self.textQVBoxLayout.addWidget(self.textDownQLabel)
        self.allQHBoxLayout = QtWidgets.QHBoxLayout()
        self.allQHBoxLayout.addLayout(self.textQVBoxLayout, 1)
        self.setLayout(self.allQHBoxLayout)
        self.textUpQLabel.setStyleSheet('''
        color: black;
        ''')
        self.textDownQLabel.setStyleSheet('''
        color: black;
        ''') 
开发者ID:aerospaceresearch,项目名称:visma,代码行数:18,代码来源:window.py

示例15: view_configuration_info

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLabel [as 别名]
def view_configuration_info(self):
        self.thread_stop = True
        container = QtWidgets.QVBoxLayout()

        label = QtWidgets.QLabel('Configuration Information')
        label.setStyleSheet('font: 18px;')
        container.addWidget(label)

        layout = QtWidgets.QHBoxLayout()
        self.message = QtWidgets.QLabel()
        layout.addWidget(self.message)
        layout.addStretch()
        save_button = QtWidgets.QPushButton('Save')
        layout.addWidget(save_button)

        scroll_layout = FIRSTUI.ScrollWidget(frame=QtWidgets.QFrame.NoFrame)
        FIRSTUI.SharedObjects.server_config_layout(self, scroll_layout, FIRST.config)

        container.addWidget(scroll_layout)
        container.addStretch()
        container.addLayout(layout)

        save_button.clicked.connect(self.save_config)

        return container 
开发者ID:vrtadmin,项目名称:FIRST-plugin-ida,代码行数:27,代码来源:first.py


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