mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +03:00
96f791daf1
See also: https://daniel.haxx.se/blog/2023/01/08/copyright-without-years/ https://hynek.me/til/copyright-years/
26 lines
509 B
C++
26 lines
509 B
C++
// SPDX-FileCopyrightText: Nheko Contributors
|
|
//
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
#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();
|
|
}
|