0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-24 16:44:39 +03:00

QJSEngine will be used if Qt version 5.6 and higher

This commit is contained in:
Arin Alexander 2017-12-14 02:28:52 +03:00
parent 41dec61d02
commit 09754e6906
6 changed files with 319 additions and 183 deletions

View File

@ -4,10 +4,13 @@ CONFIG *= build_translations
CONFIG *= zint CONFIG *= zint
} }
!contains(CONFIG, qtscriptengine){ !contains(CONFIG, qtscriptengine):
greaterThan(QT_MAJOR_VERSION, 4):
greaterThan(QT_MINOR_VERSION, 5){
CONFIG *= qjsengine CONFIG *= qjsengine
} }
!contains(CONFIG, no_formdesigner){ !contains(CONFIG, no_formdesigner){
CONFIG *= dialogdesigner CONFIG *= dialogdesigner
} }

View File

@ -1,27 +1,27 @@
<?xml version="1.0" encoding="UTF8"?> <?xml version="1.0" encoding="UTF8"?>
<Report> <Report>
<object ClassName="LimeReport::ReportEnginePrivate" Type="Object"> <object Type="Object" ClassName="LimeReport::ReportEnginePrivate">
<objectName Type="QString"></objectName> <objectName Type="QString"></objectName>
<pages Type="Collection"> <pages Type="Collection">
<item ClassName="LimeReport::PageDesignIntf" Type="Object"> <item Type="Object" ClassName="LimeReport::PageDesignIntf">
<objectName Type="QString">page1</objectName> <objectName Type="QString">page1</objectName>
<sceneRect Type="QRect" width="2200" x="-50" y="-50" height="3070"/> <sceneRect Type="QRect" x="-50" y="-50" width="2200" height="3070"/>
<bspTreeDepth Value="5" Type="int"/> <bspTreeDepth Value="5" Type="int"/>
<font stylename="" Type="QFont" pointSize="8" underline="0" family="MS Shell Dlg 2" weight="50" italic="0"/> <font underline="0" Type="QFont" italic="0" family="MS Shell Dlg 2" weight="50" pointSize="8" stylename=""/>
<sortCacheEnabled Value="0" Type="bool"/> <sortCacheEnabled Value="0" Type="bool"/>
<stickyFocus Value="0" Type="bool"/> <stickyFocus Value="0" Type="bool"/>
<minimumRenderSize Value="0" Type="qreal"/> <minimumRenderSize Value="0" Type="qreal"/>
<pageItem ClassName="PageItem" Type="Object"> <pageItem Type="Object" ClassName="PageItem">
<objectName Type="QString">ReportPage1</objectName> <objectName Type="QString">ReportPage1</objectName>
<geometry Type="QRect" width="2100" x="0" y="0" height="2970"/> <geometry Type="QRect" x="0" y="0" width="2100" height="2970"/>
<children Type="Collection"> <children Type="Collection">
<item ClassName="Data" Type="Object"> <item Type="Object" ClassName="Data">
<objectName Type="QString">DataBand1</objectName> <objectName Type="QString">DataBand1</objectName>
<geometry Type="QRect" width="2000" x="50" y="306" height="110"/> <geometry Type="QRect" x="50" y="306" width="2000" height="110"/>
<children Type="Collection"> <children Type="Collection">
<item ClassName="TextItem" Type="Object"> <item Type="Object" ClassName="TextItem">
<objectName Type="QString">TextItem2</objectName> <objectName Type="QString">TextItem2</objectName>
<geometry Type="QRect" width="814" x="38" y="32" height="50"/> <geometry Type="QRect" x="38" y="32" width="814" height="50"/>
<children Type="Collection"/> <children Type="Collection"/>
<zOrder Value="0" Type="qreal"/> <zOrder Value="0" Type="qreal"/>
<borders Value="0" Type="enumAndFlags"/> <borders Value="0" Type="enumAndFlags"/>
@ -51,7 +51,7 @@ if ($D{customers.CustomerID}=="ANTON"){
<alignment Value="33" Type="enumAndFlags"/> <alignment Value="33" Type="enumAndFlags"/>
<autoWidth Value="0" Type="enumAndFlags"/> <autoWidth Value="0" Type="enumAndFlags"/>
<autoHeight Value="0" Type="bool"/> <autoHeight Value="0" Type="bool"/>
<font stylename="" Type="QFont" pointSize="10" underline="0" family="Arial" weight="50" italic="0"/> <font underline="0" Type="QFont" italic="0" family="Arial" weight="50" pointSize="10" stylename=""/>
<backgroundOpacity Value="100" Type="int"/> <backgroundOpacity Value="100" Type="int"/>
<backgroundMode Value="1" Type="enumAndFlags"/> <backgroundMode Value="1" Type="enumAndFlags"/>
<backgroundColor Value="#ffffff" Type="QColor"/> <backgroundColor Value="#ffffff" Type="QColor"/>
@ -65,6 +65,13 @@ if ($D{customers.CustomerID}=="ANTON"){
<underlineLineSize Value="1" Type="int"/> <underlineLineSize Value="1" Type="int"/>
<allowHTML Value="1" Type="bool"/> <allowHTML Value="1" Type="bool"/>
<allowHTMLInFields Value="0" Type="bool"/> <allowHTMLInFields Value="0" Type="bool"/>
<format Type="QString"></format>
<valueType Value="0" Type="enumAndFlags"/>
<followTo Type="QString"></followTo>
<backgroundBrushStyle Value="1" Type="enumAndFlags"/>
<textIndent Value="0" Type="qreal"/>
<textLayoutDirection Value="2" Type="enumAndFlags"/>
<fillInSecondPass Value="0" Type="bool"/>
</item> </item>
</children> </children>
<zOrder Value="0" Type="qreal"/> <zOrder Value="0" Type="qreal"/>
@ -78,6 +85,7 @@ if ($D{customers.CustomerID}=="ANTON"){
<keepBottomSpace Value="0" Type="bool"/> <keepBottomSpace Value="0" Type="bool"/>
<parentBand Type="QString"></parentBand> <parentBand Type="QString"></parentBand>
<backgroundColor Value="#ffffff" Type="QColor"/> <backgroundColor Value="#ffffff" Type="QColor"/>
<backgroundBrushStyle Value="1" Type="enumAndFlags"/>
<printIfEmpty Value="0" Type="bool"/> <printIfEmpty Value="0" Type="bool"/>
<datasource Type="QString">customers</datasource> <datasource Type="QString">customers</datasource>
<keepSubdetailTogether Value="0" Type="bool"/> <keepSubdetailTogether Value="0" Type="bool"/>
@ -88,14 +96,16 @@ if ($D{customers.CustomerID}=="ANTON"){
<columnsFillDirection Value="0" Type="enumAndFlags"/> <columnsFillDirection Value="0" Type="enumAndFlags"/>
<startNewPage Value="0" Type="bool"/> <startNewPage Value="0" Type="bool"/>
<startFromNewPage Value="0" Type="bool"/> <startFromNewPage Value="0" Type="bool"/>
<alternateBackgroundColor Value="#ffffff" Type="QColor"/>
<useAlternateBackgroundColor Value="0" Type="bool"/>
</item> </item>
<item ClassName="ReportHeader" Type="Object"> <item Type="Object" ClassName="ReportHeader">
<objectName Type="QString">ReportHeader1</objectName> <objectName Type="QString">ReportHeader1</objectName>
<geometry Type="QRect" width="2000" x="50" y="50" height="252"/> <geometry Type="QRect" x="50" y="50" width="2000" height="252"/>
<children Type="Collection"> <children Type="Collection">
<item ClassName="TextItem" Type="Object"> <item Type="Object" ClassName="TextItem">
<objectName Type="QString">TextItem1</objectName> <objectName Type="QString">TextItem1</objectName>
<geometry Type="QRect" width="816" x="6" y="12" height="222"/> <geometry Type="QRect" x="6" y="12" width="816" height="222"/>
<children Type="Collection"/> <children Type="Collection"/>
<zOrder Value="0" Type="qreal"/> <zOrder Value="0" Type="qreal"/>
<borders Value="0" Type="enumAndFlags"/> <borders Value="0" Type="enumAndFlags"/>
@ -107,10 +117,10 @@ if ($D{customers.CustomerID}=="ANTON"){
<stretchToMaxHeight Value="0" Type="bool"/> <stretchToMaxHeight Value="0" Type="bool"/>
<itemAlign Value="4" Type="enumAndFlags"/> <itemAlign Value="4" Type="enumAndFlags"/>
<content Type="QString">$S{ <content Type="QString">$S{
var color = new QColor('#DEB887'); var color = LimeReport.color('#DEB887');
var font = new QFont('Times New Roman',26,false,true); var font = LimeReport.font('Times New Roman',26,false,true);
THIS.backgroundColor = color; THIS.backgroundColor = color;
THIS.fontColor = QColor('red'); THIS.fontColor = LimeReport.color('red');
THIS.font = font; THIS.font = font;
'Test'}</content> 'Test'}</content>
@ -118,7 +128,7 @@ THIS.font = font;
<alignment Value="33" Type="enumAndFlags"/> <alignment Value="33" Type="enumAndFlags"/>
<autoWidth Value="0" Type="enumAndFlags"/> <autoWidth Value="0" Type="enumAndFlags"/>
<autoHeight Value="0" Type="bool"/> <autoHeight Value="0" Type="bool"/>
<font stylename="" Type="QFont" pointSize="10" underline="0" family="Times New Roman" weight="50" italic="0"/> <font underline="0" Type="QFont" italic="0" family="Times New Roman" weight="50" pointSize="10" stylename=""/>
<backgroundOpacity Value="100" Type="int"/> <backgroundOpacity Value="100" Type="int"/>
<backgroundMode Value="1" Type="enumAndFlags"/> <backgroundMode Value="1" Type="enumAndFlags"/>
<backgroundColor Value="#ffffff" Type="QColor"/> <backgroundColor Value="#ffffff" Type="QColor"/>
@ -132,10 +142,17 @@ THIS.font = font;
<underlineLineSize Value="1" Type="int"/> <underlineLineSize Value="1" Type="int"/>
<allowHTML Value="0" Type="bool"/> <allowHTML Value="0" Type="bool"/>
<allowHTMLInFields Value="0" Type="bool"/> <allowHTMLInFields Value="0" Type="bool"/>
<format Type="QString"></format>
<valueType Value="0" Type="enumAndFlags"/>
<followTo Type="QString"></followTo>
<backgroundBrushStyle Value="1" Type="enumAndFlags"/>
<textIndent Value="0" Type="qreal"/>
<textLayoutDirection Value="2" Type="enumAndFlags"/>
<fillInSecondPass Value="0" Type="bool"/>
</item> </item>
<item ClassName="TextItem" Type="Object"> <item Type="Object" ClassName="TextItem">
<objectName Type="QString">TextItem3</objectName> <objectName Type="QString">TextItem3</objectName>
<geometry Type="QRect" width="408" x="878" y="44" height="86"/> <geometry Type="QRect" x="878" y="44" width="408" height="86"/>
<children Type="Collection"/> <children Type="Collection"/>
<zOrder Value="0" Type="qreal"/> <zOrder Value="0" Type="qreal"/>
<borders Value="0" Type="enumAndFlags"/> <borders Value="0" Type="enumAndFlags"/>
@ -151,7 +168,7 @@ THIS.font = font;
<alignment Value="33" Type="enumAndFlags"/> <alignment Value="33" Type="enumAndFlags"/>
<autoWidth Value="0" Type="enumAndFlags"/> <autoWidth Value="0" Type="enumAndFlags"/>
<autoHeight Value="0" Type="bool"/> <autoHeight Value="0" Type="bool"/>
<font stylename="" Type="QFont" pointSize="10" underline="0" family="Arial" weight="50" italic="0"/> <font underline="0" Type="QFont" italic="0" family="Arial" weight="50" pointSize="10" stylename=""/>
<backgroundOpacity Value="100" Type="int"/> <backgroundOpacity Value="100" Type="int"/>
<backgroundMode Value="1" Type="enumAndFlags"/> <backgroundMode Value="1" Type="enumAndFlags"/>
<backgroundColor Value="#ffffff" Type="QColor"/> <backgroundColor Value="#ffffff" Type="QColor"/>
@ -165,6 +182,13 @@ THIS.font = font;
<underlineLineSize Value="1" Type="int"/> <underlineLineSize Value="1" Type="int"/>
<allowHTML Value="1" Type="bool"/> <allowHTML Value="1" Type="bool"/>
<allowHTMLInFields Value="0" Type="bool"/> <allowHTMLInFields Value="0" Type="bool"/>
<format Type="QString"></format>
<valueType Value="0" Type="enumAndFlags"/>
<followTo Type="QString"></followTo>
<backgroundBrushStyle Value="1" Type="enumAndFlags"/>
<textIndent Value="0" Type="qreal"/>
<textLayoutDirection Value="2" Type="enumAndFlags"/>
<fillInSecondPass Value="0" Type="bool"/>
</item> </item>
</children> </children>
<zOrder Value="0" Type="qreal"/> <zOrder Value="0" Type="qreal"/>
@ -178,8 +202,10 @@ THIS.font = font;
<keepBottomSpace Value="0" Type="bool"/> <keepBottomSpace Value="0" Type="bool"/>
<parentBand Type="QString"></parentBand> <parentBand Type="QString"></parentBand>
<backgroundColor Value="#ffffff" Type="QColor"/> <backgroundColor Value="#ffffff" Type="QColor"/>
<backgroundBrushStyle Value="1" Type="enumAndFlags"/>
<printIfEmpty Value="0" Type="bool"/> <printIfEmpty Value="0" Type="bool"/>
<splittable Value="0" Type="bool"/> <splittable Value="0" Type="bool"/>
<printBeforePageHeader Value="0" Type="bool"/>
</item> </item>
</children> </children>
<zOrder Value="0" Type="qreal"/> <zOrder Value="0" Type="qreal"/>
@ -197,13 +223,19 @@ THIS.font = font;
<gridStep Value="2" Type="int"/> <gridStep Value="2" Type="int"/>
<fullPage Value="0" Type="bool"/> <fullPage Value="0" Type="bool"/>
<oldPrintMode Value="0" Type="bool"/> <oldPrintMode Value="0" Type="bool"/>
<resetPageNumber Value="0" Type="bool"/>
<isExtendedInDesignMode Value="0" Type="bool"/>
<extendedHeight Value="1000" Type="int"/>
<pageIsTOC Value="0" Type="bool"/>
<setPageSizeToPrinter Value="0" Type="bool"/>
<endlessHeight Value="0" Type="bool"/>
</pageItem> </pageItem>
</item> </item>
</pages> </pages>
<datasourcesManager ClassName="LimeReport::DataSourceManager" Type="Object"> <datasourcesManager Type="Object" ClassName="LimeReport::DataSourceManager">
<objectName Type="QString">datasources</objectName> <objectName Type="QString">datasources</objectName>
<connections Type="Collection"> <connections Type="Collection">
<item ClassName="LimeReport::ConnectionDesc" Type="Object"> <item Type="Object" ClassName="LimeReport::ConnectionDesc">
<objectName Type="QString"></objectName> <objectName Type="QString"></objectName>
<name Type="QString">test</name> <name Type="QString">test</name>
<driver Type="QString">QSQLITE</driver> <driver Type="QString">QSQLITE</driver>
@ -212,10 +244,11 @@ THIS.font = font;
<password Value="" Type="QString"/> <password Value="" Type="QString"/>
<host Type="QString"></host> <host Type="QString"></host>
<autoconnect Value="0" Type="bool"/> <autoconnect Value="0" Type="bool"/>
<keepDBCredentials Value="1" Type="bool"/>
</item> </item>
</connections> </connections>
<queries Type="Collection"> <queries Type="Collection">
<item ClassName="LimeReport::QueryDesc" Type="Object"> <item Type="Object" ClassName="LimeReport::QueryDesc">
<objectName Type="QString"></objectName> <objectName Type="QString"></objectName>
<queryName Type="QString">customers</queryName> <queryName Type="QString">customers</queryName>
<queryText Type="QString">Select * from customers limit 5</queryText> <queryText Type="QString">Select * from customers limit 5</queryText>
@ -225,18 +258,21 @@ THIS.font = font;
<subqueries Type="Collection"/> <subqueries Type="Collection"/>
<subproxies Type="Collection"/> <subproxies Type="Collection"/>
<variables Type="Collection"> <variables Type="Collection">
<item ClassName="LimeReport::VarDesc" Type="Object"> <item Type="Object" ClassName="LimeReport::VarDesc">
<objectName Type="QString"></objectName> <objectName Type="QString"></objectName>
<name Type="QString">TestName</name> <name Type="QString">TestName</name>
<value Type="QString">TestValue</value> <value Type="QString">TestValue</value>
<isMandatory Value="0" Type="bool"/>
<dataType Value="0" Type="int"/>
</item> </item>
</variables> </variables>
</datasourcesManager> </datasourcesManager>
<scriptContext ClassName="LimeReport::ScriptEngineContext" Type="Object"> <scriptContext Type="Object" ClassName="LimeReport::ScriptEngineContext">
<objectName Type="QString"></objectName> <objectName Type="QString"></objectName>
<dialogs Type="Collection"/> <dialogs Type="Collection"/>
<initScript Type="QString"></initScript> <initScript Type="QString"></initScript>
</scriptContext> </scriptContext>
<suppressFieldAndVarError Value="0" Type="bool"/> <suppressFieldAndVarError Value="0" Type="bool"/>
<translation Type="Translation"/>
</object> </object>
</Report> </Report>

View File

@ -1,35 +1,37 @@
<?xml version="1.0" encoding="UTF8"?>
<Report> <Report>
<object ClassName="LimeReport::ReportEnginePrivate" Type="Object"> <object Type="Object" ClassName="LimeReport::ReportEnginePrivate">
<objectName Type="QString"></objectName> <objectName Type="QString"></objectName>
<pages Type="Collection"> <pages Type="Collection">
<item ClassName="LimeReport::PageDesignIntf" Type="Object"> <item Type="Object" ClassName="LimeReport::PageDesignIntf">
<objectName Type="QString">page1</objectName> <objectName Type="QString">page1</objectName>
<sceneRect x="-50" y="-50" Type="QRect" width="2200" height="3070"/> <sceneRect x="-50" Type="QRect" width="2200" y="-50" height="3070"/>
<bspTreeDepth Value="5" Type="int"/> <bspTreeDepth Type="int" Value="5"/>
<font Type="QFont" italic="0" bold="0" underline="0" family="MS Shell Dlg 2" pointSize="8"/> <font weight="50" Type="QFont" pointSize="8" stylename="" underline="0" family="MS Shell Dlg 2" italic="0"/>
<sortCacheEnabled Value="0" Type="bool"/> <sortCacheEnabled Type="bool" Value="0"/>
<stickyFocus Value="0" Type="bool"/> <stickyFocus Type="bool" Value="0"/>
<minimumRenderSize Value="0" Type="qreal"/> <minimumRenderSize Type="qreal" Value="0"/>
<pageItem ClassName="PageItem" Type="Object"> <pageItem Type="Object" ClassName="PageItem">
<objectName Type="QString">ReportPage1</objectName> <objectName Type="QString">ReportPage1</objectName>
<geometry x="0" y="0" Type="QRect" width="2100" height="2970"/> <geometry x="0" Type="QRect" width="2100" y="0" height="2970"/>
<children Type="Collection"> <children Type="Collection">
<item ClassName="Data" Type="Object"> <item Type="Object" ClassName="Data">
<objectName Type="QString">DataBand1</objectName> <objectName Type="QString">DataBand1</objectName>
<geometry x="50" y="306" Type="QRect" width="2000" height="110"/> <geometry x="50" Type="QRect" width="2000" y="306" height="110"/>
<children Type="Collection"> <children Type="Collection">
<item ClassName="TextItem" Type="Object"> <item Type="Object" ClassName="TextItem">
<objectName Type="QString">TextItem2</objectName> <objectName Type="QString">TextItem2</objectName>
<geometry x="28" y="18" Type="QRect" width="814" height="50"/> <geometry x="38" Type="QRect" width="814" y="32" height="50"/>
<children Type="Collection"/> <children Type="Collection"/>
<zOrder Value="0" Type="qreal"/> <zOrder Type="qreal" Value="0"/>
<borders Value="0" Type="enumAndFlags"/> <borders Type="enumAndFlags" Value="0"/>
<parentName Type="QString">DataBand1</parentName> <parentName Type="QString">DataBand1</parentName>
<borderLineSize Value="1" Type="int"/> <borderLineSize Type="int" Value="1"/>
<isVisible Value="1" Type="bool"/> <isVisible Type="bool" Value="1"/>
<itemLocation Value="1" Type="enumAndFlags"/> <borderColor Type="QColor" Value="#000000"/>
<stretchToMaxHeight Value="0" Type="bool"/> <itemLocation Type="enumAndFlags" Value="1"/>
<itemAlign Value="4" Type="enumAndFlags"/> <stretchToMaxHeight Type="bool" Value="0"/>
<itemAlign Type="enumAndFlags" Value="4"/>
<content Type="QString">$S{ <content Type="QString">$S{
var selectedItemBegin = '&lt;span style="background:black; color:red; font-weight:bold ">'; var selectedItemBegin = '&lt;span style="background:black; color:red; font-weight:bold ">';
@ -45,152 +47,208 @@ if ($D{customers.CustomerID}=="ANTON"){
'&lt;span>Customer: &lt;/span>'+customer; '&lt;span>Customer: &lt;/span>'+customer;
}</content> }</content>
<margin Value="4" Type="int"/> <margin Type="int" Value="4"/>
<alignment Value="33" Type="enumAndFlags"/> <alignment Type="enumAndFlags" Value="33"/>
<autoWidth Value="0" Type="enumAndFlags"/> <autoWidth Type="enumAndFlags" Value="0"/>
<autoHeight Value="0" Type="bool"/> <autoHeight Type="bool" Value="0"/>
<font Type="QFont" italic="0" bold="0" underline="0" family="Arial" pointSize="10"/> <font weight="50" Type="QFont" pointSize="10" stylename="" underline="0" family="Arial" italic="0"/>
<backgroundOpacity Value="100" Type="int"/> <backgroundOpacity Type="int" Value="100"/>
<backgroundMode Value="1" Type="enumAndFlags"/> <backgroundMode Type="enumAndFlags" Value="1"/>
<backgroundColor Value="#ffffff" Type="QColor"/> <backgroundColor Type="QColor" Value="#ffffff"/>
<fontColor Value="#000000" Type="QColor"/> <fontColor Type="QColor" Value="#000000"/>
<angle Value="0" Type="enumAndFlags"/> <angle Type="enumAndFlags" Value="0"/>
<foregroundOpacity Value="100" Type="int"/> <foregroundOpacity Type="int" Value="100"/>
<trimValue Value="1" Type="bool"/> <underlines Type="bool" Value="0"/>
<allowHTML Value="1" Type="bool"/> <adaptFontToSize Type="bool" Value="0"/>
<trimValue Type="bool" Value="1"/>
<lineSpacing Type="int" Value="1"/>
<underlineLineSize Type="int" Value="1"/>
<allowHTML Type="bool" Value="1"/>
<allowHTMLInFields Type="bool" Value="0"/>
<format Type="QString"></format>
<valueType Type="enumAndFlags" Value="0"/>
<followTo Type="QString"></followTo>
<backgroundBrushStyle Type="enumAndFlags" Value="1"/>
<textIndent Type="qreal" Value="0"/>
<textLayoutDirection Type="enumAndFlags" Value="2"/>
<fillInSecondPass Type="bool" Value="0"/>
</item> </item>
</children> </children>
<zOrder Value="0" Type="qreal"/> <zOrder Type="qreal" Value="0"/>
<borders Value="0" Type="enumAndFlags"/> <borders Type="enumAndFlags" Value="0"/>
<parentName Type="QString">ReportPage1</parentName> <parentName Type="QString">ReportPage1</parentName>
<borderLineSize Value="1" Type="int"/> <borderLineSize Type="int" Value="1"/>
<isVisible Value="1" Type="bool"/> <isVisible Type="bool" Value="1"/>
<autoHeight Value="1" Type="bool"/> <borderColor Type="QColor" Value="#000000"/>
<bandIndex Value="4" Type="int"/> <autoHeight Type="bool" Value="1"/>
<keepBottomSpace Value="0" Type="bool"/> <bandIndex Type="int" Value="4"/>
<keepBottomSpace Type="bool" Value="0"/>
<parentBand Type="QString"></parentBand> <parentBand Type="QString"></parentBand>
<backgroundColor Value="#ffffff" Type="QColor"/> <backgroundColor Type="QColor" Value="#ffffff"/>
<printIfEmpty Value="0" Type="bool"/> <backgroundBrushStyle Type="enumAndFlags" Value="1"/>
<printIfEmpty Type="bool" Value="0"/>
<datasource Type="QString">customers</datasource> <datasource Type="QString">customers</datasource>
<keepSubdetailTogether Value="0" Type="bool"/> <keepSubdetailTogether Type="bool" Value="0"/>
<splittable Value="0" Type="bool"/> <splittable Type="bool" Value="0"/>
<keepFooterTogether Value="0" Type="bool"/> <keepFooterTogether Type="bool" Value="0"/>
<sliceLastRow Value="0" Type="bool"/> <sliceLastRow Type="bool" Value="0"/>
<columnsCount Value="1" Type="int"/> <columnsCount Type="int" Value="1"/>
<columnsFillDirection Value="0" Type="enumAndFlags"/> <columnsFillDirection Type="enumAndFlags" Value="0"/>
<startNewPage Value="0" Type="bool"/> <startNewPage Type="bool" Value="0"/>
<startFromNewPage Type="bool" Value="0"/>
<alternateBackgroundColor Type="QColor" Value="#ffffff"/>
<useAlternateBackgroundColor Type="bool" Value="0"/>
</item> </item>
<item ClassName="ReportHeader" Type="Object"> <item Type="Object" ClassName="ReportHeader">
<objectName Type="QString">ReportHeader1</objectName> <objectName Type="QString">ReportHeader1</objectName>
<geometry x="50" y="50" Type="QRect" width="2000" height="252"/> <geometry x="50" Type="QRect" width="2000" y="50" height="252"/>
<children Type="Collection"> <children Type="Collection">
<item ClassName="TextItem" Type="Object"> <item Type="Object" ClassName="TextItem">
<objectName Type="QString">TextItem1</objectName> <objectName Type="QString">TextItem1</objectName>
<geometry x="6" y="12" Type="QRect" width="816" height="222"/> <geometry x="6" Type="QRect" width="816" y="12" height="222"/>
<children Type="Collection"/> <children Type="Collection"/>
<zOrder Value="0" Type="qreal"/> <zOrder Type="qreal" Value="0"/>
<borders Value="0" Type="enumAndFlags"/> <borders Type="enumAndFlags" Value="0"/>
<parentName Type="QString">ReportHeader1</parentName> <parentName Type="QString">ReportHeader1</parentName>
<borderLineSize Value="1" Type="int"/> <borderLineSize Type="int" Value="1"/>
<isVisible Value="1" Type="bool"/> <isVisible Type="bool" Value="1"/>
<itemLocation Value="1" Type="enumAndFlags"/> <borderColor Type="QColor" Value="#000000"/>
<stretchToMaxHeight Value="0" Type="bool"/> <itemLocation Type="enumAndFlags" Value="1"/>
<itemAlign Value="4" Type="enumAndFlags"/> <stretchToMaxHeight Type="bool" Value="0"/>
<itemAlign Type="enumAndFlags" Value="4"/>
<content Type="QString">$S{ <content Type="QString">$S{
var color = new QColor('#DEB887'); var color = LimeReport.color('#DEB887');
var font = new QFont('Times New Roman',26,false,true); var font = LimeReport.font('Times New Roman',26,false,true);
THIS.backgroundColor = color; THIS.backgroundColor = color;
THIS.fontColor = QColor('red'); THIS.fontColor = LimeReport.color('red');
THIS.font = font; THIS.font = font;
'Test'}</content> 'Test'}</content>
<margin Value="4" Type="int"/> <margin Type="int" Value="4"/>
<alignment Value="33" Type="enumAndFlags"/> <alignment Type="enumAndFlags" Value="33"/>
<autoWidth Value="0" Type="enumAndFlags"/> <autoWidth Type="enumAndFlags" Value="0"/>
<autoHeight Value="0" Type="bool"/> <autoHeight Type="bool" Value="0"/>
<font Type="QFont" italic="0" bold="0" underline="0" family="Times New Roman" pointSize="10"/> <font weight="50" Type="QFont" pointSize="10" stylename="" underline="0" family="Times New Roman" italic="0"/>
<backgroundOpacity Value="100" Type="int"/> <backgroundOpacity Type="int" Value="100"/>
<backgroundMode Value="1" Type="enumAndFlags"/> <backgroundMode Type="enumAndFlags" Value="1"/>
<backgroundColor Value="#ffffff" Type="QColor"/> <backgroundColor Type="QColor" Value="#ffffff"/>
<fontColor Value="#000000" Type="QColor"/> <fontColor Type="QColor" Value="#000000"/>
<angle Value="0" Type="enumAndFlags"/> <angle Type="enumAndFlags" Value="0"/>
<foregroundOpacity Value="100" Type="int"/> <foregroundOpacity Type="int" Value="100"/>
<trimValue Value="1" Type="bool"/> <underlines Type="bool" Value="0"/>
<allowHTML Value="1" Type="bool"/> <adaptFontToSize Type="bool" Value="0"/>
<trimValue Type="bool" Value="1"/>
<lineSpacing Type="int" Value="1"/>
<underlineLineSize Type="int" Value="1"/>
<allowHTML Type="bool" Value="0"/>
<allowHTMLInFields Type="bool" Value="0"/>
<format Type="QString"></format>
<valueType Type="enumAndFlags" Value="0"/>
<followTo Type="QString"></followTo>
<backgroundBrushStyle Type="enumAndFlags" Value="1"/>
<textIndent Type="qreal" Value="0"/>
<textLayoutDirection Type="enumAndFlags" Value="2"/>
<fillInSecondPass Type="bool" Value="0"/>
</item> </item>
<item ClassName="TextItem" Type="Object"> <item Type="Object" ClassName="TextItem">
<objectName Type="QString">TextItem3</objectName> <objectName Type="QString">TextItem3</objectName>
<geometry x="878" y="44" Type="QRect" width="408" height="86"/> <geometry x="878" Type="QRect" width="408" y="44" height="86"/>
<children Type="Collection"/> <children Type="Collection"/>
<zOrder Value="0" Type="qreal"/> <zOrder Type="qreal" Value="0"/>
<borders Value="0" Type="enumAndFlags"/> <borders Type="enumAndFlags" Value="0"/>
<parentName Type="QString">ReportHeader1</parentName> <parentName Type="QString">ReportHeader1</parentName>
<borderLineSize Value="1" Type="int"/> <borderLineSize Type="int" Value="1"/>
<isVisible Value="1" Type="bool"/> <isVisible Type="bool" Value="1"/>
<itemLocation Value="0" Type="enumAndFlags"/> <borderColor Type="QColor" Value="#000000"/>
<stretchToMaxHeight Value="0" Type="bool"/> <itemLocation Type="enumAndFlags" Value="0"/>
<itemAlign Value="4" Type="enumAndFlags"/> <stretchToMaxHeight Type="bool" Value="0"/>
<itemAlign Type="enumAndFlags" Value="4"/>
<content Type="QString">&lt;p> &lt;span>test1&lt;/span> &lt;span style="background:red">test&lt;/span> &lt;/p></content> <content Type="QString">&lt;p> &lt;span>test1&lt;/span> &lt;span style="background:red">test&lt;/span> &lt;/p></content>
<margin Value="4" Type="int"/> <margin Type="int" Value="4"/>
<alignment Value="33" Type="enumAndFlags"/> <alignment Type="enumAndFlags" Value="33"/>
<autoWidth Value="0" Type="enumAndFlags"/> <autoWidth Type="enumAndFlags" Value="0"/>
<autoHeight Value="0" Type="bool"/> <autoHeight Type="bool" Value="0"/>
<font Type="QFont" italic="0" bold="0" underline="0" family="Arial" pointSize="10"/> <font weight="50" Type="QFont" pointSize="10" stylename="" underline="0" family="Arial" italic="0"/>
<backgroundOpacity Value="100" Type="int"/> <backgroundOpacity Type="int" Value="100"/>
<backgroundMode Value="1" Type="enumAndFlags"/> <backgroundMode Type="enumAndFlags" Value="1"/>
<backgroundColor Value="#ffffff" Type="QColor"/> <backgroundColor Type="QColor" Value="#ffffff"/>
<fontColor Value="#000000" Type="QColor"/> <fontColor Type="QColor" Value="#000000"/>
<angle Value="0" Type="enumAndFlags"/> <angle Type="enumAndFlags" Value="0"/>
<foregroundOpacity Value="100" Type="int"/> <foregroundOpacity Type="int" Value="100"/>
<trimValue Value="1" Type="bool"/> <underlines Type="bool" Value="0"/>
<allowHTML Value="1" Type="bool"/> <adaptFontToSize Type="bool" Value="0"/>
<trimValue Type="bool" Value="1"/>
<lineSpacing Type="int" Value="1"/>
<underlineLineSize Type="int" Value="1"/>
<allowHTML Type="bool" Value="1"/>
<allowHTMLInFields Type="bool" Value="0"/>
<format Type="QString"></format>
<valueType Type="enumAndFlags" Value="0"/>
<followTo Type="QString"></followTo>
<backgroundBrushStyle Type="enumAndFlags" Value="1"/>
<textIndent Type="qreal" Value="0"/>
<textLayoutDirection Type="enumAndFlags" Value="2"/>
<fillInSecondPass Type="bool" Value="0"/>
</item> </item>
</children> </children>
<zOrder Value="0" Type="qreal"/> <zOrder Type="qreal" Value="0"/>
<borders Value="0" Type="enumAndFlags"/> <borders Type="enumAndFlags" Value="0"/>
<parentName Type="QString">ReportPage1</parentName> <parentName Type="QString">ReportPage1</parentName>
<borderLineSize Value="1" Type="int"/> <borderLineSize Type="int" Value="1"/>
<isVisible Value="1" Type="bool"/> <isVisible Type="bool" Value="1"/>
<autoHeight Value="1" Type="bool"/> <borderColor Type="QColor" Value="#000000"/>
<bandIndex Value="1" Type="int"/> <autoHeight Type="bool" Value="1"/>
<keepBottomSpace Value="0" Type="bool"/> <bandIndex Type="int" Value="1"/>
<keepBottomSpace Type="bool" Value="0"/>
<parentBand Type="QString"></parentBand> <parentBand Type="QString"></parentBand>
<backgroundColor Value="#ffffff" Type="QColor"/> <backgroundColor Type="QColor" Value="#ffffff"/>
<printIfEmpty Value="0" Type="bool"/> <backgroundBrushStyle Type="enumAndFlags" Value="1"/>
<splittable Value="0" Type="bool"/> <printIfEmpty Type="bool" Value="0"/>
<splittable Type="bool" Value="0"/>
<printBeforePageHeader Type="bool" Value="0"/>
</item> </item>
</children> </children>
<zOrder Value="0" Type="qreal"/> <zOrder Type="qreal" Value="0"/>
<borders Value="0" Type="enumAndFlags"/> <borders Type="enumAndFlags" Value="0"/>
<parentName Type="QString"></parentName> <parentName Type="QString"></parentName>
<borderLineSize Value="1" Type="int"/> <borderLineSize Type="int" Value="1"/>
<isVisible Value="1" Type="bool"/> <isVisible Type="bool" Value="1"/>
<topMargin Value="5" Type="int"/> <borderColor Type="QColor" Value="#000000"/>
<bottomMargin Value="5" Type="int"/> <topMargin Type="int" Value="5"/>
<rightMargin Value="5" Type="int"/> <bottomMargin Type="int" Value="5"/>
<leftMargin Value="5" Type="int"/> <rightMargin Type="int" Value="5"/>
<pageOrientation Value="0" Type="enumAndFlags"/> <leftMargin Type="int" Value="5"/>
<pageSize Value="0" Type="enumAndFlags"/> <pageOrientation Type="enumAndFlags" Value="0"/>
<gridStep Value="2" Type="int"/> <pageSize Type="enumAndFlags" Value="0"/>
<gridStep Type="int" Value="2"/>
<fullPage Type="bool" Value="0"/>
<oldPrintMode Type="bool" Value="0"/>
<resetPageNumber Type="bool" Value="0"/>
<isExtendedInDesignMode Type="bool" Value="0"/>
<extendedHeight Type="int" Value="1000"/>
<pageIsTOC Type="bool" Value="0"/>
<setPageSizeToPrinter Type="bool" Value="0"/>
<endlessHeight Type="bool" Value="0"/>
</pageItem> </pageItem>
</item> </item>
</pages> </pages>
<datasourcesManager ClassName="LimeReport::DataSourceManager" Type="Object"> <datasourcesManager Type="Object" ClassName="LimeReport::DataSourceManager">
<objectName Type="QString">datasources</objectName> <objectName Type="QString">datasources</objectName>
<connections Type="Collection"> <connections Type="Collection">
<item ClassName="LimeReport::ConnectionDesc" Type="Object"> <item Type="Object" ClassName="LimeReport::ConnectionDesc">
<objectName Type="QString"></objectName> <objectName Type="QString"></objectName>
<name Type="QString">test</name> <name Type="QString">test</name>
<driver Type="QString">QSQLITE</driver> <driver Type="QString">QSQLITE</driver>
<databaseName Type="QString">./demo_reports/northwind.db</databaseName> <databaseName Type="QString">/home/alex/Work/C++Projects/LimeReport/build/5.6.2/linux64/release/demo_r1/demo_reports/northwind.db</databaseName>
<userName Type="QString"></userName> <userName Type="QString"></userName>
<password Value="" Type="QString"/> <password Type="QString" Value=""/>
<host Type="QString"></host> <host Type="QString"></host>
<autoconnect Value="1" Type="bool"/> <autoconnect Type="bool" Value="0"/>
<keepDBCredentials Type="bool" Value="1"/>
</item> </item>
</connections> </connections>
<queries Type="Collection"> <queries Type="Collection">
<item ClassName="LimeReport::QueryDesc" Type="Object"> <item Type="Object" ClassName="LimeReport::QueryDesc">
<objectName Type="QString"></objectName> <objectName Type="QString"></objectName>
<queryName Type="QString">customers</queryName> <queryName Type="QString">customers</queryName>
<queryText Type="QString">Select * from customers limit 5</queryText> <queryText Type="QString">Select * from customers limit 5</queryText>
@ -200,12 +258,21 @@ THIS.font = font;
<subqueries Type="Collection"/> <subqueries Type="Collection"/>
<subproxies Type="Collection"/> <subproxies Type="Collection"/>
<variables Type="Collection"> <variables Type="Collection">
<item ClassName="LimeReport::VarDesc" Type="Object"> <item Type="Object" ClassName="LimeReport::VarDesc">
<objectName Type="QString"></objectName> <objectName Type="QString"></objectName>
<name Type="QString">TestName</name> <name Type="QString">TestName</name>
<value Type="QString">TestValue</value> <value Type="QString">TestValue</value>
<isMandatory Type="bool" Value="0"/>
<dataType Type="int" Value="0"/>
</item> </item>
</variables> </variables>
</datasourcesManager> </datasourcesManager>
<scriptContext Type="Object" ClassName="LimeReport::ScriptEngineContext">
<objectName Type="QString"></objectName>
<dialogs Type="Collection"/>
<initScript Type="QString"></initScript>
</scriptContext>
<suppressFieldAndVarError Type="bool" Value="0"/>
<translation Type="Translation"/>
</object> </object>
</Report> </Report>

View File

@ -273,7 +273,10 @@ bool ScriptEngineManager::containsFunction(const QString& functionName){
} }
#ifndef USE_QJSENGINE #ifndef USE_QJSENGINE
Q_DECL_DEPRECATED bool ScriptEngineManager::addFunction(const QString& name, #if QT_VERSION > 0x050600
Q_DECL_DEPRECATED
#endif
bool ScriptEngineManager::addFunction(const QString& name,
QScriptEngine::FunctionSignature function, QScriptEngine::FunctionSignature function,
const QString& category, const QString& category,
const QString& description) const QString& description)
@ -345,11 +348,6 @@ void ScriptEngineManager::setDataManager(DataSourceManager *dataManager){
addFunction(describer); addFunction(describer);
} }
// qDebug()<<"is script context exists before set datamanager is called"<< (m_context == 0);
// ICallbackDatasource* tableOfContents = m_dataManager->createCallbackDatasource("tableofcontents");
// connect(tableOfContents, SIGNAL(getCallbackData(LimeReport::CallbackInfo,QVariant&)),
// m_tableOfContents, SLOT(slotOneSlotDS(LimeReport::CallbackInfo,QVariant&)));
} }
} }
} }
@ -1548,11 +1546,7 @@ void ScriptFunctionsManager::clearTableOfContents()
scriptEngineManager()->clearTableOfContents(); scriptEngineManager()->clearTableOfContents();
} }
QFont ScriptFunctionsManager::font(const QString &family, int pointSize, bool italic, bool bold, bool underLine)
#ifdef USE_QJSENGINE
QFont ScriptFunctionsManager::font(const QString &family, int pointSize, bool bold, bool italic, bool underLine)
{ {
QFont result (family, pointSize); QFont result (family, pointSize);
result.setBold(bold); result.setBold(bold);
@ -1561,6 +1555,8 @@ QFont ScriptFunctionsManager::font(const QString &family, int pointSize, bool bo
return result; return result;
} }
#ifdef USE_QJSENGINE
void ScriptFunctionsManager::addItemsToComboBox(QJSValue object, const QStringList &values) void ScriptFunctionsManager::addItemsToComboBox(QJSValue object, const QStringList &values)
{ {
QComboBox* comboBox = dynamic_cast<QComboBox*>(object.toQObject()); QComboBox* comboBox = dynamic_cast<QComboBox*>(object.toQObject());
@ -1599,7 +1595,48 @@ QJSValue ScriptFunctionsManager::createWrapper(QJSValue item)
return QJSValue(); return QJSValue();
} }
#else
void ScriptFunctionsManager::addItemsToComboBox(QScriptValue object, const QStringList &values)
{
QComboBox* comboBox = dynamic_cast<QComboBox*>(object.toQObject());
if (comboBox){
comboBox->addItems(values);
}
}
void ScriptFunctionsManager::addItemToComboBox(QScriptValue object, const QString &value)
{
QComboBox* comboBox = dynamic_cast<QComboBox*>(object.toQObject());
if (comboBox){
comboBox->addItem(value);
}
}
QScriptValue ScriptFunctionsManager::createComboBoxWrapper(QScriptValue comboBox)
{
QComboBox* item = dynamic_cast<QComboBox*>(comboBox.toQObject());
if (item){
ComboBoxWrapper* wrapper = new ComboBoxWrapper(item);
return m_scriptEngineManager->scriptEngine()->newQObject(wrapper);
}
return QScriptValue();
}
QScriptValue ScriptFunctionsManager::createWrapper(QScriptValue item)
{
QObject* object = item.toQObject();
if (object){
IWrapperCreator* wrapper = m_wrappersFactory.value(object->metaObject()->className());
if (wrapper){
return m_scriptEngineManager->scriptEngine()->newQObject(wrapper->createWrapper(item.toQObject()));
}
}
return QScriptValue();
}
#endif #endif
QFont ScriptFunctionsManager::font(QVariantMap params){ QFont ScriptFunctionsManager::font(QVariantMap params){
if (!params.contains("family")){ if (!params.contains("family")){
return QFont(); return QFont();
@ -1694,7 +1731,7 @@ void LimeReport::TableOfContents::clear(){
} }
#ifdef USE_QJSENGINE //#ifdef USE_QJSENGINE
QObject* ComboBoxWrapperCreator::createWrapper(QObject *item) QObject* ComboBoxWrapperCreator::createWrapper(QObject *item)
{ {
@ -1705,7 +1742,7 @@ QObject* ComboBoxWrapperCreator::createWrapper(QObject *item)
return 0; return 0;
} }
#endif //#endif
#ifndef USE_QJSENGINE #ifndef USE_QJSENGINE
void ComboBoxPrototype::addItem(const QString &text) void ComboBoxPrototype::addItem(const QString &text)

View File

@ -263,7 +263,6 @@ private:
QString m_scriptWrapper; QString m_scriptWrapper;
}; };
#ifndef USE_QJSENGINE #ifndef USE_QJSENGINE
class ComboBoxPrototype : public QObject, public QScriptable{ class ComboBoxPrototype : public QObject, public QScriptable{
Q_OBJECT Q_OBJECT
@ -275,8 +274,6 @@ public slots:
}; };
#endif #endif
#ifdef USE_QJSENGINE
class IWrapperCreator{ class IWrapperCreator{
public: public:
virtual QObject* createWrapper(QObject* item) = 0; virtual QObject* createWrapper(QObject* item) = 0;
@ -298,20 +295,15 @@ private:
QObject* createWrapper(QObject* item); QObject* createWrapper(QObject* item);
}; };
#endif
class ScriptFunctionsManager : public QObject{ class ScriptFunctionsManager : public QObject{
Q_OBJECT Q_OBJECT
public: public:
explicit ScriptFunctionsManager(QObject* parent = 0):QObject(parent){ explicit ScriptFunctionsManager(QObject* parent = 0):QObject(parent){
#ifdef USE_QJSENGINE
m_wrappersFactory.insert("QComboBox",new ComboBoxWrapperCreator()); m_wrappersFactory.insert("QComboBox",new ComboBoxWrapperCreator());
#endif
} }
~ScriptFunctionsManager(){ ~ScriptFunctionsManager(){
#ifdef USE_QJSENGINE
foreach(IWrapperCreator* wrapper, m_wrappersFactory.values()){ delete wrapper;} m_wrappersFactory.clear(); foreach(IWrapperCreator* wrapper, m_wrappersFactory.values()){ delete wrapper;} m_wrappersFactory.clear();
#endif
} }
Q_INVOKABLE QVariant calcGroupFunction(const QString& name, const QString& expressionID, const QString& bandName); Q_INVOKABLE QVariant calcGroupFunction(const QString& name, const QString& expressionID, const QString& bandName);
Q_INVOKABLE QVariant line(const QString& bandName); Q_INVOKABLE QVariant line(const QString& bandName);
@ -331,13 +323,17 @@ public:
Q_INVOKABLE QVariant color(const QString& color){ return QColor(color);} Q_INVOKABLE QVariant color(const QString& color){ return QColor(color);}
Q_INVOKABLE void addTableOfContentsItem(const QString& uniqKey, const QString& content, int indent = 0); Q_INVOKABLE void addTableOfContentsItem(const QString& uniqKey, const QString& content, int indent = 0);
Q_INVOKABLE void clearTableOfContents(); Q_INVOKABLE void clearTableOfContents();
#ifdef USE_QJSENGINE
Q_INVOKABLE QFont font(const QString& family, int pointSize = -1, bool bold = false, bool italic = false, bool underLine = false); Q_INVOKABLE QFont font(const QString& family, int pointSize = -1, bool bold = false, bool italic = false, bool underLine = false);
#ifdef USE_QJSENGINE
Q_INVOKABLE void addItemsToComboBox(QJSValue object, const QStringList& values); Q_INVOKABLE void addItemsToComboBox(QJSValue object, const QStringList& values);
Q_INVOKABLE void addItemToComboBox(QJSValue object, const QString& value); Q_INVOKABLE void addItemToComboBox(QJSValue object, const QString& value);
Q_INVOKABLE QJSValue createComboBoxWrapper(QJSValue comboBox); Q_INVOKABLE QJSValue createComboBoxWrapper(QJSValue comboBox);
Q_INVOKABLE QJSValue createWrapper(QJSValue item); Q_INVOKABLE QJSValue createWrapper(QJSValue item);
#else
Q_INVOKABLE void addItemsToComboBox(QScriptValue object, const QStringList& values);
Q_INVOKABLE void addItemToComboBox(QScriptValue object, const QString& value);
Q_INVOKABLE QScriptValue createComboBoxWrapper(QScriptValue comboBox);
Q_INVOKABLE QScriptValue createWrapper(QScriptValue item);
#endif #endif
Q_INVOKABLE QFont font(QVariantMap params); Q_INVOKABLE QFont font(QVariantMap params);
ScriptEngineManager *scriptEngineManager() const; ScriptEngineManager *scriptEngineManager() const;
@ -345,9 +341,7 @@ public:
static QColor createQColor(const QString& color){ return QColor(color);} static QColor createQColor(const QString& color){ return QColor(color);}
private: private:
ScriptEngineManager* m_scriptEngineManager; ScriptEngineManager* m_scriptEngineManager;
#ifdef USE_QJSENGINE
QMap<QString, IWrapperCreator*> m_wrappersFactory; QMap<QString, IWrapperCreator*> m_wrappersFactory;
#endif
}; };
class ScriptEngineManager : public QObject, public Singleton<ScriptEngineManager>, public IScriptEngineManager class ScriptEngineManager : public QObject, public Singleton<ScriptEngineManager>, public IScriptEngineManager

View File

@ -89,9 +89,8 @@ void ScriptEditor::initCompleter()
if (m_page) if (m_page)
dm = m_page->datasourceManager(); dm = m_page->datasourceManager();
ScriptEngineManager& se = LimeReport::ScriptEngineManager::instance();
#ifdef USE_QJSENGINE #ifdef USE_QJSENGINE
ScriptEngineManager& se = LimeReport::ScriptEngineManager::instance();
QJSValue globalObject = se.scriptEngine()->globalObject(); QJSValue globalObject = se.scriptEngine()->globalObject();
QJSValueIterator it(globalObject); QJSValueIterator it(globalObject);
while (it.hasNext()){ while (it.hasNext()){