pyqt signals

Discussion in 'Python' started by luca72, Sep 3, 2010.

  1. luca72

    luca72 Guest

    Hello i have write this but i not able to connect the emit of the
    class Socket to the Form class, can you help me?

    class Socket(QtNetwork.QTcpSocket):
    def __init__(self, parent=None):
    super(Socket, self).__init__(parent)
    self.connect(self, QtCore.SIGNAL("readyRead()"),
    self.leggi_richiesta)

    def leggi_richiesta(self):
    messaggio = self.readData(self.bytesAvailable())
    print 'dati_letti = ', messaggio
    self.emit(QtCore.SIGNAL("messaggio"), messaggio)
    print 'segnale emesso'

    class Form(QWidget, Ui_Form):
    """
    Class documentation goes here.
    """
    def __init__(self, parent = None):
    """
    Constructor
    """

    connesso_in_arr =False
    self.coda = False
    QWidget.__init__(self, parent)
    self.setupUi(self)
    self.dati = False
    self.lu = TcpServer()
    self.lu
    self.connect(Socket(self), QtCore.SIGNAL('messaggio'),
    self.leggo_risposta)


    def leggo_risposta(self, messaggio):
    self.plainTextEdit_2.appendPlainText(messaggio)

    Thanks Luca
     
    luca72, Sep 3, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Thomas

    unused bits in signals

    Thomas, Jul 6, 2003, in forum: VHDL
    Replies:
    2
    Views:
    1,075
    Mario Trams
    Jul 6, 2003
  2. Ingmar Seifert

    Delay of control signals

    Ingmar Seifert, Aug 18, 2003, in forum: VHDL
    Replies:
    0
    Views:
    1,204
    Ingmar Seifert
    Aug 18, 2003
  3. ulysses
    Replies:
    4
    Views:
    768
    Werner Schiendl
    Oct 22, 2003
  4. Zabin
    Replies:
    2
    Views:
    1,369
    Zabin
    Dec 20, 2009
  5. AlienBaby

    PyQt signals/slots dialogs question

    AlienBaby, Jun 7, 2010, in forum: Python
    Replies:
    6
    Views:
    722
    Thomas Jollans
    Jun 7, 2010
Loading...

Share This Page