本文整理匯總了Python中PyQt5.QtWidgets.QLineEdit.move方法的典型用法代碼示例。如果您正苦於以下問題:Python QLineEdit.move方法的具體用法?Python QLineEdit.move怎麽用?Python QLineEdit.move使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PyQt5.QtWidgets.QLineEdit
的用法示例。
在下文中一共展示了QLineEdit.move方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: initUI0
# 需要導入模塊: from PyQt5.QtWidgets import QLineEdit [as 別名]
# 或者: from PyQt5.QtWidgets.QLineEdit import move [as 別名]
def initUI0(self):
self.f = open('names.txt')
self.lines = [line.rstrip('\n') for line in self.f]
self.j =0
self.i = 1
self.c = Communicate()
self.c.updateBW.connect(self.updateUi)
self.lbl = QLabel(self)
le = QLineEdit(self)
le.move(130, 22)
text, ok = QInputDialog.getText(self, 'Input Dialog',
'Enter your name:')
if ok:
le.setText(str(text))
self.myfile = """/home/an/pyqt/%(data)s.txt"""%{'data':text}
self.file = open(self.myfile, 'a')
self.file.write('\n')
d = datetime.today()
self.file.write(str(d.strftime('%y-%m-%d %H:%M:%S')))
self.file.write('\n')
le.close()
示例2: MainWindow
# 需要導入模塊: from PyQt5.QtWidgets import QLineEdit [as 別名]
# 或者: from PyQt5.QtWidgets.QLineEdit import move [as 別名]
class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
self.statusBar().showMessage('ready')
self.filename = QLabel(self)
self.filename.setText('filename')
self.filename.move(20, 20)
self.filename_edit = QLineEdit(self)
self.filename_edit.move(80, 20)
self.keywords = QLabel(self)
self.keywords.setText('keyword')
self.keywords.move(20, 60)
self.keywords_edit = QLineEdit(self)
self.keywords_edit.move(80, 60)
self.button = QPushButton('search', self)
self.button.move(20, 100)
self.button.clicked.connect(self.search_keywords)
self.setWindowModality(QtCore.Qt.ApplicationModal)
self.setMaximumSize(300, 200)
self.setMinimumSize(300, 200)
self.setGeometry(300, 300, 300, 220)
self.setWindowTitle('kws kaldi')
self.error_message = QLabel(self)
self.result = QLabel(self)
def search_keywords(self):
filename_text = self.filename_edit.text()
keywords_text = self.keywords_edit.text()
if filename_text == '':
self.statusBar().showMessage('filename is empty!')
return
if not os.path.isfile(filename_text):
self.statusBar().showMessage('incorrect filename!')
return
if keywords_text == '':
self.statusBar().showMessage('keyword is empty!')
return
self.statusBar().showMessage('processing')
process = subprocess.Popen('GST_PLUGIN_PATH=. ./transcribe-audio_TED.sh ' + str(filename_text),
stdout=subprocess.PIPE, shell=True)
out, err = process.communicate()
print(out.decode("utf-8"))
if keywords_text in out.decode("utf-8"):
self.result.setText('"' + keywords_text + '"' + ' is in speech')
self.result.adjustSize()
else:
self.result.setText('"' + keywords_text + '"' + ' is not in speech')
self.result.adjustSize()
self.result.move(20, 140)
print(self.filename_edit.text())
self.statusBar().showMessage('ready')
示例3: initUI
# 需要導入模塊: from PyQt5.QtWidgets import QLineEdit [as 別名]
# 或者: from PyQt5.QtWidgets.QLineEdit import move [as 別名]
def initUI(self):
self.c = Communicate()
self.wid = BurningWidget()
self.c.updateBW.connect(self.wid.setValue)
le = QLineEdit(self)
le.move(130, 22)
text, ok = QInputDialog.getText(self, 'Input Dialog',
'Enter your name:')
if ok:
le.setText(str(text))
self.file = open("""/home/an/%(data)s.txt"""%{'data':text}, 'a')
print (text)
hbox = QHBoxLayout()
hbox.addWidget(self.wid)
vbox = QVBoxLayout()
vbox.addStretch(1)
vbox.addLayout(hbox)
self.setLayout(vbox)
self.setGeometry(0, 0, 1800, 1000)
self.setWindowTitle('Burning widget')
self.show()
示例4: Example
# 需要導入模塊: from PyQt5.QtWidgets import QLineEdit [as 別名]
# 或者: from PyQt5.QtWidgets.QLineEdit import move [as 別名]
class Example(QWidget):
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
self.btn = QPushButton('dialog', self)
self.btn.move(20, 20)
self.btn.clicked.connect(self.showDialog)
self.le = QLineEdit(self)
self.le.move(130, 22)
self.setGeometry(300, 300, 300, 250)
self.setWindowTitle('input dialog')
self.show()
def showDialog(self):
text, ok = QInputDialog.getText(self, 'input dialog',
'enter your name:')
if ok:
self.le.setText(str(text))
示例5: Example
# 需要導入模塊: from PyQt5.QtWidgets import QLineEdit [as 別名]
# 或者: from PyQt5.QtWidgets.QLineEdit import move [as 別名]
class Example(QWidget):
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
self.btn = QPushButton('Dialog', self)
self.btn.move(20, 20)
self.btn.clicked.connect(self.showDialog)
self.le = QLineEdit(self)
self.le.move(130, 22)
self.setGeometry(300, 300, 290, 150)
self.setWindowTitle('Input dialog')
self.show()
def showDialog(self):
# QInputDialog提供了一個簡單便利的對話框用於從用戶哪兒獲得一個值,輸入可以是字符串,數字,或者一個列表中的列表項
# 顯示一個輸入對話框。第一個字符串參數是對話框的標題,二是對話框內的消息文本,對話框返回輸入的文本值和一個布爾值
text, ok = QInputDialog.getText(self, 'Input Dialog',
'Enter your name:')
if ok:
# 把從對話框接受到的文本設置到單行編輯框組件上顯示
self.le.setText(str(text))
示例6: initUI
# 需要導入模塊: from PyQt5.QtWidgets import QLineEdit [as 別名]
# 或者: from PyQt5.QtWidgets.QLineEdit import move [as 別名]
def initUI(self):
# lineedit
self.lbl = QLabel(self)
qle = QLineEdit(self)
qle.move(20, 30)
self.lbl.move(20, 10)
qle.textChanged[str].connect(self.onChanged)
# combobox
self.lbl1 = QLabel('ubuntu', self)
combo = QComboBox(self)
combo.addItem('ubuntu')
combo.addItem('mandriva')
combo.addItem('fedora')
combo.addItem('arch')
combo.addItem('gentoo')
combo.move(20, 70)
self.lbl1.move(20, 100)
combo.activated[str].connect(self.onActivated)
self.setGeometry(300, 300, 300, 250)
self.setWindowTitle('widget 1')
self.show()
示例7: Example
# 需要導入模塊: from PyQt5.QtWidgets import QLineEdit [as 別名]
# 或者: from PyQt5.QtWidgets.QLineEdit import move [as 別名]
class Example(QWidget):
def __init__(self):
QWidget.__init__(self)
self.initUI()
def initUI(self):
self.btn = QPushButton("Dialog", self)
self.btn.move(20, 20)
self.btn.clicked.connect(self.showDialog)
self.le = QLineEdit(self)
self.le.move(130, 22)
self.setGeometry(300, 300, 290, 150)
self.setWindowTitle("Input dialog")
self.show()
def showDialog(self):
text, ok = QInputDialog.getText(self, "Input Dialog", "Enter your name:")
if ok:
self.le.setText(str(text))
示例8: App
# 需要導入模塊: from PyQt5.QtWidgets import QLineEdit [as 別名]
# 或者: from PyQt5.QtWidgets.QLineEdit import move [as 別名]
class App(QMainWindow):
def __init__(self):
super().__init__()
self.title = 'PyQt5 textbox'
self.left = 10
self.top = 10
self.width = 400
self.height = 140
self.initUI()
def initUI(self):
self.setWindowTitle(self.title)
self.setGeometry(self.left, self.top, self.width, self.height)
# Create textbox
self.textbox = QLineEdit(self)
self.textbox.move(20, 20)
self.textbox.resize(280, 40)
# Create button in the window
self.button = QPushButton('Show text', self)
self.button.move(20, 80)
# Connect button on function on click
self.button.clicked.connect(self.on_click)
self.show()
@pyqtSlot()
def on_click(self):
textboxValue = self.textbox.text()
QMessageBox.question(self, 'Message - python.org', 'You Typed: ' + textboxValue, QMessageBox.Ok, QMessageBox.Ok)
self.textbox.setText("")
示例9: UIWindow
# 需要導入模塊: from PyQt5.QtWidgets import QLineEdit [as 別名]
# 或者: from PyQt5.QtWidgets.QLineEdit import move [as 別名]
class UIWindow(QWidget):
def __init__(self, parent=None):
super(UIWindow, self).__init__(parent)
self.resize(QSize(600, 750))
self.ToolsBTN = QPushButton('Ok', self)
self.ToolsBTN.resize(100, 40)
self.ToolsBTN.move(200, 450)
self.dialog = QLabel(parent)
self.dialog.setText('Please enter your Email')
newfont = QtGui.QFont("Times", 15, QtGui.QFont.Bold)
self.dialog.setFont(newfont)
self.dialog.resize(250, 40)
self.dialog.move(50, 20)
self.dialog2 = QLabel(parent)
self.dialog2.setText('Complete!')
newfont = QtGui.QFont("Times", 15, QtGui.QFont.Bold)
self.dialog2.setFont(newfont)
self.dialog2.resize(100, 40)
self.dialog2.move(200, 400)
self.dialog2.setVisible(False)
self.mail = QLineEdit(parent)
self.mail.resize(150, 30)
self.mail.move(320, 22)
self.ToolsBTN.clicked.connect(self.savemail)
def savemail(self):
send_mail("[email protected]", self.mail.text(), 'sync', 'this email sent from best-sync group',"Expenses01.xlsx", 'smtp.gmail.com', 587)
self.dialog2.setVisible(True)
示例10: Example
# 需要導入模塊: from PyQt5.QtWidgets import QLineEdit [as 別名]
# 或者: from PyQt5.QtWidgets.QLineEdit import move [as 別名]
class Example(QWidget):
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
self.btn = QPushButton('Dialog', self)
self.btn.move(20, 20)
self.btn.clicked.connect(self.showDialog)
self.le = QLineEdit(self)
self.le.move(130, 22)
self.setGeometry(300, 300, 290, 150)
self.setWindowTitle('Input dialog')
self.show()
def showDialog(self):
""" ボタンが押されるとダイアログを出す """
# input dialogを出す
text, ok = QInputDialog.getText(self, 'Input Dialog',
'Enter your name:')
if ok:
# QLineEditのオブジェクトにテキストをセット
self.le.setText(str(text))
示例11: Example
# 需要導入模塊: from PyQt5.QtWidgets import QLineEdit [as 別名]
# 或者: from PyQt5.QtWidgets.QLineEdit import move [as 別名]
class Example(QWidget):
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
self.btn = QPushButton('Click First', self)
self.btn.move(20, 20)
self.btn.clicked.connect(self.showDialog)
self.le = QLineEdit(self)
self.leSecond = QLineEdit(self)
# I guess its okay to use .extensions in variables in order
# to identify its use, i.e. .le for LineEdit
self.le.move(130, 22)
self.leSecond.move(130, 52)
self.setGeometry(300, 300, 290, 150)
self.setWindowTitle('Input dialog')
self.show()
def showDialog(self):
text, ok = QInputDialog.getText(self, 'Input Dialog', 'Enter your name:')
if ok:
self.le.setText(str(text))
today = date.today()
self.leSecond.setText(today.strftime("%m/%d/%y"))
示例12: MyMainWindow
# 需要導入模塊: from PyQt5.QtWidgets import QLineEdit [as 別名]
# 或者: from PyQt5.QtWidgets.QLineEdit import move [as 別名]
class MyMainWindow(QMainWindow):
def __init__(self):
super(QMainWindow, self).__init__()
self.title = 'PyQt5 textbox example'
self.left = 100
self.top = 100
self.width = 640
self.height = 480
self.init_ui()
def init_ui(self):
self.setWindowTitle(self.title)
self.setGeometry(self.left, self.top, self.width, self.height)
self.textbox = QLineEdit(self)
self.textbox.move(20, 20)
self.textbox.resize(280, 30)
button = QPushButton('Show Text', self)
button.move(20, 80)
button.clicked.connect(self.on_button_click)
def on_button_click(self):
text = self.textbox.text()
if text:
QMessageBox.information(self, 'Message - textbox example', 'You typed: ' + text, QMessageBox.Ok, QMessageBox.Ok)
else:
QMessageBox.warning(self, 'Message - textbox example', 'You have not typed anything!', QMessageBox.Ok, QMessageBox.Ok)
self.textbox.setText('')
示例13: GUI
# 需要導入模塊: from PyQt5.QtWidgets import QLineEdit [as 別名]
# 或者: from PyQt5.QtWidgets.QLineEdit import move [as 別名]
class GUI(QMainWindow):
def __init__(self):
super().__init__()
self.iniUI()
self.buttonClicked()
def iniUI(self):
self.setWindowTitle("LOG自動解壓歸檔")
#self.statusBar().showMessage("文本狀態欄")
self.resize(400, 300)
self.qle = QLineEdit(self)
self.qle.move(20, 80)
btn1 = QPushButton("解壓", self)
btn1.move(20, 120)
btn1.clicked.connect(self.buttonClicked)
# 創建一個菜單欄
menu = self.menuBar()
# 創建兩個個菜單
file_menu = menu.addMenu("文件")
file_menu.addSeparator()
edit_menu = menu.addMenu('修改')
# 創建一個行為
new_action = QAction('新的文件', self)
# 更新狀態欄文本
new_action.setStatusTip('打開新的文件')
# 添加一個行為到菜單
file_menu.addAction(new_action)
# 創建退出行為
exit_action = QAction('退出', self)
# 退出操作
exit_action.setStatusTip("點擊退出應用程序")
# 點擊關閉程序
exit_action.triggered.connect(self.close)
# 設置退出快捷鍵
exit_action.setShortcut('Ctrl+z')
# 添加退出行為到菜單上
file_menu.addAction(exit_action)
def buttonClicked(self):
dddd=self.qle.text()
print(dddd)
path = 'G:/tmp/dirname'
kernel_dirpath='unrardir_kernel'
hal_dirpath='unrardir_hal'
make_newdir(kernel_dirpath)
make_newdir(hal_dirpath)
files = os.listdir(path)
for f in files:
if f.endswith('.tar.gz') and 'kernel' in f:
untar(f,kernel_dirpath)
if f.endswith('.tar.gz') and 'hal' in f:
untar(f,hal_dirpath)
示例14: __init_ui
# 需要導入模塊: from PyQt5.QtWidgets import QLineEdit [as 別名]
# 或者: from PyQt5.QtWidgets.QLineEdit import move [as 別名]
def __init_ui(self):
self.setWindowTitle(self.title)
self.setGeometry(self.left, self.top, self.width, self.height)
edit_box = QLineEdit('Drag this', self)
edit_box.setDragEnabled(True)
edit_box.move(10, 10)
edit_box.resize(200, 32)
label = CustomLabel('Drop here.', self)
label.move(10, 50)
label.resize(200, 32)
示例15: __init__
# 需要導入模塊: from PyQt5.QtWidgets import QLineEdit [as 別名]
# 或者: from PyQt5.QtWidgets.QLineEdit import move [as 別名]
def __init__(self):
super().__init__()
editBox = QLineEdit('Drag this', self)
editBox.setDragEnabled(True)
editBox.move(10, 10)
editBox.resize(100, 32)
button = CustomLabel('Drop here.', self)
button.move(130, 15)
self.show()