KReport
17#include "KReportScriptSection.h"
19#include "KReportScriptLine.h"
20#include "KReportItemBase.h"
21#include "KReportPluginManager.h"
22#include "KReportPluginInterface.h"
23#include "KReportItemLine.h"
24#include "KReportSectionData.h"
25#include "kreport_debug.h"
29Section::Section(KReportSectionData* sec)
40QColor Section::backgroundColor()
const
42 return m_section->backgroundColor();
45void Section::setBackgroundColor(
const QColor &c)
47 m_section->setBackgroundColor(c);
50qreal Section::height()
const
52 return m_section->height();
55void Section::setHeight(qreal h)
57 m_section->setHeight(h);
60QString Section::name()
const
62 return m_section->objectName();
65QObject* Section::objectByNumber(
int i)
67 if (m_section->object(i)->typeName() == QLatin1String(
"line")) {
68 return new Scripting::Line(
dynamic_cast<KReportItemLine*
>(m_section->object(i)));
71 KReportPluginManager* manager = KReportPluginManager::self();
72 KReportPluginInterface *plugin = manager->plugin(m_section->object(i)->typeName());
74 QObject *obj = plugin->createScriptInstance(m_section->object(i));
80 kreportWarning() <<
"Encountered unknown node while parsing section: " << m_section->object(i)->typeName();
87QObject* Section::objectByName(
const QString& n)
89 for (
int i = 0; i < m_section->objects().count(); ++i) {
90 if (m_section->object(i)->entityName() == n) {
91 return objectByNumber(i);
97void Section::initialize(
const QJSValue &s)
102void Section::eventOnRender()
104 if (m_scriptObject.isObject() && m_scriptObject.hasProperty(QLatin1String(
"OnRender")))
105 m_scriptObject.
property(QLatin1String(
"OnRender")).
call();
Field item script interface.
QJSValue call(const QJSValueList &args) const const
QJSValue property(const QString &name) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:54:26 by
doxygen 1.13.2 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.