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


Python QtWidgets.QLineEdit方法代码示例

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


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

示例1: __init__

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLineEdit [as 别名]
def __init__(self, setting_params=None):
        super().__init__()
        self.setting_params = setting_params
        self.search_input = Qw.QLineEdit()
        self.table = AngryTableView(self.setting_params['angrysearch_lite'],
                                    self.setting_params['row_height'])
        self.upd_button = Qw.QPushButton('update')
        self.fts_checkbox = Qw.QCheckBox()

        grid = Qw.QGridLayout()
        grid.setSpacing(10)

        grid.addWidget(self.search_input, 1, 1)
        grid.addWidget(self.fts_checkbox, 1, 3)
        grid.addWidget(self.upd_button, 1, 4)
        grid.addWidget(self.table, 2, 1, 4, 4)
        self.setLayout(grid)

        self.setTabOrder(self.search_input, self.table)
        self.setTabOrder(self.table, self.upd_button)


# THE MAIN APPLICATION WINDOW WITH THE STATUS BAR AND LOGIC
# LOADS AND SAVES QSETTINGS FROM ~/.config/angrysearch
# INITIALIZES AND SETS GUI, WAITING FOR USER INPUTS 
开发者ID:DoTheEvo,项目名称:ANGRYsearch,代码行数:27,代码来源:angrysearch.py

示例2: __init__

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLineEdit [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

示例3: __init__

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLineEdit [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

示例4: exclude_dialog

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLineEdit [as 别名]
def exclude_dialog(self):
        text, ok = Qw.QInputDialog.getText(
            self, '~/.config/angrysearch/', 'Directories to be ignored:',
            Qw.QLineEdit.Normal, self.exclud_dirs)
        if ok:
            text = text.strip()
            self.exclud_dirs = text
            self.settings.setValue('directories_excluded', text)
            self.parent().setting_params['directories_excluded'] = text.strip().split()
            if text == '':
                self.excluded_dirs_btn.setText('none')
                self.excluded_dirs_btn.setStyleSheet('color:#888;'
                                                     'font:italic;')
            else:
                self.excluded_dirs_btn.setText(text)
                self.excluded_dirs_btn.setStyleSheet('')
            self.OK_button.setFocus() 
开发者ID:DoTheEvo,项目名称:ANGRYsearch,代码行数:19,代码来源:angrysearch.py

示例5: __init__

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLineEdit [as 别名]
def __init__(self, items, parent=None):
        super(ButtonLineEdit, self).__init__(parent)

        self.menu = QtWidgets.QMenu()
        for i in items:
          self.menu.addAction(i)

        self.button = QtWidgets.QToolButton(self)
        self.button.setStyleSheet('border: 0px; padding: 0px;')
        self.button.setCursor(QtCore.Qt.ArrowCursor)
        self.button.triggered.connect(self.menu_action_triggered)
        self.button.setPopupMode(QtWidgets.QToolButton.InstantPopup)
        self.button.setMenu(self.menu)

        frameWidth = self.style().pixelMetric(QtWidgets.QStyle.PM_DefaultFrameWidth)
        buttonSize = self.button.sizeHint()

        self.setAlignment(QtCore.Qt.Alignment(QtCore.Qt.AlignHCenter))
        self.setStyleSheet('QLineEdit {padding-right: %dpx; }' % (buttonSize.width() + frameWidth + 1))
        self.setMinimumSize(max(self.minimumSizeHint().width(), buttonSize.width() + frameWidth*2 + 2),
                            max(self.minimumSizeHint().height(), buttonSize.height() + frameWidth*2 + 2))
        self.setMaximumWidth(100) 
开发者ID:RobinDavid,项目名称:idasec,代码行数:24,代码来源:custom_widgets.py

示例6: __init__

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLineEdit [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

示例7: __init__

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLineEdit [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

示例8: initUI

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLineEdit [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 QLineEdit [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 QLineEdit [as 别名]
def __init__(self, parent):
        self.parent = parent
        self.parentTab = self.parent.parent

        self.searchThread = BackGroundTextSearch()
        self.searchOptionsLayout = QtWidgets.QHBoxLayout()
        self.searchTabLayout = QtWidgets.QVBoxLayout()
        self.searchTimer = QtCore.QTimer(self.parent)
        self.searchLineEdit = QtWidgets.QLineEdit(self.parent)
        self.searchBookButton = QtWidgets.QToolButton(self.parent)
        self.caseSensitiveSearchButton = QtWidgets.QToolButton(self.parent)
        self.matchWholeWordButton = QtWidgets.QToolButton(self.parent)
        self.searchResultsTreeView = QtWidgets.QTreeView(self.parent)

        self._translate = QtCore.QCoreApplication.translate
        self.search_string = self._translate('SideDock', 'Search')
        self.search_book_string = self._translate('SideDock', 'Search entire book')
        self.case_sensitive_string = self._translate('SideDock', 'Match case')
        self.match_word_string = self._translate('SideDock', 'Match word')

        self.create_widgets() 
开发者ID:BasioMeusPuga,项目名称:Lector,代码行数:23,代码来源:dockwidgets.py

示例11: __init__

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLineEdit [as 别名]
def __init__(self, name, parent=None):
        super(Chatter, self).__init__(parent)
        self.name = name

        self.text_panel = QtWidgets.QTextEdit()
        self.text_panel.setReadOnly(True)
        self.input = QtWidgets.QLineEdit()

        layout = QtWidgets.QVBoxLayout()
        layout.addWidget(self.text_panel, 3)
        layout.addWidget(self.input, 1)

        self.setLayout(layout)
        self.setWindowTitle("Chatter")

        self.input.editingFinished.connect(self.input_changed)
        self.input.setFocus()

        self.chattery = nw0.discover("chattery/news")
        self.responder = FeedbackReader(self.chattery)
        self.responder.message_received.connect(self.handle_response)
        self.responder.start() 
开发者ID:tjguk,项目名称:networkzero,代码行数:24,代码来源:chatter.py

示例12: _initUi

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLineEdit [as 别名]
def _initUi(self, title, label, default):
        self.setWindowTitle(title)
 
        # 控件
        label_ = QLabel(label)
        self._lineEdit = QLineEdit(str(self._data['data']) if self._data else str(default) )

        cancelPushButton = QPushButton('Cancel')
        okPushButton = QPushButton('OK')
        cancelPushButton.clicked.connect(self._cancel)
        okPushButton.clicked.connect(self._ok)

        # 布局
        grid = QGridLayout()
        grid.setSpacing(10)
 
        grid.addWidget(label_, 0, 0, 1, 2)
        grid.addWidget(self._lineEdit, 0, 2, 1, 2)

        grid.addWidget(okPushButton, 1, 2, 1, 2)
        grid.addWidget(cancelPushButton, 1, 0, 1, 2)
 
 
        self.setLayout(grid) 
开发者ID:moyuanz,项目名称:DevilYuan,代码行数:26,代码来源:DySingleEditDlg.py

示例13: _initUi

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLineEdit [as 别名]
def _initUi(self):
        self.setWindowTitle('进程数')
 
        # 控件
        processNbrLable = QLabel('进程数')
        self._processNbrLineEdit = QLineEdit(str(self._data['nbr']) if self._data else '0' )

        cancelPushButton = QPushButton('Cancel')
        okPushButton = QPushButton('OK')
        cancelPushButton.clicked.connect(self._cancel)
        okPushButton.clicked.connect(self._ok)

        # 布局
        grid = QGridLayout()
        grid.setSpacing(10)
 
        grid.addWidget(processNbrLable, 0, 0)
        grid.addWidget(self._processNbrLineEdit, 1, 0, 1, 2)

        grid.addWidget(okPushButton, 2, 1)
        grid.addWidget(cancelPushButton, 2, 0)
 
 
        self.setLayout(grid) 
开发者ID:moyuanz,项目名称:DevilYuan,代码行数:26,代码来源:DyProcessNbrDlg.py

示例14: _initUi

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLineEdit [as 别名]
def _initUi(self):
        self.setWindowTitle('日K线前后交易日周期')
 
        # 控件
        dayKChartPeriodLable = QLabel('股票(指数)日K线前后交易日周期')
        self._dayKChartPeriodLineEdit = QLineEdit(str(self._data['periodNbr']) if self._data else '60' )

        cancelPushButton = QPushButton('Cancel')
        okPushButton = QPushButton('OK')
        cancelPushButton.clicked.connect(self._cancel)
        okPushButton.clicked.connect(self._ok)

        # 布局
        grid = QGridLayout()
        grid.setSpacing(10)
 
        grid.addWidget(dayKChartPeriodLable, 0, 0, 1, 2)
        grid.addWidget(self._dayKChartPeriodLineEdit, 1, 0, 1, 2)

        grid.addWidget(okPushButton, 2, 1)
        grid.addWidget(cancelPushButton, 2, 0)
 
 
        self.setLayout(grid) 
开发者ID:moyuanz,项目名称:DevilYuan,代码行数:26,代码来源:DyStockSelectDayKChartPeriodDlg.py

示例15: _createConnectionTab

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QLineEdit [as 别名]
def _createConnectionTab(self, tabWidget):
        widget = QWidget()

        labelHost = QLabel('主机')
        labelPort = QLabel('端口')

        self._lineEditHost = QLineEdit(self._data['Connection']["Host"])
        self._lineEditPort = QLineEdit(str(self._data['Connection']["Port"]))

        # 布局
        grid = QGridLayout()
        grid.setSpacing(10)
 
        grid.addWidget(labelHost, 0, 0)
        grid.addWidget(self._lineEditHost, 0, 1)

        grid.addWidget(labelPort, 0, 2)
        grid.addWidget(self._lineEditPort, 0, 3)
 
        widget.setLayout(grid)

        tabWidget.addTab(widget, "连接") 
开发者ID:moyuanz,项目名称:DevilYuan,代码行数:24,代码来源:DyStockMongoDbConfigDlg.py


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