mirror-chatterino2/src/util/Clipboard.cpp
Paweł 3023a44a21
Some fixes related to clipboard (#2405)
Also:
- Fixed capitalization of one method in `LoginDialog.cpp`
- Visually improved some strings in `LoginDialog.cpp`
- Added utility function getting clipboard content to `Clipboard.cpp`
- Made sure to use `crossPlatformCopy` in `UserInfoPopup.cpp`
2021-02-06 15:47:09 +01:00

24 lines
422 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);
}
}
QString getClipboardText()
{
return QApplication::clipboard()->text();
}
} // namespace chatterino