[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyQt] i can't connect
From:       "lucaberto () libero ! it" <lucaberto () libero ! it>
Date:       2016-05-31 15:40:41
Message-ID: 143762833.1361291464709241419.JavaMail.httpd () webmail-05 ! iol ! local
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


I have two file one is calles form.pyand it starts 
from PyQt5.QtCore import pyqtSlot, pyqtSignal, QObjectfrom PyQt5.QtWidgets import \
QWidget,  QFileDialogfrom PyQt5.QtSql import QSqlDatabasefrom PyQt5.QtSql import \
QSqlTableModelfrom PyQt5.QtSql import QSqlQueryfrom PyQt5.QtSql import QSqlRecordfrom \
PyQt5.QtCore import Qtfrom PyQt5.QtWidgets import QWidgetfrom PyQt5 import \
QtWidgetsfrom PyQt5 import QtCorefrom form_ricerca import Form_Ricerca, Segnalefrom \
Ui_form import Ui_Form

class Form(QWidget, Ui_Form):    """    Class documentation goes here.    """    def \
__init__(self, parent=None):        """        Constructor                @param \
parent reference to the parent widget (QWidget)        """        \
#QObject.__init__(self, parent)        self.fr = Form_Ricerca()        self.sp = \
Segnale()        super(Form, self).__init__(parent)        \
self.sp.seleziono.connect(self.selezionato)        self.setupUi(self)                 \
def selezionato(self):        luca = 0        print('selezionato'+str(luca)) and the \
other called form_ricerca from PyQt5.QtCore import pyqtSlot, QModelIndex, pyqtSignal, \
QObjectfrom PyQt5.QtWidgets import QWidgetfrom PyQt5 import QtCore





from Ui_form_ricerca import Ui_Form

class Form_Ricerca(QWidget, Ui_Form):    """    Class documentation goes here.    """ \
def __init__(self, parent=None):        """        Constructor                @param \
parent reference to the parent widget (QWidget)        """        self.sg = Segnale() \
super(Form_Ricerca, self).__init__(parent)        \
self.sg.seleziono.connect(self.selezionato)        self.setupUi(self)              \
def selezionato(self, id):        print('beccato)'+str(id)) class Segnale(QObject):   \
seleziono = pyqtSignal(str)        def emetto(self,  id):        \
#self.seleziono.connect(self.connetto)        self.seleziono.emit(str(id))        \
print('Emesso: '+str(id)) the signal is captured in the class Form_Ricerca, but not \
in the class Form of the first file and i need that it is captured in this class what \
is wrong?


[Attachment #5 (text/html)]

<div></div>I have two file&nbsp;<div>one is calles form.py</div><div>and it \
starts&nbsp;</div><div><br></div><div><div>from PyQt5.QtCore import pyqtSlot, \
pyqtSignal, QObject</div><div>from PyQt5.QtWidgets import QWidget, \
&nbsp;QFileDialog</div><div>from PyQt5.QtSql import QSqlDatabase</div><div>from \
PyQt5.QtSql import QSqlTableModel</div><div>from PyQt5.QtSql import \
QSqlQuery</div><div>from PyQt5.QtSql import QSqlRecord</div><div>from PyQt5.QtCore \
import Qt</div><div>from PyQt5.QtWidgets import QWidget</div><div>from PyQt5 import \
QtWidgets</div><div>from PyQt5 import QtCore</div><div>from form_ricerca import \
Form_Ricerca, Segnale</div><div>from Ui_form import \
Ui_Form<br></div><div><br></div><div>class Form(QWidget, Ui_Form):</div><div>&nbsp; \
&nbsp; """</div><div>&nbsp; &nbsp; Class documentation goes here.</div><div>&nbsp; \
&nbsp; """</div><div>&nbsp; &nbsp; def __init__(self, parent=None):</div><div>&nbsp; \
&nbsp; &nbsp; &nbsp; """</div><div>&nbsp; &nbsp; &nbsp; &nbsp; \
Constructor</div><div>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; \
&nbsp; &nbsp; @param parent reference to the parent widget (QWidget)</div><div>&nbsp; \
&nbsp; &nbsp; &nbsp; """</div><div>&nbsp; &nbsp; &nbsp; &nbsp; \
#QObject.__init__(self, parent)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; self.fr = \
Form_Ricerca()</div><div>&nbsp; &nbsp; &nbsp; &nbsp; self.sp = \
Segnale()</div><div>&nbsp; &nbsp; &nbsp; &nbsp; super(Form, \
self).__init__(parent)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; \
self.sp.seleziono.connect(self.selezionato)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; \
self.setupUi(self)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp; \
&nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; \
&nbsp;&nbsp;</div><div>&nbsp; &nbsp; def selezionato(self):</div><div>&nbsp; &nbsp; \
&nbsp; &nbsp; luca = 0</div><div>&nbsp; &nbsp; &nbsp; &nbsp; \
print('selezionato'+str(luca))</div></div><div><br></div><div>and the other called \
form_ricerca</div><div><br></div><div><div>from PyQt5.QtCore import pyqtSlot, \
QModelIndex, pyqtSignal, QObject</div><div>from PyQt5.QtWidgets import \
QWidget</div><div>from PyQt5 import \
QtCore</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div>from \
Ui_form_ricerca import Ui_Form</div><div><br></div><div><br></div><div>class \
Form_Ricerca(QWidget, Ui_Form):</div><div>&nbsp; &nbsp; """</div><div>&nbsp; &nbsp; \
Class documentation goes here.</div><div>&nbsp; &nbsp; """</div><div>&nbsp; &nbsp; \
def __init__(self, parent=None):</div><div>&nbsp; &nbsp; &nbsp; &nbsp; \
"""</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Constructor</div><div>&nbsp; &nbsp; &nbsp; \
&nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; @param parent reference to the \
parent widget (QWidget)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; """</div><div>&nbsp; \
&nbsp; &nbsp; &nbsp; self.sg = Segnale()</div><div>&nbsp; &nbsp; &nbsp; &nbsp; \
super(Form_Ricerca, self).__init__(parent)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; \
self.sg.seleziono.connect(self.selezionato)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; \
self.setupUi(self)</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; \
&nbsp;&nbsp;<br></div><div>&nbsp; &nbsp; def selezionato(self, id):</div><div>&nbsp; \
&nbsp; &nbsp; &nbsp; \
print('beccato)'+str(id))</div></div><div><br></div><div><div>class \
Segnale(QObject):</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp;</div><div>&nbsp; &nbsp; seleziono = pyqtSignal(str)</div><div>&nbsp; \
&nbsp;&nbsp;</div><div>&nbsp; &nbsp; def emetto(self, &nbsp;id):</div><div>&nbsp; \
&nbsp; &nbsp; &nbsp; #self.seleziono.connect(self.connetto)</div><div>&nbsp; &nbsp; \
&nbsp; &nbsp; self.seleziono.emit(str(id))</div><div>&nbsp; &nbsp; &nbsp; &nbsp; \
print('Emesso: '+str(id))</div></div><div><br></div><div>the signal is captured in \
the class Form_Ricerca, but not in the class Form of the first file and i need that \
it is captured in this class what is wrong?</div>


[Attachment #6 (text/plain)]

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic