Answer the question
In order to leave comments, you need to log in
How in Pyqt5 Write in lineEdit Hello, then click on pushButton and hello friend is displayed in lineEdit_2?
from PySide2.QtCore import *
from PySide2.QtGui import *
from PySide2.QtWidgets import *
from PyQt5 import uic, QtWidgets
Form, _ = uic.loadUiType("opp.ui")
import os
from PyQt5.QtWidgets import (QMainWindow, QApplication, QWidget,
QPushButton, QAction, QLineEdit, QMessageBox)
class Ui(QtWidgets.QDialog, Form):
def __init__(self):
super(Ui, self).__init__()
self.setupUi(self)
self.pushButton_2.clicked.connect( self.printButtonPressed)
self.pushButton_23.clicked.connect(self.grod)
self.pushButton_25.clicked.connect(self.bgw)
self.pushButton_26.clicked.connect(self.deu)
self.pushButton_21.clicked.connect(self.en)
value = self.lineEdit(self)
def printButtonPressed(self):
os.startfile(r'C:\Users\user\Desktop\testr.docx')
def en(self):
textboxValue = self.value.text()
self.value.setText("")
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
w = Ui()
w.show()
sys.exit(app.exec_())
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question