slots with params problem
I want to send a signal which with params to a slot. And the params is necessary to the slot.For example,mysignal(int , QString); myslot(int , QString). If I used the slot like that,whether it is right or not. My mind is to inform a slot function, and pass the param to it.
Thanks very much.
Re: slots with params problem
I don't understand your question.
But here's an example of a signal and slot connection with parameters:
Code:
{
Q_OBJECT
signals:
void signalWithParameters
(const QString &text,
int number
);
};
{
Q_OBJECT
public slots:
void slotWithParameters
(const QString &text,
int number
);
};
...
A aObject;
B bObject;
connect(&aObject, SIGNAL(signalWithParameters(const QString&, int)), &bObject, SLOT(slotWithParameters(const QString&, int)));