[Qt-interest] [SOLVED] Problems with Signal and Slots [QLineEdit]

Aaron Lewis aaron.lewis1989 at gmail.com
Mon Mar 22 14:26:58 CET 2010


Thiago Macieira wrote:
> Em Segunda-feira 22 Março 2010, às 13:56:23, Aaron Lewis escreveu:
>   
>> Hi,
>>     I got such warnings:
>>         QMetaObject::connectSlotsByName: No matching signal for
>> on_escapeLine(QString)
>>     
>
> If you're using connectSlotsByName (which the .ui file produces), you HAVE to 
> pay attention to slot naming.
>
> It's on_<objectname>_<signalname>.
>
> If you name anything starting with "on_", you have to do it the whole way. And 
> don't connect manually, like you did below. Just leave the the automatic 
> connection to take place.
>
> Or don't name your slots starting with "on_".
>
>   

Yeah , you got it Thiago ,  i should not name my function like this
I should change my prefix `on_'.

I thought if i didn't provide <signalname> , it won't just connect it , 
i'm wrong here.

Thank you all.

>> Sample Code:
>>     //Declare
>>     private slots:
>>         void on_escapeLine(const QString&);
>>
>>     //In Construct function
>>
>> connect(ui->escapeLine,SIGNAL(textEdited(QString)),this,SLOT(on_escapeLine(
>> QString)));
>>
>> Note:    escapeLine is a QLineEdit.
>>
>> Any ideas will appreciate ;-)
>>     
>
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>   


-- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode




More information about the Qt-interest-old mailing list