forked from qt-creator/qt-creator
Lua: Use "setClipboardAndSelection"
Change-Id: Ia5a16ebed44a47f44a16076e39cf8a21387b98ec Reviewed-by: Artur Twardy <atw@spyro-soft.com> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
|
||||
#include "utils.h"
|
||||
|
||||
#include <utils/stringutils.h>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QClipboard>
|
||||
#include <QCompleter>
|
||||
@@ -47,7 +49,7 @@ void setupQtModule()
|
||||
"text",
|
||||
sol::property(
|
||||
[](QClipboard &self) { return self.text(); },
|
||||
[](QClipboard &self, const QString &value) { self.setText(value); }));
|
||||
[](QClipboard &, const QString &text) { Utils::setClipboardAndSelection(text); }));
|
||||
|
||||
qt["clipboard"] = &QApplication::clipboard;
|
||||
|
||||
|
Reference in New Issue
Block a user