forked from qt-creator/qt-creator
Lua: Expose QClipboard class in Qt package
Change-Id: I931bf619b1f4e94ae651d7c5eb7d21e79f3dfc93 Reviewed-by: <lie@spyro-soft.com> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -5,6 +5,8 @@
|
|||||||
|
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
|
#include <QApplication>
|
||||||
|
#include <QClipboard>
|
||||||
#include <QCompleter>
|
#include <QCompleter>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
|
||||||
@@ -39,6 +41,16 @@ void setupQtModule()
|
|||||||
});})
|
});})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
qt.new_usertype<QClipboard>(
|
||||||
|
"QClipboard",
|
||||||
|
sol::call_constructor,
|
||||||
|
&QApplication::clipboard,
|
||||||
|
"text",
|
||||||
|
sol::property([](QClipboard &self) { return self.text(); },
|
||||||
|
[](QClipboard &self, const QString &value) { self.setText(value); })
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
mirrorEnum(qt, QMetaEnum::fromType<QCompleter::CompletionMode>(), "QCompleterCompletionMode");
|
mirrorEnum(qt, QMetaEnum::fromType<QCompleter::CompletionMode>(), "QCompleterCompletionMode");
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
|
@@ -27,6 +27,12 @@ function qt.QCompleter.create(params) end
|
|||||||
---@param function The function to be called when user choice is selected from popup.
|
---@param function The function to be called when user choice is selected from popup.
|
||||||
function qt.QCompleter.onActivated(function) end
|
function qt.QCompleter.onActivated(function) end
|
||||||
|
|
||||||
|
---@class QClipboard
|
||||||
|
--- A Lua wrapper for the Qt `QClipboard` class.
|
||||||
|
|
||||||
|
qt.QClipboard() Creates QClipboard object, which is a singleton instance of the system clipboard.
|
||||||
|
---@field text The text content of the clipboard. Gets or sets the text content of the clipboard.
|
||||||
|
|
||||||
---@enum TextElideMode
|
---@enum TextElideMode
|
||||||
qt.TextElideMode = {
|
qt.TextElideMode = {
|
||||||
ElideLeft = 0,
|
ElideLeft = 0,
|
||||||
|
Reference in New Issue
Block a user