mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-08-24 16:25:08 +02:00
Add Window.x/y
This commit is contained in:
parent
9f977ecebd
commit
1088550ed7
2 changed files with 12 additions and 0 deletions
|
@ -358,3 +358,11 @@ int WindowScriptingInterface::getInnerWidth() {
|
|||
int WindowScriptingInterface::getInnerHeight() {
|
||||
return Application::getInstance()->getWindow()->geometry().height();
|
||||
}
|
||||
|
||||
int WindowScriptingInterface::getX() {
|
||||
return Application::getInstance()->getWindow()->x();
|
||||
}
|
||||
|
||||
int WindowScriptingInterface::getY() {
|
||||
return Application::getInstance()->getWindow()->y();
|
||||
}
|
||||
|
|
|
@ -20,10 +20,14 @@ class WindowScriptingInterface : public QObject {
|
|||
Q_OBJECT
|
||||
Q_PROPERTY(int innerWidth READ getInnerWidth)
|
||||
Q_PROPERTY(int innerHeight READ getInnerHeight)
|
||||
Q_PROPERTY(int x READ getX)
|
||||
Q_PROPERTY(int y READ getY)
|
||||
public:
|
||||
static WindowScriptingInterface* getInstance();
|
||||
int getInnerWidth();
|
||||
int getInnerHeight();
|
||||
int getX();
|
||||
int getY();
|
||||
|
||||
public slots:
|
||||
QScriptValue getCursorPositionX();
|
||||
|
|
Loading…
Reference in a new issue