0

I'm working with an example based on the following link

Passing an argument to a slot

I'm trying to connect a certain function with a given parameter when a certain slider is released.

connect(m_customUIForm.horizontalSliderOr, &QAbstractSlider::sliderReleased(), this, [this]{ sendMoveActuator(1); });

The problem seems to lie in the signal &QAbstractSlider::sliderReleased()

error: cannot call member function 'void QAbstractSlider::sliderReleased()' without object
 connect(m_customUIForm.horizontalSliderOr, &QAbstractSlider::sliderReleased(), this, [this]{ sendMoveActuator(1); });

Which is the proper way to pass the signal of sliderReleased() ?

                                                                             ^
Community
  • 1
  • 1
Luigi
  • 376
  • 3
  • 16

1 Answers1

0

Looking at the examples in the linked post, I suggest you remove the parentheses. I.e. not:

connect(m_customUIForm.horizontalSliderOr, &QAbstractSlider::sliderReleased(), this, [this]{ sendMoveActuator(1); });

But rather:

connect(m_customUIForm.horizontalSliderOr, &QAbstractSlider::sliderReleased, this, [this]{ sendMoveActuator(1); });
ThorngardSO
  • 1,191
  • 7
  • 7