plugeth/ui/qt/clipboard/clipboard.cpp
2015-02-19 11:51:38 +01:00

21 lines
419 B
C++

#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);
}