summary refs log tree commit diff
path: root/src/Clipboard.cpp
blob: cb02f5fa81237b4680236c94071a81e863d178ef (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// 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();
}

#include "moc_Clipboard.cpp"