for(i=0; i<height; i++)
{
for(j=0; j<width; j++)
{
button[i][j] = new QPushButton("Empty", this);
button[i][j]->resize(40, 40);
button[i][j]->move(40*j, 40*i);
connect(button[i][j], SIGNAL(clicked()), this, SLOT(changeText(button[i][j])));
}
}
関数 changeText を関数 (fullScreen など) で変更すると機能しますが、自分で定義したスロット (changeText) を使用すると、このエラーが表示され、解決方法がわかりません
QObject::connect: No such slot buttons::changeText(&button[i][j])
これは関数 changeText です。
void buttons::changeText(QPushButton* button)
{
button->setText("Fish");
}
注:ヘッダーファイルで、次のようにスロットを定義しました:
クラス ボタン : public QWidget
Q_OBJECT
public slots:
void changeText(QPushButton* button);