forked from qt-creator/qt-creator
Lua: Expose QCursor::pos() within Qt bindings
Change-Id: I59c4a08d4331012441b7a9a76895db6310aab583 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
|
||||
#include <QApplication>
|
||||
#include <QClipboard>
|
||||
#include <QCursor>
|
||||
#include <QCompleter>
|
||||
#include <QDir>
|
||||
#include <QFileDevice>
|
||||
@@ -54,6 +55,12 @@ void setupQtModule()
|
||||
|
||||
qt["clipboard"] = &QApplication::clipboard;
|
||||
|
||||
qt.new_usertype<QCursor>(
|
||||
"QCursor",
|
||||
sol::no_constructor,
|
||||
"pos", sol::resolve<QPoint()>(&QCursor::pos)
|
||||
);
|
||||
|
||||
qt.new_usertype<QFontMetrics>(
|
||||
"QFontMetrics",
|
||||
"create",
|
||||
|
@@ -34,6 +34,13 @@ qt.QClipboard = {}
|
||||
---@return QClipboard globalClipboard The global clipboard object.
|
||||
function qt.clipboard() end
|
||||
|
||||
--@class QCursor A Lua wrapper for the Qt `QCursor` class.
|
||||
qt.QCursor = {}
|
||||
|
||||
---Returns the position of the cursor (hot spot) of the primary screen in global screen coordinates.
|
||||
---@return QPoint position The position of the cursor.
|
||||
function qt.QCursor.pos() end
|
||||
|
||||
---@class QFontMetrics A Lua wrapper for the Qt `QFontMetrics` class.
|
||||
qt.QFontMetrics = {}
|
||||
|
||||
|
Reference in New Issue
Block a user