我正在使用一个基于以下链接的示例
当某个滑块被释放时,我试图将某个函数与给定的参数连接起来。
connect(m_customUIForm.horizontalSliderOr, &QAbstractSlider::sliderReleased(), this, [this]{ sendMoveActuator(1); });问题似乎出在信号&QAbstractSlider::sliderReleased()中
error: cannot call member function 'void QAbstractSlider::sliderReleased()' without object
connect(m_customUIForm.horizontalSliderOr, &QAbstractSlider::sliderReleased(), this, [this]{ sendMoveActuator(1); });传递sliderReleased()信号的正确方式是什么?
^发布于 2017-05-11 03:33:40
查看链接帖子中的示例,我建议您删除括号。即不是:
connect(m_customUIForm.horizontalSliderOr, &QAbstractSlider::sliderReleased(), this, [this]{ sendMoveActuator(1); });而是:
connect(m_customUIForm.horizontalSliderOr, &QAbstractSlider::sliderReleased, this, [this]{ sendMoveActuator(1); });https://stackoverflow.com/questions/43900611
复制相似问题