PDA

View Full Version : Connect with const char*



grazyna
13th August 2009, 17:23
How can I connect two signals or signal and slot use const char*, e.g:
connect(widget, "valueChange(double), this, "myValueChanged(double));

Doing like this, I have info: Object::connect: No such signal QDoubleSpinBox::alueChanged(double) .

wysota
13th August 2009, 17:42
Use the SIGNAL() and SLOT() macros as the docs advise.

wagmare
14th August 2009, 06:32
QSpinbox default signal of valueChange() is
void QSpinBox::valueChanged ( int i )

void QSpinBox::valueChanged ( const QString & text )

only QString and int value u can connect .. valueChanged(double) is not defined ..

if u want the value in double
either emit() or use QSignalMapper()

wysota
14th August 2009, 08:29
only QString and int value u can connect .. valueChanged(double) is not defined ..

The question is about QDoubleSpinBox :)

aamer4yu
14th August 2009, 16:45
Check the names properly... from your post..

Doing like this, I have info: Object::connect: No such signal QDoubleSpinBox::alueChanged(double) . :rolleyes:

wysota
14th August 2009, 18:44
... or you can just do what I said and forget about the problem.

aamer4yu
14th August 2009, 18:59
definitely,,, what I said was in addition to ur points.. :)

wysota
14th August 2009, 19:13
Ok, but the signal name was correct, it was just missing the macro.