mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
3023a44a21
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`
24 lines
422 B
C++
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
|