connectSlotsByName and clicked()
Hi,
I'm using the wonderful Qt shortcut "connectSlotsByName" in my application, mostly with clicked() signals in QPushButtons.
The problem is that attached slots are called twice. As far as I was able to search about that up to now, it seems that Qt fires all slots that are compatible with SIGNAL signature, like clicked that has a default parameter.
Is it true? Anyway, how can I solve this issue?
I tried to use normalizedSignature, with no success :(
Thank you so much for all help you can give.
Regards,
Tony.
Re: connectSlotsByName and clicked()
Quote:
I'm using the wonderful Qt shortcut "connectSlotsByName" in my application, mostly with clicked() signals in QPushButtons.
How are you using it ? As far as I guess "connectSlotsByName" is function of QMetaObject and is handled by the qmake.
What do u want to achieve, ad what are u trying ? Can u elaborate ?
Re: connectSlotsByName and clicked()
Just be aware that setupUi() method already calls connectSlotsByName(). That would result to double connections if you, in addition that, do it by hand.
Re: connectSlotsByName and clicked()
Yes, you're right!
I was thinking of it, travelling from work to home :)
Qt's too automatic for me! :o
Thanks so much,
Tony.
Re: connectSlotsByName and clicked()
I'm having problem that is driving me nuts. I'm also using setupUi with on_objectName_signalName() connections. When I call:
Code:
void on_DateButton_clicked()
{
this->setWindowTitle("Some title");
}
this works fine but:
Code:
void on_DateButton_clicked()
{
lineEdit_2->insert("Some text");
}
app crushes.
Any ideas?
I appologize for my poor English.
Re: connectSlotsByName and clicked()
are you sure that "lineEdit_2" is class member? are you sure that "lineEdit_2" contains not null pointer? maybe you should use "ui->lineEdit_2" instead.