mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-10-31 10:00:46 +03:00
24 lines
437 B
C++
24 lines
437 B
C++
|
#include "Clipboard.h"
|
||
|
|
||
|
#include <QClipboard>
|
||
|
#include <QGuiApplication>
|
||
|
|
||
|
Clipboard::Clipboard(QObject *parent)
|
||
|
: QObject(parent)
|
||
|
{
|
||
|
connect(
|
||
|
QGuiApplication::clipboard(), &QClipboard::dataChanged, this, &Clipboard::textChanged);
|
||
|
}
|
||
|
|
||
|
void
|
||
|
Clipboard::setText(QString text)
|
||
|
{
|
||
|
QGuiApplication::clipboard()->setText(text);
|
||
|
}
|
||
|
|
||
|
QString
|
||
|
Clipboard::text() const
|
||
|
{
|
||
|
return QGuiApplication::clipboard()->text();
|
||
|
}
|