Compare commits

..

2 Commits

Author SHA1 Message Date
Oliver Sander
8e89c78936 Merge branch 'phabricator-d9615-textannotation-size' into 'master'
Fix calculation of TextAnnotation size

See merge request graphics/okular!412
2024-06-24 17:06:51 +00:00
Pratham Gandhi
e5900f9a4f created global qobject 2024-06-24 10:39:38 +05:30
4 changed files with 44 additions and 0 deletions

View File

@ -487,6 +487,7 @@ if (TARGET Qt6::Qml)
core/script/js_util.cpp
core/script/js_event.cpp
core/script/js_ocg.cpp
core/script/js_global.cpp
)
target_link_libraries(okularcore PRIVATE Qt6::Qml)
endif()

View File

@ -20,6 +20,7 @@
#include "js_event_p.h"
#include "js_field_p.h"
#include "js_fullscreen_p.h"
#include "js_global_p.h"
#include "js_ocg_p.h"
#include "js_spell_p.h"
#include "js_util_p.h"
@ -71,6 +72,7 @@ void ExecutorJSPrivate::initTypes()
m_interpreter.globalObject().setProperty(QStringLiteral("display"), m_interpreter.newQObject(new JSDisplay));
m_interpreter.globalObject().setProperty(QStringLiteral("spell"), m_interpreter.newQObject(new JSSpell));
m_interpreter.globalObject().setProperty(QStringLiteral("util"), m_interpreter.newQObject(new JSUtil));
m_interpreter.globalObject().setProperty(QStringLiteral("global"), m_interpreter.newQObject(new JSGlobal));
}
ExecutorJS::ExecutorJS(DocumentPrivate *doc)

16
core/script/js_global.cpp Normal file
View File

@ -0,0 +1,16 @@
/*
SPDX-FileCopyrightText: 2024 Pratham Gandhi <ppg.1382@gmail.com>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "js_global_p.h"
using namespace Okular;
JSGlobal::JSGlobal(QObject *parent)
: QObject(parent)
{
}
JSGlobal::~JSGlobal() = default;

25
core/script/js_global_p.h Normal file
View File

@ -0,0 +1,25 @@
/*
SPDX-FileCopyrightText: 2024 Pratham Gandhi <ppg.1382@gmail.com>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef OKULAR_SCRIPT_JS_GLOBAL_P_H
#define OKULAR_SCRIPT_JS_GLOBAL_P_H
#include <QObject>
namespace Okular
{
class JSGlobal : public QObject
{
Q_OBJECT
public:
explicit JSGlobal(QObject *parent = nullptr);
~JSGlobal() override;
};
}
#endif