Python Forum
[PyQt] Collect entry from textline Widget via UI file
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyQt] Collect entry from textline Widget via UI file
#3
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.

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_())
Reply


Messages In This Thread
RE: Collect entry from textline Widget via UI file - by mart79 - Aug-04-2019, 11:00 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  ValueError: could not convert string to float: '' fron Entry Widget russellm44 5 896 Mar-06-2024, 08:42 PM
Last Post: russellm44
  [Tkinter] entry widget DPaul 5 1,618 Jul-28-2023, 02:31 PM
Last Post: deanhystad
  [PyQt] [solved] How to display a pdf-file in a PyQt6 widget BigMan 13 16,528 May-06-2023, 09:27 AM
Last Post: Axel_Erfurt
  Tkinter Exit Code based on Entry Widget Nu2Python 6 3,105 Oct-21-2021, 03:01 PM
Last Post: Nu2Python
  [Tkinter] compare entry with value inside file rwahdan 1 2,115 Jun-19-2021, 08:01 AM
Last Post: Yoriz
  method to add entries in multi columns entry frames in self widget sudeshna24 2 2,319 Feb-19-2021, 05:24 PM
Last Post: BashBedlam
  Entry Widget issue PA3040 16 7,032 Jan-20-2021, 02:21 PM
Last Post: pitterbrayn
  Android app to collect data jehoshua 7 4,449 Dec-24-2020, 08:07 AM
Last Post: dejaolsone
  [Tkinter] password with Entry widget TAREKYANGUI 9 6,136 Sep-24-2020, 05:27 PM
Last Post: TAREKYANGUI
  [Tkinter] Get the last entry in my text widget Pedroski55 3 6,514 Jul-13-2020, 10:34 PM
Last Post: Pedroski55

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020