File indexing completed on 2024-12-01 04:29:20
0001 /* 0002 SPDX-FileCopyrightText: 2018 Nicolas Carion 0003 SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0004 */ 0005 0006 #include "clipboardproxy.hpp" 0007 #include <QClipboard> 0008 #include <QGuiApplication> 0009 #include <QMimeData> 0010 0011 ClipboardProxy::ClipboardProxy(QObject *parent) 0012 : QObject(parent) 0013 { 0014 QClipboard *clipboard = QGuiApplication::clipboard(); 0015 connect(clipboard, &QClipboard::dataChanged, this, &ClipboardProxy::changed); 0016 connect(clipboard, &QClipboard::selectionChanged, this, &ClipboardProxy::changed); 0017 } 0018 0019 QStringList ClipboardProxy::mimeTypes() const 0020 { 0021 return QGuiApplication::clipboard()->mimeData()->formats(); 0022 }