[PyQt] Problems with getting text from QLineEdit

Gerry Brown gbrown at gerbreown.com
Mon Jan 16 10:50:13 GMT 2017


I have created a form using QT Designer that has a number of QLineEdit 
widgets in it.  It shows great on the screen.  I have the problem when I 
try to get the .text property from it.

Below is several samples of my code with the error messages:

NameError: name 'pat_add_gui' is not defined

AttributeError: 'bool' object has no attribute 'pat_add_gui'

AttributeError: 'bool' object has no attribute 'ui'

This code & errors are in the same file where I import the GUI file.  I 
have tried:

from gui.pat_add_gui import Ui_frame


qtDesignerFile = '/home/gerald/virtualenvs/medrec/gui/pat_add_gui.ui'

Ui_MainWindow, QtBaseClass = uic.loadUiType(qtDesignerFile)

Any ideas how I can get the text from these lineedits???


More information about the PyQt mailing list