![]() |
Request-Help pyqt attribute error.
I have been messing around with pyqt but i have hit a brick wall with this.
Basically, i used the designer to create a gui and the main code is the program, but i keep getting an attribute error when i try and make a function for some buton. Code:
#!/usr/bin/python2.5 Code:
QtCore.QObject.connect(self.ui.btnSend, QtCore.SIGNAL('clicked()'), self.smsgo) Any insight? |
Re: Request-Help pyqt attribute error.
Can you post the error message?
And it looks like the function definition has wrong indentation. nicolai |
Re: Request-Help pyqt attribute error.
Yes. That was it. :\
I am going to have to be careful about that. Sorry to waste your time, though i'm sure i will have more problems soon enough. |
Re: Request-Help pyqt attribute error.
Ok, I have a new question.
Here is my code snipit Code:
manager = QNetworkAccessManager(self); nameerror: global name 'Qnetworkaccessmanager' is not defined The Qnetworkaccessmanager is defiantly confusing me a bit. Any hints in the right direction? |
Re: Request-Help pyqt attribute error.
Quote:
'Qnetworkaccessmanager' => 'QNetworkAccessManager' it's right here in the code but probably not in your script, because in the nameerror only the first letter is a capital?? |
Re: Request-Help pyqt attribute error.
I typed the name error out and forgot the caps.
It is still caps in my code. :confused: Should i use http instead? |
Re: Request-Help pyqt attribute error.
Missing import statement?
Something like from PyQt4.QtNetwork import QNetworkAccessManager nicolai |
Re: Request-Help pyqt attribute error.
Quote:
from PyQt4 import QtGui,QtCore,QtNetwork seems i needed from PyQt4.QtNetwork import QNetworkAccessManager too. now it is telling me connect is not defined, but i can probably work that out. |
Re: Request-Help pyqt attribute error.
Ok, So i have a program that works.
It sends an sms through exetel Code:
#!/usr/bin/python2.5 Also, I still cant figer out how to get a response back from the network access manager. (hence why the connect is commented out) Any ideas there? |
Re: Request-Help pyqt attribute error.
See http://wiki.maemo.org/Desktop_file_format
For the connect, off the top of my head: self.connect(self.manager, QtCore.SIGNAL('finished("QNetworkReply*")'),self, lambda x: do_something_with_reply(x))); (you don't need the lambda or the parameter if do_something_with_reply is a slot in a QObject or one of it's subclasses) |
All times are GMT. The time now is 12:09. |
vBulletin® Version 3.8.8