Changeset View
Changeset View
Standalone View
Standalone View
src/plugins/web/KReportItemWeb.cpp
Show All 13 Lines | 1 | /* This file is part of the KDE project | |||
---|---|---|---|---|---|
14 | 14 | | |||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License | ||
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to | ||
17 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
18 | * Boston, MA 02110-1301, USA. | 18 | * Boston, MA 02110-1301, USA. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | #include "KReportItemWeb.h" | 21 | #include "KReportItemWeb.h" | ||
22 | #include <KReportRenderObjects.h> | 22 | #include "KReportUtils.h" | ||
23 | #include "KReportRenderObjects.h" | ||||
23 | 24 | | |||
24 | #include <KProperty> | 25 | #include <KProperty> | ||
25 | #include <KPropertySet> | 26 | #include <KPropertySet> | ||
26 | 27 | | |||
27 | #include <QGraphicsRectItem> | 28 | #include <QGraphicsRectItem> | ||
28 | #include <QUrl> | 29 | #include <QUrl> | ||
29 | #include <QWebPage> | 30 | #include <QWebPage> | ||
30 | #include <QWebFrame> | 31 | #include <QWebFrame> | ||
31 | #include <QPainter> | 32 | #include <QPainter> | ||
32 | 33 | | |||
33 | #include "kreportplugin_debug.h" | 34 | #include "kreportplugin_debug.h" | ||
34 | 35 | | |||
35 | KReportItemWeb::KReportItemWeb() : m_rendering(false) | 36 | KReportItemWeb::KReportItemWeb() : m_rendering(false) | ||
36 | { | 37 | { | ||
37 | createProperties(); | 38 | createProperties(); | ||
38 | m_webPage = new QWebPage(); | 39 | m_webPage = new QWebPage(); | ||
39 | connect(m_webPage, SIGNAL(loadFinished(bool)), this, SLOT(loadFinished(bool))); | 40 | connect(m_webPage, SIGNAL(loadFinished(bool)), this, SLOT(loadFinished(bool))); | ||
40 | } | 41 | } | ||
41 | 42 | | |||
42 | KReportItemWeb::KReportItemWeb(const QDomNode &element) | 43 | KReportItemWeb::KReportItemWeb(const QDomNode &element) | ||
43 | : KReportItemWeb() | 44 | : KReportItemWeb() | ||
44 | { | 45 | { | ||
46 | QDomElement e = element.toElement(); | ||||
47 | | ||||
48 | m_controlSource->setValue(e.attribute(QLatin1String("report:item-data-source"))); | ||||
49 | nameProperty()->setValue(KReportUtils::readNameAttribute(e)); | ||||
50 | setZ(e.attribute(QLatin1String("report:z-index")).toDouble()); | ||||
51 | parseReportRect(e); | ||||
45 | QDomNodeList nl = element.childNodes(); | 52 | QDomNodeList nl = element.childNodes(); | ||
46 | QString n; | 53 | QString n; | ||
47 | QDomNode node; | 54 | QDomNode node; | ||
48 | QDomElement e = element.toElement(); | | |||
49 | | ||||
50 | m_controlSource->setValue(element.toElement().attribute(QLatin1String("report:item-data-source"))); | | |||
51 | nameProperty()->setValue(element.toElement().attribute(QLatin1String("report:name"))); | | |||
52 | setZ(element.toElement().attribute(QLatin1String("report:z-index")).toDouble()); | | |||
53 | parseReportRect(element.toElement()); | | |||
54 | for (int i = 0; i < nl.count(); i++) { | 55 | for (int i = 0; i < nl.count(); i++) { | ||
55 | node = nl.item(i); | 56 | node = nl.item(i); | ||
56 | n = node.nodeName(); | 57 | n = node.nodeName(); | ||
57 | } | 58 | } | ||
58 | } | 59 | } | ||
59 | 60 | | |||
60 | void KReportItemWeb::createProperties() | 61 | void KReportItemWeb::createProperties() | ||
61 | { | 62 | { | ||
▲ Show 20 Lines • Show All 76 Lines • Show Last 20 Lines |