mirror of
https://invent.kde.org/graphics/okular
synced 2024-09-28 20:24:09 +00:00
created global qobject
This commit is contained in:
parent
b0ba4a343d
commit
e5900f9a4f
|
@ -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()
|
||||
|
|
|
@ -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
16
core/script/js_global.cpp
Normal 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
25
core/script/js_global_p.h
Normal 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
|
Loading…
Reference in a new issue