Thanks, it is my first try with a GUI but, how would you collect the data from the textline using a button?
The button is called 'AddPipe' and should call an function that collects the data from several textlines and stores it in a dictionary. I am struggling with how I should write the function. I thought it would be as below but it terminates the script without error.
The button is called 'AddPipe' and should call an function that collects the data from several textlines and stores it in a dictionary. I am struggling with how I should write the function. I thought it would be as below but it terminates the script without error.
import os import sys from PyQt5 import QtCore, QtGui, QtWidgets, uic LOCAL_DIR = os.path.dirname(os.path.realpath(__file__)) self.ui = foo.Ui_MainWindow() # Or .Ui_Dialog, or .Ui_Widget self.ui.setupUi(self) class Main(QtWidgets.QMainWindow): def __init__(self): super().__init__() self.ui = uic.loadUi(LOCAL_DIR + "/propertyDialog.ui", self) self.show() self.response_AddPipe.clicked.connect(self.call_property) def call_property(self): print(self.ui.inputPipe_name.text()) if __name__ == '__main__': app = QtWidgets.QApplication([]) gui = Main() sys.exit(app.exec_())