我正在使用基于以下链接的示例
我尝试在释放某个滑块时将某个功能与给定参数连接。
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()的信号的正确方法是什么?
^
答案 0 :(得分:0)
查看链接帖子中的示例,我建议您删除括号。即不:
connect(m_customUIForm.horizontalSliderOr, &QAbstractSlider::sliderReleased(), this, [this]{ sendMoveActuator(1); });
而是:
connect(m_customUIForm.horizontalSliderOr, &QAbstractSlider::sliderReleased, this, [this]{ sendMoveActuator(1); });