1 QString source = ui->textEdit_code->toPlainText(); 2 QClipboard *clipboard = QApplication::clipboard(); //获取系统剪贴板指针 3 QString originalText = clipboard->text(); //获取剪贴板上文本信息 4 clipboard->setText(source); //设置剪贴板内容</span>
1 QString source = ui->textEdit_code->toPlainText(); 2 QClipboard *clipboard = QApplication::clipboard(); //获取系统剪贴板指针 3 QString originalText = clipboard->text(); //获取剪贴板上文本信息 4 clipboard->setText(source); //设置剪贴板内容</span>