plugeth/ui/qt/clipboard/clipboard.cpp

21 lines
419 B
C++
Raw Normal View History

2015-02-19 10:51:38 +00:00
#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);
}