2013年9月15日星期日

[Android] Qt uses emit emission signals , the compiler reported signal unresolved external symbol ?

I have written a TCP class inherits QObject used to implement tcp connection server side, when a client connection request arrives in the UI class upgrade information . Achieved through the signals and slots mechanism .
The problem now is that in the tcp class emit a signal when the function will be reported unresolved external symbol in the UI class has achieved connect, signals and slots are one type of parameters, signal only statement is not defined , the slot has been defined . . . Looking for a long time still not found a reason . You help me , how the whole ah ? ? ?
    emit sndClientInfo(tcpSkt->peerAddress().toString());
/ / signal transmitter

connect (& server, SIGNAL (sndClientInfo (const QString &)), this, SLOT (updateStatusBar (const QString &))) ;/ / UI classes connect function .
------ Solution ---------------------------------------- ----
signal sndClientInfo defined?
------ Solution ---------------------------------------- ----
Q_OBJECT
------ Solution ------------------------------- -------------
your H file has defined signals or slots are not using it
------ Solution ---------- ----------------------------------
inside you bind parameters are const QString ; &
you pass a QString &
You can first
const QString & addr = tcpSkt-> peerAddress (). toString ();
then emit try
------ eference -------------------------------- -------

no ah I read online that do not define it merely stated that the signal on the line ah. .
------ eference --------------------------------------- < br> is declared
declared that it should be that way .
------ eference --------------------------------------- < br> you should be inside the server class is not defined sndClientInfo signal
------ eference ---------------------------- -----------
QObject :: connect
------ eference ---------------------- -----------------
emit sndClientInfo (tcpSkt-> peerAddress (). toString ()); would not think this is the statement of the ?
------ eference --------------------------------------- < br> the next qmake.
I have encountered this error
------ eference ------------------------------ ---------
in one file defines two classes , there will be such a problem, I have encountered

没有评论:

发表评论