2023-02-22 01:48:49 +03:00
|
|
|
// SPDX-FileCopyrightText: Nheko Contributors
|
2021-04-29 23:52:55 +03:00
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2021-04-29 22:46:49 +03:00
|
|
|
#include "Clipboard.h"
|
|
|
|
|
|
|
|
#include <QClipboard>
|
|
|
|
#include <QGuiApplication>
|
|
|
|
|
|
|
|
Clipboard::Clipboard(QObject *parent)
|
|
|
|
: QObject(parent)
|
|
|
|
{
|
2021-09-18 01:22:33 +03:00
|
|
|
connect(QGuiApplication::clipboard(), &QClipboard::dataChanged, this, &Clipboard::textChanged);
|
2021-04-29 22:46:49 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Clipboard::setText(QString text)
|
|
|
|
{
|
2021-09-18 01:22:33 +03:00
|
|
|
QGuiApplication::clipboard()->setText(text);
|
2021-04-29 22:46:49 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
QString
|
|
|
|
Clipboard::text() const
|
|
|
|
{
|
2021-09-18 01:22:33 +03:00
|
|
|
return QGuiApplication::clipboard()->text();
|
2021-04-29 22:46:49 +03:00
|
|
|
}
|
2024-03-16 03:24:33 +03:00
|
|
|
|
|
|
|
#include "moc_Clipboard.cpp"
|