如何进行 Qt QLed 信号槽连接?

How can I do Qt QLed signal slot connection?

我想把led接上信号槽。当 LED 状态改变时,我想做点什么。这里按信号槽代码;

QLed*        ledAliveStatus;
connect(ledAliveStatus, SIGNAL(valueChanged(bool)), this, SLOT(CheckConfiguration(bool)));

当我调试程序时,它给了我

对象::连接:没有这样的信号QLed::valueChanged(bool)

Qled class 信号槽方法如下所示。我尝试使用 LedStateChaned(bool) 而不是更改值,但它给了我同样的错误。

// User-defined attributes

signals:
void ledStateChanged(bool);
void ledRotationChanged(double);
void ledStateToggled();

public slots:
void setLedState(const bool &ledState);
void setLedStretch(const bool &ledStretch);
void setLedShape(const LedShape &ledShape);
void setLedType(const LedType &ledType);

没有名为 valueChanged() 的信号。你应该使用

connect(ledAliveStatus, SIGNAL(ledStateChanged(bool)), this, SLOT(CheckConfiguration(bool)));