aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/clipboard/clipboard.cpp
blob: 192aa7a2b984714e98192bffc72a158c0031a6c7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "clipboard.h"

#include <QClipboard>

Clipboard::Clipboard()
{
    connect(QApplication::clipboard(), &QClipboard::dataChanged, [this] { emit clipboardChanged();});
}

QString Clipboard::get() const
{
    QClipboard *clipboard = QApplication::clipboard();
    return clipboard->text();
}

void Clipboard::toClipboard(QString _text)
{
    QClipboard *clipboard = QApplicationion::clipboard();
    clipboard->setText(_text);
}