Beispiel #1
0
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());
}
Beispiel #2
0
bool ApplicationUI::clipboardCopy(QByteArray content)
{
    Clipboard clipboard;
    clipboard.clear();
    return clipboard.insert("text/plain", content);
}
Beispiel #3
0
void ApplicationUI::copyItem(QString message){
    Clipboard clipboard;
    clipboard.clear();
    clipboard.insert("text/plain", message.toUtf8());
    generalUtilities->createToast("Copied to clipboard");
}