diff options
author | obscuren <geffobscura@gmail.com> | 2015-02-19 18:51:38 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-02-19 18:51:38 +0800 |
commit | 0057bb4ef6d55b5d580a4e0421526a477ef93de9 (patch) | |
tree | c42682f9399bc59d9a1623a4b159231e434fa8d5 /ui/qt/clipboard/clipboard.cpp | |
parent | 03b8c6841be08f19db0f98cea6d0a6f4fd64736f (diff) | |
download | dexon-0057bb4ef6d55b5d580a4e0421526a477ef93de9.tar dexon-0057bb4ef6d55b5d580a4e0421526a477ef93de9.tar.gz dexon-0057bb4ef6d55b5d580a4e0421526a477ef93de9.tar.bz2 dexon-0057bb4ef6d55b5d580a4e0421526a477ef93de9.tar.lz dexon-0057bb4ef6d55b5d580a4e0421526a477ef93de9.tar.xz dexon-0057bb4ef6d55b5d580a4e0421526a477ef93de9.tar.zst dexon-0057bb4ef6d55b5d580a4e0421526a477ef93de9.zip |
WIP QT Clipboard
Diffstat (limited to 'ui/qt/clipboard/clipboard.cpp')
-rw-r--r-- | ui/qt/clipboard/clipboard.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/ui/qt/clipboard/clipboard.cpp b/ui/qt/clipboard/clipboard.cpp new file mode 100644 index 000000000..192aa7a2b --- /dev/null +++ b/ui/qt/clipboard/clipboard.cpp @@ -0,0 +1,20 @@ +#include "clipboard.h" + +#include <QClipboard> + +Clipboard::Clipboard() +{ + connect(QApplication::clipboard(), &QClipboard::dataChanged, [this] { emit clipboardChanged();}); +} + +QString Clipboard::get() const +{ + QClipboard *clipboard = QApplication::clipboard(); + return clipboard->text(); +} + +void Clipboard::toClipboard(QString _text) +{ + QClipboard *clipboard = QApplicationion::clipboard(); + clipboard->setText(_text); +} |