Object :: connect:沒有這樣的信號RollsRoyceTab :: signal_aValueChange(int aValue) ??????沒有這樣的插槽/信號(Qt)
我有
class RollsRoyceTab : public QWidget
{
Q_OBJECT
public:
RollsRoyceTab(QWidget *parent = 0);
public slots:
void aValueChange(int);
void bValueChange(int);
void cValueChange(int);
void rrValuesHolder(int aValue, int bValue, int cValue);
signals:
void signal_aValueChange(int aValue);
void signal_bValueChange(int bValue);
void signal_cValueChange(int cValue);
private:
.........
int aValue, bValue, cValue;
};
............
connect(this,SIGNAL(signal_aValueChange(int aValue)),this,SLOT(rrValuesHolder(int aValue, int bValue, int cValue)));
}
void RollsRoyceTab::aValueChange(int aValue)
{
lcdAL->display(aValue);
lcdAR->display(100 - aValue);
emit signal_aValueChange(aValue);
}
void RollsRoyceTab::rrValuesHolder(int aValue, int bValue, int cValue)
{
qDebug() << aValue;
qDebug() << bValue;
qDebug() << cValue;
}
並連接(......此,SLOT(rrValuesHolder(INT安勤,INT bValue,INT cValue)));或者只需要寫一個值SLOT(rrValuesHolder(int aValue))?
好的。 connect(this,SIGNAL(signal_aValueChange(int,int,int)),this,SLOT(rrValuesHolder(int,int,int)));發出signal_aValueChange(aValue,bValue,cValue); – 2013-03-11 19:16:28