Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > strange QLineEdit problem in PyQt

Reply
Thread Tools

strange QLineEdit problem in PyQt

 
 
taco
Guest
Posts: n/a
 
      03-16-2011
hi,
I have a form containing a few QLineedits and I wish to retrieve the
contents only after pressing a QPushButton.
a looks like:
class Contract(QtGui.QWidget):
def __init__(self,fileInfo, parent=None):
QtGui.QWidget.__init__(self,parent)
self.name = QtGui.QLineEdit("")
.....
self.createDoc = QtGui.QPushButton("do it")
self.connect(createDoc,QtCore.SIGNAL("clicked()"), self.Foo)
mainLayout.addWidget(self.name)
mainLayout.addWidget(sef.createDoc)

def Foo(self):
print self.name.text()

when executing this I get only a few characters back from the line. It's
incomplete. How to retrieve the complete string? I don't need a signal for
every typed character.

taco

 
Reply With Quote
 
 
 
 
taco
Guest
Posts: n/a
 
      03-16-2011
taco wrote:

ah, I solved it myself. for completeness reasons. I had upgraded python for
reportlab which needed this python version, while still using a pyqt which
was compiled for 2.6. After compilation and changing pythonpath to the right
site-packages dir it's working


> hi,
> I have a form containing a few QLineedits and I wish to retrieve the
> contents only after pressing a QPushButton.
> a looks like:
> class Contract(QtGui.QWidget):
> def __init__(self,fileInfo, parent=None):
> QtGui.QWidget.__init__(self,parent)
> self.name = QtGui.QLineEdit("")
> .....
> self.createDoc = QtGui.QPushButton("do it")
> self.connect(createDoc,QtCore.SIGNAL("clicked()"), self.Foo)
> mainLayout.addWidget(self.name)
> mainLayout.addWidget(sef.createDoc)
>
> def Foo(self):
> print self.name.text()
>
> when executing this I get only a few characters back from the line. It's
> incomplete. How to retrieve the complete string? I don't need a signal for
> every typed character.
>
> taco


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
strange behavior with PyQt freud Python 0 08-22-2009 01:32 PM
PyQT, QProcess.readyReadStdout() problem aljosa Python 0 07-01-2005 11:55 AM
PyQt installation problem Bulba! Python 0 12-29-2004 10:08 PM
[PY GUI] interest function in python GUI(wxpython,pyqt) program.wxpython,pyqt ulysses Python 4 10-22-2003 03:28 PM
problem installing PyQt for eric3 Lupe Python 3 08-27-2003 02:02 PM



Advertisments