mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
26 lines
445 B
C++
26 lines
445 B
C++
#include "util/Clipboard.hpp"
|
|
#include <QApplication>
|
|
|
|
#include <QClipboard>
|
|
|
|
namespace chatterino {
|
|
|
|
void crossPlatformCopy(const QString &text)
|
|
{
|
|
auto clipboard = QApplication::clipboard();
|
|
|
|
clipboard->setText(text);
|
|
|
|
if (clipboard->supportsSelection())
|
|
{
|
|
clipboard->setText(text, QClipboard::Selection);
|
|
}
|
|
}
|
|
|
|
QString getClipboardText()
|
|
{
|
|
return QApplication::clipboard()->text();
|
|
}
|
|
|
|
} // namespace chatterino
|