void MainScreen::copyMessagesToClipboard(const QVariantList& messages) { QList<Message*> list; for (int i = 0; i < messages.length(); i++) list.append((Message*)messages.at(i).value<QObject*>()); qSort(list.begin(), list.end(), compareMessages); QString str = ""; foreach(Message* msg, list) str += msg->text() + "\n"; Clipboard clipboard; clipboard.clear(); clipboard.insert("text/plain", str.toUtf8()); }
bool ApplicationUI::clipboardCopy(QByteArray content) { Clipboard clipboard; clipboard.clear(); return clipboard.insert("text/plain", content); }
void ApplicationUI::copyItem(QString message){ Clipboard clipboard; clipboard.clear(); clipboard.insert("text/plain", message.toUtf8()); generalUtilities->createToast("Copied to clipboard"); }