2020-01-24 21:36:51 +01:00
|
|
|
#include "util/Clipboard.hpp"
|
|
|
|
#include <QApplication>
|
|
|
|
|
|
|
|
namespace chatterino {
|
|
|
|
|
|
|
|
void crossPlatformCopy(const QString &text)
|
|
|
|
{
|
|
|
|
auto clipboard = QApplication::clipboard();
|
2021-02-06 15:47:09 +01:00
|
|
|
|
2020-01-24 21:36:51 +01:00
|
|
|
clipboard->setText(text);
|
2021-02-06 15:47:09 +01:00
|
|
|
|
2020-01-24 21:36:51 +01:00
|
|
|
if (clipboard->supportsSelection())
|
|
|
|
{
|
|
|
|
clipboard->setText(text, QClipboard::Selection);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-02-06 15:47:09 +01:00
|
|
|
QString getClipboardText()
|
|
|
|
{
|
|
|
|
return QApplication::clipboard()->text();
|
|
|
|
}
|
|
|
|
|
2020-01-24 21:36:51 +01:00
|
|
|
} // namespace chatterino
|