PDA

View Full Version : QSlider: emitting a signal with different parameter type



mastupristi
6th July 2009, 10:24
I have a QSlider, and I need a double value.

I have MySlider based on QSlider

class MySlider : public QSlider
{
Q_OBJECT
public:
MySlider();
signals:
void valueChanged ( double );
};
How can I connect valueChanged(int); to my valueChanged(double);? All Example I found never implement a signal.

thanks

nish
6th July 2009, 10:40
make a slot lets say slotIntToDouble(int);


connect(this,SIGNAL(valudeChanged(int)),this,SLOT( slotIntToDouble(int)));

void MySlider::slotIntToDouble(int value)
{
double d=value;
emit valueChanged(d);
}

mastupristi
6th July 2009, 12:53
It works, thanks
:)