QRadioButton的信号和插槽不匹配

时间:2019-12-03 06:23:34

标签: qt qt5

这是我与QRadioButton的连接。

connect( radioButtonTransformationLocal, SIGNAL(toggled(bool)), this, SLOT(OnTransformationModeChanged()));

现在我正尝试切换到现代语法,但是出现信号和插槽不匹配的错误

connect(radioButtonLeftAlignX, QOverload<bool>::of(&QRadioButton::toggle), this, &WavefrontRenderer::radioButtonLeftAlignX);

我也尝试过

connect(radioButtonLeftAlignX, &QRadioButton::toggle, this, &WavefrontRenderer::radioButtonLeftAlignX);

1 个答案:

答案 0 :(得分:1)

将“ toggle”替换为“ toggle d ”:

connect(radioButtonLeftAlignX, QOverload<bool>::of(&QRadioButton::toggled), this, &WavefrontRenderer::radioButtonLeftAlignX);