mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
00414eb779
* Introduce crossPlatformCopy() It sets the text of the clipboard and also syncs it with the selection clipboard if it is supported. Such behaviour is pretty common for X11 application on Unix-like Operating Systems. * Fix clang-format remarks * Fix weird clang-format config discrepancy between my machine and CI * Remove clipboard argument from crossPlatformCopy * Fix clang-format remarks
17 lines
342 B
C++
17 lines
342 B
C++
#include "util/Clipboard.hpp"
|
|
#include <QApplication>
|
|
|
|
namespace chatterino {
|
|
|
|
void crossPlatformCopy(const QString &text)
|
|
{
|
|
auto clipboard = QApplication::clipboard();
|
|
clipboard->setText(text);
|
|
if (clipboard->supportsSelection())
|
|
{
|
|
clipboard->setText(text, QClipboard::Selection);
|
|
}
|
|
}
|
|
|
|
} // namespace chatterino
|