C++ (Qt)MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent){ connect(textEdit1, &QPlainTextEdit::copyAvailable, this, &MainWindow::actionSlot); connect(textEdit2, &QPlainTextEdit::copyAvailable, this, &MainWindow::actionSlot); connect(textEdit3, &QPlainTextEdit::copyAvailable, this, &MainWindow::actionSlot);} void MainWindow::actionSlot(){ QPlainTextEdit *edit = qobject_cast<QPlainTextEdit*>(sender()); bool len = edit->toPlainText().size(); copyAct->setEnabled(len > 100);}