How can I send a string from an array with connect using the lambda-notation? I want to send btnTest[pagecounter-1] as the first argument of the connect, but the compiler says 'no matching function for call to ...'
btnTest
[pagecounter
-1].
setMaximumSize(QSize(20,
20));
btnTest
[pagecounter
-1].
setObjectName(QString::number(pagecounter
-1));
top->addWidget(groupBox);
top->addWidget(btnTest, pagecounter-1);
top->maximumSize();
mainLayout->addLayout(top);
groupBox->setLayout(vbox);
connect(btnTest[pagecounter-1], &QPushButton::clicked, [=] {
emit systembutton_clicked(btnTest[pagecounter-1].objectName().toInt(), 1, vbox);
});
btnTest = new QPushButton[pagecounter];//("G", this);
btnTest[pagecounter-1].setMaximumSize(QSize(20,20));
btnTest[pagecounter-1].setObjectName(QString::number(pagecounter-1));
top->addWidget(groupBox);
top->addWidget(btnTest, pagecounter-1);
top->maximumSize();
mainLayout->addLayout(top);
QVBoxLayout *vbox = new QVBoxLayout;
groupBox->setLayout(vbox);
connect(btnTest[pagecounter-1], &QPushButton::clicked, [=] {
emit systembutton_clicked(btnTest[pagecounter-1].objectName().toInt(), 1, vbox);
});
To copy to clipboard, switch view to plain text mode
Bookmarks