Finish Extract Designer

This commit is contained in:
Arin Alexander 2017-12-11 19:43:52 +03:00
commit 53e60b2cff
60 changed files with 3110 additions and 579 deletions

View File

@ -24,10 +24,10 @@
QToolTip
{
border: 1px solid #2b2b2b;
background-color: rgb(90, 102, 117);;
background-color: #383838;
color: white;
padding: 5px;
opacity: 200;
\\ opacity: 200;
}
QWidget
@ -82,63 +82,6 @@ QGroupBox::indicator
margin-left: 2px;
}
\\QCheckBox::indicator:unchecked
\\{
\\ image: url(:/qss_icons/rc/checkbox_unchecked.png);
\\}
\\QCheckBox::indicator:unchecked:hover,
\\QCheckBox::indicator:unchecked:focus,
\\QCheckBox::indicator:unchecked:pressed,
\\QGroupBox::indicator:unchecked:hover,
\\QGroupBox::indicator:unchecked:focus,
\\QGroupBox::indicator:unchecked:pressed
\\{
\\ border: none;
\\ image: url(:/qss_icons/rc/checkbox_unchecked_focus.png);
\\}
\\QCheckBox::indicator:checked
\\{
\\ image: url(:/qss_icons/rc/checkbox_checked.png);
\\}
\\QCheckBox::indicator:checked:hover,
\\QCheckBox::indicator:checked:focus,
\\QCheckBox::indicator:checked:pressed,
\\QGroupBox::indicator:checked:hover,
\\QGroupBox::indicator:checked:focus,
\\QGroupBox::indicator:checked:pressed
\\{
\\ border: none;
\\ image: url(:/qss_icons/rc/checkbox_checked_focus.png);
\\}
\\QCheckBox::indicator:indeterminate
\\{
\\ image: url(:/qss_icons/rc/checkbox_indeterminate.png);
\\}
\\QCheckBox::indicator:indeterminate:focus,
\\QCheckBox::indicator:indeterminate:hover,
\\QCheckBox::indicator:indeterminate:pressed
\\{
\\ image: url(:/qss_icons/rc/checkbox_indeterminate_focus.png);
\\}
\\QCheckBox::indicator:checked:disabled,
\\QGroupBox::indicator:checked:disabled
\\{
\\ image: url(:/qss_icons/rc/checkbox_checked_disabled.png);
\\}
\\QCheckBox::indicator:unchecked:disabled,
\\QGroupBox::indicator:unchecked:disabled
\\{
\\ image: url(:/qss_icons/rc/checkbox_unchecked_disabled.png);
\\}
QRadioButton
{
spacing: 5px;
@ -157,52 +100,11 @@ QRadioButton::indicator
height: 16px;
}
\\QRadioButton::indicator:unchecked
\\{
\\ image: url(:/qss_icons/rc/radio_unchecked.png);
\\}
\\QRadioButton::indicator:unchecked:hover,
\\QRadioButton::indicator:unchecked:focus,
\\QRadioButton::indicator:unchecked:pressed
\\{
\\ border: none;
\\ outline: none;
\\ image: url(:/qss_icons/rc/radio_unchecked_focus.png);
\\}
\\QRadioButton::indicator:checked
\\{
\\ border: none;
\\ outline: none;
\\ image: url(:/qss_icons/rc/radio_checked.png);
\\}
\\QRadioButton::indicator:checked:hover,
\\QRadioButton::indicator:checked:focus,
\\QRadioButton::indicator:checked:pressed
\\{
\\ border: none;
\\ outline: none;
\\ image: url(:/qss_icons/rc/radio_checked_focus.png);
\\}
\\QRadioButton::indicator:checked:disabled
\\{
\\ outline: none;
\\ image: url(:/qss_icons/rc/radio_checked_disabled.png);
\\}
\\QRadioButton::indicator:unchecked:disabled
\\{
\\ image: url(:/qss_icons/rc/radio_unchecked_disabled.png);
\\}
QMenuBar
{
background-color: #383838;
background-color: #2f2f2f;
color: #eff0f1;
border-bottom: 1px solid #2b2b2b;
}
QMenuBar::item
@ -213,13 +115,15 @@ QMenuBar::item
QMenuBar::item:selected
{
background: transparent;
background-color: #8fa876;
border: 1px solid #2b2b2b;
}
QMenuBar::item:pressed
{
border: 1px solid #2b2b2b;
background-color: #2e2e2e;
\\ background-color: #2e2e2e;
background-color: #8fa876;
color: #eff0f1;
margin-bottom:-1px;
padding-bottom:1px;
@ -328,7 +232,11 @@ QTabWidget:focus, QCheckBox:focus, QRadioButton:focus, QSlider:focus
QLineEdit
{
background-color: #232629;
padding: 5px;
padding-right: 5px;
padding-left: 5px;
padding-top: 1px;
padding-bottom: 1px;
margin: 1px;
border-style: solid;
border: 1px solid #2b2b2b;
border-radius: 2px;
@ -490,7 +398,6 @@ QScrollBar::up-arrow:vertical, QScrollBar::down-arrow:vertical
background: none;
}
QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical
{
background: none;
@ -579,8 +486,9 @@ QStackedWidget
QToolBar {
border: 1px transparent #2b2b2b;
background: 1px solid #383838;
\\ background: 1px solid #383838;
font-weight: bold;
border-bottom: 1px solid #2b2b2b;
}
QToolBar::handle:horizontal {
@ -648,7 +556,11 @@ QComboBox
border-style: solid;
border: 1px solid #2b2b2b;
border-radius: 2px;
padding: 5px;
padding-right: 5px;
padding-left: 5px;
padding-top: 1px;
padding-bottom: 1px;
margin: 1px;
min-width: 75px;
}
@ -703,7 +615,11 @@ QComboBox::down-arrow:focus
}
QAbstractSpinBox {
padding: 5px;
padding-right: 5px;
padding-left: 5px;
padding-top: 1px;
padding-bottom: 1px;
margin: 1px;
border: 1px solid #2b2b2b;
background-color: #232629;
color: #eff0f1;
@ -964,7 +880,8 @@ QTreeView::branch:selected{
}
QTreeView::branch:!selected:hover, QTreeView::item:!selected:hover{
background-color: #287399;
\\ background-color: #287399;
background-color: #819a67;
}
QTreeView::branch:has-siblings:!adjoins-item {
@ -1036,7 +953,7 @@ QSlider::handle:vertical {
QToolButton {
background-color: #383838;
color : white;
border: 1px transparent #2b2b2b;
border: 1px solid #383838;
border-radius: 2px;
margin: 2px;
padding: 2px;
@ -1059,42 +976,43 @@ QToolButton:text{
QToolButton:disabled{
background-color: transparent;
}
QToolButton[popupMode="1"] { /* only for MenuButtonPopup */
padding-right: 20px; /* make way for the popup button */
border: 1px #2b2b2b;
border-radius: 5px;
}
QToolButton[popupMode="2"] { /* only for InstantPopup */
padding-right: 10px; /* make way for the popup button */
border: 1px #2b2b2b;
}
/* the subcontrol below is used only in the InstantPopup or DelayedPopup mode */
QToolButton::menu-indicator {
image: url(:/qss_icons/rc/down_arrow.png);
top: -7px; left: -2px; /* shift it a bit */
}
/* the subcontrols below are used only in the MenuButtonPopup mode */
QToolButton::menu-button {
border: 1px transparent #2b2b2b;
border-top-right-radius: 6px;
border-bottom-right-radius: 6px;
/* 16px width + 4px for border = 20px allocated above */
width: 16px;
outline: none;
}
QToolButton::menu-arrow {
image: url(:/qss_icons/rc/down_arrow.png);
}
QToolButton::menu-arrow:open {
border: 1px solid #2b2b2b;
}
\\
\\QToolButton[popupMode="1"] { /* only for MenuButtonPopup */
\\ padding-right: 20px; /* make way for the popup button */
\\ border: 1px #2b2b2b;
\\ border-radius: 5px;
\\}
\\
\\QToolButton[popupMode="2"] { /* only for InstantPopup */
\\ padding-right: 10px; /* make way for the popup button */
\\ border: 1px #2b2b2b;
\\}
\\
\\/* the subcontrol below is used only in the InstantPopup or DelayedPopup mode */
\\QToolButton::menu-indicator {
\\ image: url(:/qss_icons/rc/down_arrow.png);
\\ top: -7px; left: -2px; /* shift it a bit */
\\}
\\
\\/* the subcontrols below are used only in the MenuButtonPopup mode */
\\QToolButton::menu-button {
\\ border: 1px transparent #2b2b2b;
\\ border-top-right-radius: 6px;
\\ border-bottom-right-radius: 6px;
\\ /* 16px width + 4px for border = 20px allocated above */
\\ width: 16px;
\\ outline: none;
\\}
\\
\\QToolButton::menu-arrow {
\\ image: url(:/qss_icons/rc/down_arrow.png);
\\}
\\
\\QToolButton::menu-arrow:open {
\\ border: 1px solid #2b2b2b;
\\}
QPushButton::menu-indicator {
subcontrol-origin: padding;

View File

@ -2,6 +2,7 @@ DEFINES += NO_PNG
TEMPLATE = lib
contains(CONFIG, static_build){
message(Static Build)
CONFIG += staticlib
DEFINES += HAVE_STATIC_BUILD
}

View File

@ -12,6 +12,11 @@ CONFIG *= build_translations
CONFIG *= dialogdesigner
}
!contains(CONFIG, no_embedded_designer){
CONFIG *= embedded_designer
DEFINES += HAVE_REPORT_DESIGNER
}
ZINT_PATH = $$PWD/3rdparty/zint-2.6.1
contains(CONFIG,zint){
DEFINES *= HAVE_ZINT

View File

@ -0,0 +1,105 @@
<?xml version="1.0" encoding="UTF8"?>
<Report>
<object ClassName="LimeReport::ReportEnginePrivate" Type="Object">
<objectName Type="QString"></objectName>
<pages Type="Collection">
<item ClassName="LimeReport::PageDesignIntf" Type="Object">
<objectName Type="QString">page1</objectName>
<sceneRect y="-50" x="-50" width="2200" height="3070" Type="QRect"/>
<bspTreeDepth Value="5" Type="int"/>
<font pointSize="9" italic="0" family="Noto Sans" weight="50" underline="0" stylename="" Type="QFont"/>
<sortCacheEnabled Value="0" Type="bool"/>
<stickyFocus Value="0" Type="bool"/>
<minimumRenderSize Value="0" Type="qreal"/>
<pageItem ClassName="PageItem" Type="Object">
<objectName Type="QString">Reportpage1</objectName>
<geometry y="0" x="0" width="2100" height="2970" Type="QRect"/>
<children Type="Collection">
<item ClassName="TextItem" Type="Object">
<objectName Type="QString">TextItem1</objectName>
<geometry y="176" x="156" width="420" height="326" Type="QRect"/>
<children Type="Collection"/>
<zOrder Value="0" Type="qreal"/>
<borders Value="15" Type="enumAndFlags"/>
<parentName Type="QString">Reportpage1</parentName>
<borderLineSize Value="1" Type="int"/>
<isVisible Value="1" Type="bool"/>
<borderColor Value="#000000" Type="QColor"/>
<itemLocation Value="1" Type="enumAndFlags"/>
<stretchToMaxHeight Value="0" Type="bool"/>
<itemAlign Value="4" Type="enumAndFlags"/>
<content Type="QString">$S{
const Alignment = {
Left : 1,
Right: 2,
HCenter: 4,
Justify: 8,
Top: 32,
Bottom: 64,
VCenter: 128
}
THIS.alignment = (Alignment.Right | Alignment.Bottom);
"Test"
}</content>
<margin Value="4" Type="int"/>
<alignment Value="33" Type="enumAndFlags"/>
<autoWidth Value="0" Type="enumAndFlags"/>
<autoHeight Value="0" Type="bool"/>
<font pointSize="9" italic="0" family="DejaVu Sans" weight="50" underline="0" stylename="" Type="QFont"/>
<backgroundOpacity Value="100" Type="int"/>
<backgroundMode Value="1" Type="enumAndFlags"/>
<backgroundColor Value="#ffffff" Type="QColor"/>
<fontColor Value="#000000" Type="QColor"/>
<angle Value="0" Type="enumAndFlags"/>
<foregroundOpacity Value="100" Type="int"/>
<underlines Value="0" Type="bool"/>
<adaptFontToSize Value="0" Type="bool"/>
<trimValue Value="1" Type="bool"/>
<lineSpacing Value="1" Type="int"/>
<underlineLineSize Value="1" Type="int"/>
<allowHTML 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"/>
</item>
</children>
<zOrder Value="0" Type="qreal"/>
<borders Value="0" Type="enumAndFlags"/>
<parentName Type="QString"></parentName>
<borderLineSize Value="1" Type="int"/>
<isVisible Value="1" Type="bool"/>
<borderColor Value="#000000" Type="QColor"/>
<topMargin Value="5" Type="int"/>
<bottomMargin Value="5" Type="int"/>
<rightMargin Value="5" Type="int"/>
<leftMargin Value="5" Type="int"/>
<pageOrientation Value="0" Type="enumAndFlags"/>
<pageSize Value="0" Type="enumAndFlags"/>
<gridStep Value="2" Type="int"/>
<fullPage Value="0" Type="bool"/>
<oldPrintMode Value="0" Type="bool"/>
<resetPageNumber Value="0" Type="bool"/>
</pageItem>
</item>
</pages>
<datasourcesManager ClassName="LimeReport::DataSourceManager" Type="Object">
<objectName Type="QString">datasources</objectName>
<connections Type="Collection"/>
<queries Type="Collection"/>
<subqueries Type="Collection"/>
<subproxies Type="Collection"/>
<variables Type="Collection"/>
</datasourcesManager>
<scriptContext ClassName="LimeReport::ScriptEngineContext" Type="Object">
<objectName Type="QString"></objectName>
<dialogs Type="Collection"/>
<initScript Type="QString"></initScript>
</scriptContext>
<suppressFieldAndVarError Value="0" Type="bool"/>
</object>
</Report>

View File

@ -5,23 +5,23 @@
<pages Type="Collection">
<item Type="Object" ClassName="LimeReport::PageDesignIntf">
<objectName Type="QString">page2</objectName>
<sceneRect y="-50" Type="QRect" width="2200" x="-50" height="3070"/>
<sceneRect Type="QRect" x="-50" height="3070" width="2200" y="-50"/>
<bspTreeDepth Type="int" Value="5"/>
<font pointSize="9" stylename="" Type="QFont" family="Noto Sans" italic="0" weight="50" underline="0"/>
<font pointSize="9" Type="QFont" stylename="" weight="50" italic="0" underline="0" family="Noto Sans"/>
<sortCacheEnabled Type="bool" Value="0"/>
<stickyFocus Type="bool" Value="0"/>
<minimumRenderSize Type="qreal" Value="0"/>
<pageItem Type="Object" ClassName="PageItem">
<objectName Type="QString">TOC</objectName>
<geometry y="0" Type="QRect" width="2100" x="0" height="2970"/>
<geometry Type="QRect" x="0" height="2970" width="2100" y="0"/>
<children Type="Collection">
<item Type="Object" ClassName="Data">
<objectName Type="QString">DataBand1</objectName>
<geometry y="50" Type="QRect" width="2000" x="50" height="94"/>
<geometry Type="QRect" x="50" height="94" width="2000" y="50"/>
<children Type="Collection">
<item Type="Object" ClassName="TextItem">
<objectName Type="QString">TextItem1</objectName>
<geometry y="26" Type="QRect" width="1612" x="18" height="50"/>
<geometry Type="QRect" x="18" height="50" width="1612" y="26"/>
<children Type="Collection"/>
<zOrder Type="qreal" Value="0"/>
<borders Type="enumAndFlags" Value="0"/>
@ -32,12 +32,12 @@
<itemLocation Type="enumAndFlags" Value="0"/>
<stretchToMaxHeight Type="bool" Value="0"/>
<itemAlign Type="enumAndFlags" Value="4"/>
<content Type="QString">$D{tableofcontens.Content}</content>
<content Type="QString">$D{tableofcontents.Content}</content>
<margin Type="int" Value="4"/>
<alignment Type="enumAndFlags" Value="33"/>
<autoWidth Type="enumAndFlags" Value="0"/>
<autoHeight Type="bool" Value="0"/>
<font pointSize="10" stylename="" Type="QFont" family="Arial" italic="0" weight="50" underline="0"/>
<font pointSize="10" Type="QFont" stylename="" weight="50" italic="0" underline="0" family="Arial"/>
<backgroundOpacity Type="int" Value="100"/>
<backgroundMode Type="enumAndFlags" Value="1"/>
<backgroundColor Type="QColor" Value="#ffffff"/>
@ -61,7 +61,7 @@
</item>
<item Type="Object" ClassName="TextItem">
<objectName Type="QString">TextItem2</objectName>
<geometry y="28" Type="QRect" width="244" x="1640" height="48"/>
<geometry Type="QRect" x="1640" height="48" width="244" y="28"/>
<children Type="Collection"/>
<zOrder Type="qreal" Value="0"/>
<borders Type="enumAndFlags" Value="0"/>
@ -74,17 +74,17 @@
<itemAlign Type="enumAndFlags" Value="4"/>
<content Type="QString">$S{
getFieldByKeyField(
"tableofcontens",
"tableofcontents",
"Page number",
"Content Key",
"$D{tableofcontens.Content Key}"
"$D{tableofcontents.Content Key}"
)
}</content>
<margin Type="int" Value="4"/>
<alignment Type="enumAndFlags" Value="33"/>
<autoWidth Type="enumAndFlags" Value="0"/>
<autoHeight Type="bool" Value="0"/>
<font pointSize="10" stylename="" Type="QFont" family="Arial" italic="0" weight="50" underline="0"/>
<font pointSize="10" Type="QFont" stylename="" weight="50" italic="0" underline="0" family="Arial"/>
<backgroundOpacity Type="int" Value="100"/>
<backgroundMode Type="enumAndFlags" Value="1"/>
<backgroundColor Type="QColor" Value="#ffffff"/>
@ -120,7 +120,7 @@ getFieldByKeyField(
<backgroundColor Type="QColor" Value="#ffffff"/>
<backgroundBrushStyle Type="enumAndFlags" Value="1"/>
<printIfEmpty Type="bool" Value="0"/>
<datasource Type="QString">tableofcontens</datasource>
<datasource Type="QString">tableofcontents</datasource>
<keepSubdetailTogether Type="bool" Value="0"/>
<splittable Type="bool" Value="0"/>
<keepFooterTogether Type="bool" Value="0"/>
@ -152,27 +152,29 @@ getFieldByKeyField(
<isExtendedInDesignMode Type="bool" Value="0"/>
<extendedHeight Type="int" Value="1000"/>
<pageIsTOC Type="bool" Value="1"/>
<setPageSizeToPrinter Type="bool" Value="0"/>
<endlessHeight Type="bool" Value="0"/>
</pageItem>
</item>
<item Type="Object" ClassName="LimeReport::PageDesignIntf">
<objectName Type="QString">page1</objectName>
<sceneRect y="-50" Type="QRect" width="2200" x="-50" height="3070"/>
<sceneRect Type="QRect" x="-50" height="3070" width="2200" y="-50"/>
<bspTreeDepth Type="int" Value="5"/>
<font pointSize="9" stylename="" Type="QFont" family="Sans Serif" italic="0" weight="50" underline="0"/>
<font pointSize="9" Type="QFont" stylename="" weight="50" italic="0" underline="0" family="Sans Serif"/>
<sortCacheEnabled Type="bool" Value="0"/>
<stickyFocus Type="bool" Value="0"/>
<minimumRenderSize Type="qreal" Value="0"/>
<pageItem Type="Object" ClassName="PageItem">
<objectName Type="QString">ReportPage1</objectName>
<geometry y="0" Type="QRect" width="2100" x="0" height="2970"/>
<geometry Type="QRect" x="0" height="2970" width="2100" y="0"/>
<children Type="Collection">
<item Type="Object" ClassName="ReportHeader">
<objectName Type="QString">ReportHeader1</objectName>
<geometry y="154" Type="QRect" width="2000" x="50" height="164"/>
<geometry Type="QRect" x="50" height="164" width="2000" y="154"/>
<children Type="Collection">
<item Type="Object" ClassName="TextItem">
<objectName Type="QString">TextItem1</objectName>
<geometry y="22" Type="QRect" width="1024" x="230" height="142"/>
<geometry Type="QRect" x="230" height="142" width="1024" y="22"/>
<children Type="Collection"/>
<zOrder Type="qreal" Value="0"/>
<borders Type="enumAndFlags" Value="0"/>
@ -189,7 +191,7 @@ Report</content>
<alignment Type="enumAndFlags" Value="33"/>
<autoWidth Type="enumAndFlags" Value="0"/>
<autoHeight Type="bool" Value="0"/>
<font pointSize="16" stylename="" Type="QFont" family="Arial" italic="0" weight="75" underline="0"/>
<font pointSize="16" Type="QFont" stylename="" weight="75" italic="0" underline="0" family="Arial"/>
<backgroundOpacity Type="int" Value="100"/>
<backgroundMode Type="enumAndFlags" Value="0"/>
<backgroundColor Type="QColor" Value="#ffffff"/>
@ -213,7 +215,7 @@ Report</content>
</item>
<item Type="Object" ClassName="ImageItem">
<objectName Type="QString">ImageItem1</objectName>
<geometry y="6" Type="QRect" width="158" x="68" height="156"/>
<geometry Type="QRect" x="68" height="156" width="158" y="6"/>
<children Type="Collection"/>
<zOrder Type="qreal" Value="0"/>
<borders Type="enumAndFlags" Value="0"/>
@ -228,6 +230,7 @@ Report</content>
<opacity Type="int" Value="100"/>
<datasource Type="QString"></datasource>
<field Type="QString"></field>
<format Type="enumAndFlags" Value="0"/>
<autoSize Type="bool" Value="0"/>
<scale Type="bool" Value="1"/>
<keepAspectRatio Type="bool" Value="1"/>
@ -236,7 +239,7 @@ Report</content>
</item>
<item Type="Object" ClassName="ShapeItem">
<objectName Type="QString">ShapeItem1</objectName>
<geometry y="86" Type="QRect" width="2000" x="0" height="78"/>
<geometry Type="QRect" x="0" height="78" width="2000" y="86"/>
<children Type="Collection"/>
<zOrder Type="qreal" Value="-0.1"/>
<borders Type="enumAndFlags" Value="0"/>
@ -258,7 +261,7 @@ Report</content>
</item>
<item Type="Object" ClassName="ShapeItem">
<objectName Type="QString">ShapeItem2</objectName>
<geometry y="60" Type="QRect" width="2006" x="-6" height="50"/>
<geometry Type="QRect" x="-6" height="50" width="2006" y="60"/>
<children Type="Collection"/>
<zOrder Type="qreal" Value="0.1"/>
<borders Type="enumAndFlags" Value="0"/>
@ -280,7 +283,7 @@ Report</content>
</item>
<item Type="Object" ClassName="TextItem">
<objectName Type="QString">TextItem9</objectName>
<geometry y="18" Type="QRect" width="200" x="1782" height="50"/>
<geometry Type="QRect" x="1782" height="50" width="200" y="18"/>
<children Type="Collection"/>
<zOrder Type="qreal" Value="0"/>
<borders Type="enumAndFlags" Value="0"/>
@ -296,7 +299,7 @@ Report</content>
<alignment Type="enumAndFlags" Value="130"/>
<autoWidth Type="enumAndFlags" Value="0"/>
<autoHeight Type="bool" Value="0"/>
<font pointSize="10" stylename="" Type="QFont" family="Arial" italic="0" weight="75" underline="0"/>
<font pointSize="10" Type="QFont" stylename="" weight="75" italic="0" underline="0" family="Arial"/>
<backgroundOpacity Type="int" Value="50"/>
<backgroundMode Type="enumAndFlags" Value="1"/>
<backgroundColor Type="QColor" Value="#ffffff"/>
@ -320,7 +323,7 @@ Report</content>
</item>
<item Type="Object" ClassName="TextItem">
<objectName Type="QString">TextItem10</objectName>
<geometry y="98" Type="QRect" width="200" x="1782" height="50"/>
<geometry Type="QRect" x="1782" height="50" width="200" y="98"/>
<children Type="Collection"/>
<zOrder Type="qreal" Value="0"/>
<borders Type="enumAndFlags" Value="0"/>
@ -336,7 +339,7 @@ Report</content>
<alignment Type="enumAndFlags" Value="130"/>
<autoWidth Type="enumAndFlags" Value="0"/>
<autoHeight Type="bool" Value="0"/>
<font pointSize="10" stylename="" Type="QFont" family="Arial" italic="0" weight="75" underline="0"/>
<font pointSize="10" Type="QFont" stylename="" weight="75" italic="0" underline="0" family="Arial"/>
<backgroundOpacity Type="int" Value="50"/>
<backgroundMode Type="enumAndFlags" Value="1"/>
<backgroundColor Type="QColor" Value="#ffffff"/>
@ -377,11 +380,11 @@ Report</content>
</item>
<item Type="Object" ClassName="Data">
<objectName Type="QString">DataBand1</objectName>
<geometry y="414" Type="QRect" width="2000" x="50" height="64"/>
<geometry Type="QRect" x="50" height="64" width="2000" y="414"/>
<children Type="Collection">
<item Type="Object" ClassName="TextItem">
<objectName Type="QString">TextItem3</objectName>
<geometry y="6" Type="QRect" width="250" x="648" height="50"/>
<geometry Type="QRect" x="648" height="50" width="250" y="6"/>
<children Type="Collection"/>
<zOrder Type="qreal" Value="0"/>
<borders Type="enumAndFlags" Value="0"/>
@ -397,7 +400,7 @@ Report</content>
<alignment Type="enumAndFlags" Value="33"/>
<autoWidth Type="enumAndFlags" Value="0"/>
<autoHeight Type="bool" Value="0"/>
<font pointSize="10" stylename="" Type="QFont" family="Arial" italic="0" weight="50" underline="0"/>
<font pointSize="10" Type="QFont" stylename="" weight="50" italic="0" underline="0" family="Arial"/>
<backgroundOpacity Type="int" Value="100"/>
<backgroundMode Type="enumAndFlags" Value="0"/>
<backgroundColor Type="QColor" Value="#ffffff"/>
@ -421,7 +424,7 @@ Report</content>
</item>
<item Type="Object" ClassName="TextItem">
<objectName Type="QString">TextItem4</objectName>
<geometry y="6" Type="QRect" width="250" x="178" height="50"/>
<geometry Type="QRect" x="178" height="50" width="250" y="6"/>
<children Type="Collection"/>
<zOrder Type="qreal" Value="0"/>
<borders Type="enumAndFlags" Value="0"/>
@ -437,7 +440,7 @@ Report</content>
<alignment Type="enumAndFlags" Value="33"/>
<autoWidth Type="enumAndFlags" Value="0"/>
<autoHeight Type="bool" Value="0"/>
<font pointSize="10" stylename="" Type="QFont" family="Arial" italic="0" weight="50" underline="0"/>
<font pointSize="10" Type="QFont" stylename="" weight="50" italic="0" underline="0" family="Arial"/>
<backgroundOpacity Type="int" Value="100"/>
<backgroundMode Type="enumAndFlags" Value="0"/>
<backgroundColor Type="QColor" Value="#ffffff"/>
@ -461,7 +464,7 @@ Report</content>
</item>
<item Type="Object" ClassName="TextItem">
<objectName Type="QString">TextItem12</objectName>
<geometry y="12" Type="QRect" width="340" x="1642" height="38"/>
<geometry Type="QRect" x="1642" height="38" width="340" y="12"/>
<children Type="Collection"/>
<zOrder Type="qreal" Value="0"/>
<borders Type="enumAndFlags" Value="0"/>
@ -477,7 +480,7 @@ Report</content>
<alignment Type="enumAndFlags" Value="34"/>
<autoWidth Type="enumAndFlags" Value="0"/>
<autoHeight Type="bool" Value="0"/>
<font pointSize="10" stylename="" Type="QFont" family="Arial" italic="0" weight="75" underline="0"/>
<font pointSize="10" Type="QFont" stylename="" weight="75" italic="0" underline="0" family="Arial"/>
<backgroundOpacity Type="int" Value="100"/>
<backgroundMode Type="enumAndFlags" Value="1"/>
<backgroundColor Type="QColor" Value="#ffffff"/>
@ -501,7 +504,7 @@ Report</content>
</item>
<item Type="Object" ClassName="TextItem">
<objectName Type="QString">TextItem16</objectName>
<geometry y="6" Type="QRect" width="162" x="10" height="50"/>
<geometry Type="QRect" x="10" height="50" width="162" y="6"/>
<children Type="Collection"/>
<zOrder Type="qreal" Value="0"/>
<borders Type="enumAndFlags" Value="0"/>
@ -517,7 +520,7 @@ Report</content>
<alignment Type="enumAndFlags" Value="33"/>
<autoWidth Type="enumAndFlags" Value="0"/>
<autoHeight Type="bool" Value="0"/>
<font pointSize="10" stylename="" Type="QFont" family="Arial" italic="0" weight="75" underline="0"/>
<font pointSize="10" Type="QFont" stylename="" weight="75" italic="0" underline="0" family="Arial"/>
<backgroundOpacity Type="int" Value="100"/>
<backgroundMode Type="enumAndFlags" Value="0"/>
<backgroundColor Type="QColor" Value="#ffffff"/>
@ -541,7 +544,7 @@ Report</content>
</item>
<item Type="Object" ClassName="TextItem">
<objectName Type="QString">TextItem17</objectName>
<geometry y="6" Type="QRect" width="208" x="434" height="50"/>
<geometry Type="QRect" x="434" height="50" width="208" y="6"/>
<children Type="Collection"/>
<zOrder Type="qreal" Value="0"/>
<borders Type="enumAndFlags" Value="0"/>
@ -557,7 +560,7 @@ Report</content>
<alignment Type="enumAndFlags" Value="33"/>
<autoWidth Type="enumAndFlags" Value="0"/>
<autoHeight Type="bool" Value="0"/>
<font pointSize="10" stylename="" Type="QFont" family="Arial" italic="0" weight="75" underline="0"/>
<font pointSize="10" Type="QFont" stylename="" weight="75" italic="0" underline="0" family="Arial"/>
<backgroundOpacity Type="int" Value="100"/>
<backgroundMode Type="enumAndFlags" Value="0"/>
<backgroundColor Type="QColor" Value="#ffffff"/>
@ -607,11 +610,11 @@ Report</content>
</item>
<item Type="Object" ClassName="GroupHeader">
<objectName Type="QString">GroupBandHeader1</objectName>
<geometry y="322" Type="QRect" width="2000" x="50" height="88"/>
<geometry Type="QRect" x="50" height="88" width="2000" y="322"/>
<children Type="Collection">
<item Type="Object" ClassName="TextItem">
<objectName Type="QString">TextItem2</objectName>
<geometry y="22" Type="QRect" width="580" x="10" height="50"/>
<geometry Type="QRect" x="10" height="50" width="580" y="22"/>
<children Type="Collection"/>
<zOrder Type="qreal" Value="0"/>
<borders Type="enumAndFlags" Value="0"/>
@ -627,7 +630,7 @@ Report</content>
<alignment Type="enumAndFlags" Value="33"/>
<autoWidth Type="enumAndFlags" Value="0"/>
<autoHeight Type="bool" Value="0"/>
<font pointSize="10" stylename="" Type="QFont" family="Arial" italic="0" weight="50" underline="0"/>
<font pointSize="10" Type="QFont" stylename="" weight="50" italic="0" underline="0" family="Arial"/>
<backgroundOpacity Type="int" Value="100"/>
<backgroundMode Type="enumAndFlags" Value="0"/>
<backgroundColor Type="QColor" Value="#ffffff"/>
@ -651,7 +654,7 @@ Report</content>
</item>
<item Type="Object" ClassName="ShapeItem">
<objectName Type="QString">ShapeItem3</objectName>
<geometry y="2" Type="QRect" width="2000" x="0" height="8"/>
<geometry Type="QRect" x="0" height="8" width="2000" y="2"/>
<children Type="Collection"/>
<zOrder Type="qreal" Value="-0.1"/>
<borders Type="enumAndFlags" Value="0"/>
@ -673,7 +676,7 @@ Report</content>
</item>
<item Type="Object" ClassName="TextItem">
<objectName Type="QString">TextItem11</objectName>
<geometry y="24" Type="QRect" width="326" x="1656" height="38"/>
<geometry Type="QRect" x="1656" height="38" width="326" y="24"/>
<children Type="Collection"/>
<zOrder Type="qreal" Value="0"/>
<borders Type="enumAndFlags" Value="0"/>
@ -689,7 +692,7 @@ Report</content>
<alignment Type="enumAndFlags" Value="34"/>
<autoWidth Type="enumAndFlags" Value="0"/>
<autoHeight Type="bool" Value="0"/>
<font pointSize="10" stylename="" Type="QFont" family="Arial" italic="0" weight="75" underline="0"/>
<font pointSize="10" Type="QFont" stylename="" weight="75" italic="0" underline="0" family="Arial"/>
<backgroundOpacity Type="int" Value="50"/>
<backgroundMode Type="enumAndFlags" Value="1"/>
<backgroundColor Type="QColor" Value="#ffffff"/>
@ -735,11 +738,11 @@ Report</content>
</item>
<item Type="Object" ClassName="SubDetail">
<objectName Type="QString">SubDetailBand1</objectName>
<geometry y="482" Type="QRect" width="2000" x="50" height="64"/>
<geometry Type="QRect" x="50" height="64" width="2000" y="482"/>
<children Type="Collection">
<item Type="Object" ClassName="TextItem">
<objectName Type="QString">TextItem5</objectName>
<geometry y="6" Type="QRect" width="626" x="104" height="50"/>
<geometry Type="QRect" x="104" height="50" width="626" y="6"/>
<children Type="Collection"/>
<zOrder Type="qreal" Value="0"/>
<borders Type="enumAndFlags" Value="0"/>
@ -755,7 +758,7 @@ Report</content>
<alignment Type="enumAndFlags" Value="33"/>
<autoWidth Type="enumAndFlags" Value="0"/>
<autoHeight Type="bool" Value="1"/>
<font pointSize="10" stylename="" Type="QFont" family="Arial" italic="0" weight="50" underline="0"/>
<font pointSize="10" Type="QFont" stylename="" weight="50" italic="0" underline="0" family="Arial"/>
<backgroundOpacity Type="int" Value="100"/>
<backgroundMode Type="enumAndFlags" Value="0"/>
<backgroundColor Type="QColor" Value="#ffffff"/>
@ -779,7 +782,7 @@ Report</content>
</item>
<item Type="Object" ClassName="TextItem">
<objectName Type="QString">TextItem6</objectName>
<geometry y="6" Type="QRect" width="250" x="738" height="50"/>
<geometry Type="QRect" x="738" height="50" width="250" y="6"/>
<children Type="Collection"/>
<zOrder Type="qreal" Value="0"/>
<borders Type="enumAndFlags" Value="0"/>
@ -795,7 +798,7 @@ Report</content>
<alignment Type="enumAndFlags" Value="34"/>
<autoWidth Type="enumAndFlags" Value="0"/>
<autoHeight Type="bool" Value="0"/>
<font pointSize="10" stylename="" Type="QFont" family="Arial" italic="0" weight="50" underline="0"/>
<font pointSize="10" Type="QFont" stylename="" weight="50" italic="0" underline="0" family="Arial"/>
<backgroundOpacity Type="int" Value="100"/>
<backgroundMode Type="enumAndFlags" Value="0"/>
<backgroundColor Type="QColor" Value="#ffffff"/>
@ -819,7 +822,7 @@ Report</content>
</item>
<item Type="Object" ClassName="TextItem">
<objectName Type="QString">TextItem7</objectName>
<geometry y="6" Type="QRect" width="86" x="8" height="50"/>
<geometry Type="QRect" x="8" height="50" width="86" y="6"/>
<children Type="Collection"/>
<zOrder Type="qreal" Value="0"/>
<borders Type="enumAndFlags" Value="0"/>
@ -835,7 +838,7 @@ Report</content>
<alignment Type="enumAndFlags" Value="33"/>
<autoWidth Type="enumAndFlags" Value="0"/>
<autoHeight Type="bool" Value="0"/>
<font pointSize="10" stylename="" Type="QFont" family="Arial" italic="0" weight="50" underline="0"/>
<font pointSize="10" Type="QFont" stylename="" weight="50" italic="0" underline="0" family="Arial"/>
<backgroundOpacity Type="int" Value="100"/>
<backgroundMode Type="enumAndFlags" Value="0"/>
<backgroundColor Type="QColor" Value="#ffffff"/>
@ -859,7 +862,7 @@ Report</content>
</item>
<item Type="Object" ClassName="TextItem">
<objectName Type="QString">TextItem13</objectName>
<geometry y="12" Type="QRect" width="354" x="1628" height="42"/>
<geometry Type="QRect" x="1628" height="42" width="354" y="12"/>
<children Type="Collection"/>
<zOrder Type="qreal" Value="0"/>
<borders Type="enumAndFlags" Value="0"/>
@ -875,7 +878,7 @@ Report</content>
<alignment Type="enumAndFlags" Value="34"/>
<autoWidth Type="enumAndFlags" Value="0"/>
<autoHeight Type="bool" Value="0"/>
<font pointSize="10" stylename="" Type="QFont" family="Arial" italic="0" weight="75" underline="0"/>
<font pointSize="10" Type="QFont" stylename="" weight="75" italic="0" underline="0" family="Arial"/>
<backgroundOpacity Type="int" Value="50"/>
<backgroundMode Type="enumAndFlags" Value="1"/>
<backgroundColor Type="QColor" Value="#ffffff"/>
@ -921,11 +924,11 @@ Report</content>
</item>
<item Type="Object" ClassName="SubDetailFooter">
<objectName Type="QString">SubDetailFooterBand1</objectName>
<geometry y="550" Type="QRect" width="2000" x="50" height="70"/>
<geometry Type="QRect" x="50" height="70" width="2000" y="550"/>
<children Type="Collection">
<item Type="Object" ClassName="TextItem">
<objectName Type="QString">TextItem8</objectName>
<geometry y="10" Type="QRect" width="248" x="738" height="50"/>
<geometry Type="QRect" x="738" height="50" width="248" y="10"/>
<children Type="Collection"/>
<zOrder Type="qreal" Value="0"/>
<borders Type="enumAndFlags" Value="1"/>
@ -941,7 +944,7 @@ Report</content>
<alignment Type="enumAndFlags" Value="130"/>
<autoWidth Type="enumAndFlags" Value="0"/>
<autoHeight Type="bool" Value="0"/>
<font pointSize="10" stylename="" Type="QFont" family="Arial" italic="0" weight="50" underline="0"/>
<font pointSize="10" Type="QFont" stylename="" weight="50" italic="0" underline="0" family="Arial"/>
<backgroundOpacity Type="int" Value="100"/>
<backgroundMode Type="enumAndFlags" Value="1"/>
<backgroundColor Type="QColor" Value="#ffffff"/>
@ -965,7 +968,7 @@ Report</content>
</item>
<item Type="Object" ClassName="TextItem">
<objectName Type="QString">TextItem14</objectName>
<geometry y="16" Type="QRect" width="380" x="1602" height="42"/>
<geometry Type="QRect" x="1602" height="42" width="380" y="16"/>
<children Type="Collection"/>
<zOrder Type="qreal" Value="0"/>
<borders Type="enumAndFlags" Value="0"/>
@ -981,7 +984,7 @@ Report</content>
<alignment Type="enumAndFlags" Value="34"/>
<autoWidth Type="enumAndFlags" Value="0"/>
<autoHeight Type="bool" Value="0"/>
<font pointSize="10" stylename="" Type="QFont" family="Arial" italic="0" weight="75" underline="0"/>
<font pointSize="10" Type="QFont" stylename="" weight="75" italic="0" underline="0" family="Arial"/>
<backgroundOpacity Type="int" Value="100"/>
<backgroundMode Type="enumAndFlags" Value="1"/>
<backgroundColor Type="QColor" Value="#ffffff"/>
@ -1005,7 +1008,7 @@ Report</content>
</item>
<item Type="Object" ClassName="TextItem">
<objectName Type="QString">TextItem15</objectName>
<geometry y="10" Type="QRect" width="200" x="528" height="50"/>
<geometry Type="QRect" x="528" height="50" width="200" y="10"/>
<children Type="Collection"/>
<zOrder Type="qreal" Value="0"/>
<borders Type="enumAndFlags" Value="0"/>
@ -1021,7 +1024,7 @@ Report</content>
<alignment Type="enumAndFlags" Value="130"/>
<autoWidth Type="enumAndFlags" Value="0"/>
<autoHeight Type="bool" Value="0"/>
<font pointSize="10" stylename="" Type="QFont" family="Arial" italic="0" weight="50" underline="0"/>
<font pointSize="10" Type="QFont" stylename="" weight="50" italic="0" underline="0" family="Arial"/>
<backgroundOpacity Type="int" Value="100"/>
<backgroundMode Type="enumAndFlags" Value="1"/>
<backgroundColor Type="QColor" Value="#ffffff"/>
@ -1045,7 +1048,7 @@ Report</content>
</item>
<item Type="Object" ClassName="ShapeItem">
<objectName Type="QString">ShapeItem4</objectName>
<geometry y="40" Type="QRect" width="1994" x="6" height="50"/>
<geometry Type="QRect" x="6" height="50" width="1994" y="40"/>
<children Type="Collection"/>
<zOrder Type="qreal" Value="0"/>
<borders Type="enumAndFlags" Value="0"/>
@ -1085,11 +1088,11 @@ Report</content>
</item>
<item Type="Object" ClassName="PageFooter">
<objectName Type="QString">PageFooter1</objectName>
<geometry y="624" Type="QRect" width="2000" x="50" height="100"/>
<geometry Type="QRect" x="50" height="100" width="2000" y="624"/>
<children Type="Collection">
<item Type="Object" ClassName="TextItem">
<objectName Type="QString">TextItem18</objectName>
<geometry y="22" Type="QRect" width="696" x="1258" height="50"/>
<geometry Type="QRect" x="1258" height="50" width="696" y="22"/>
<children Type="Collection"/>
<zOrder Type="qreal" Value="0"/>
<borders Type="enumAndFlags" Value="0"/>
@ -1105,7 +1108,7 @@ Report</content>
<alignment Type="enumAndFlags" Value="34"/>
<autoWidth Type="enumAndFlags" Value="0"/>
<autoHeight Type="bool" Value="0"/>
<font pointSize="9" stylename="" Type="QFont" family="DejaVu Sans" italic="0" weight="50" underline="0"/>
<font pointSize="9" Type="QFont" stylename="" weight="50" italic="0" underline="0" family="DejaVu Sans"/>
<backgroundOpacity Type="int" Value="100"/>
<backgroundMode Type="enumAndFlags" Value="1"/>
<backgroundColor Type="QColor" Value="#ffffff"/>
@ -1146,11 +1149,11 @@ Report</content>
</item>
<item Type="Object" ClassName="PageHeader">
<objectName Type="QString">PageHeader18</objectName>
<geometry y="50" Type="QRect" width="2000" x="50" height="100"/>
<geometry Type="QRect" x="50" height="100" width="2000" y="50"/>
<children Type="Collection">
<item Type="Object" ClassName="TextItem">
<objectName Type="QString">TextItem19</objectName>
<geometry y="22" Type="QRect" width="696" x="1258" height="50"/>
<geometry Type="QRect" x="1258" height="50" width="696" y="22"/>
<children Type="Collection"/>
<zOrder Type="qreal" Value="0"/>
<borders Type="enumAndFlags" Value="0"/>
@ -1166,7 +1169,7 @@ Report</content>
<alignment Type="enumAndFlags" Value="34"/>
<autoWidth Type="enumAndFlags" Value="0"/>
<autoHeight Type="bool" Value="0"/>
<font pointSize="9" stylename="" Type="QFont" family="DejaVu Sans" italic="0" weight="50" underline="0"/>
<font pointSize="9" Type="QFont" stylename="" weight="50" italic="0" underline="0" family="DejaVu Sans"/>
<backgroundOpacity Type="int" Value="100"/>
<backgroundMode Type="enumAndFlags" Value="1"/>
<backgroundColor Type="QColor" Value="#ffffff"/>
@ -1225,6 +1228,8 @@ Report</content>
<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>
</item>
</pages>
@ -1278,15 +1283,15 @@ var firstLevel = "&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;";
var secondLevel = "&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;";
function SB1AfterData(){
addTableOfContensItem(getField("orders.OrderID"),firstLevel+getField("orders.OrderID"));
addTableOfContentsItem(getField("orders.OrderID"),firstLevel+getField("orders.OrderID"));
}
function SB2AfterData(){
addTableOfContensItem(getField("orders.OrderID")+getField("orderItems.ProductName"), secondLevel+"&lt;i>"+getField("orderItems.ProductName")+"&lt;/i>");
addTableOfContentsItem(getField("orders.OrderID")+getField("orderItems.ProductName"), secondLevel+"&lt;i>"+getField("orderItems.ProductName")+"&lt;/i>");
}
function SB3AfterData(){
addTableOfContensItem(getField("orders.CompanyName"), "&lt;b>"+getField("orders.CompanyName")+"&lt;/b>");
addTableOfContentsItem(getField("orders.CompanyName"), "&lt;b>"+getField("orders.CompanyName")+"&lt;/b>");
}</initScript>
</scriptContext>
<suppressFieldAndVarError Type="bool" Value="0"/>

View File

@ -13,6 +13,8 @@ SOURCES += main.cpp
INCLUDEPATH += $$PWD/../include
DEPENDPATH += $$PWD/../include
RESOURCES += $$PWD/../3rdparty/dark_style_sheet/qdarkstyle/style.qrc
DEST_DIR = $${DEST_BINS}
REPORTS_DIR = $${DEST_DIR}

View File

@ -0,0 +1,44 @@
include(../common.pri)
include(limereport.pri)
QT += core gui
contains(CONFIG,release) {
TARGET = designer_plugin
} else {
TARGET = designer_plugind
}
TEMPLATE = lib
CONFIG += plugin
HEADERS += \
lrdesignerplugin.h
SOURCES += \
lrdesignerplugin.cpp
INCLUDEPATH += $$PWD/../include
DEPENDPATH += $$PWD/../include
macx{
CONFIG += lib_bundle
CONFIG += -dll
}
DESTDIR = $${DEST_LIBS}
unix {
target.path = $${DESTDIR}
INSTALLS = target
}
contains(CONFIG,zint){
message(zint)
INCLUDEPATH += $$ZINT_PATH/backend $$ZINT_PATH/backend_qt
DEPENDPATH += $$ZINT_PATH/backend $$ZINT_PATH/backend_qt
LIBS += -L$${DEST_LIBS}
contains(CONFIG,release) {
LIBS += -lQtZint
} else {
LIBS += -lQtZintd
}
}

View File

@ -0,0 +1,235 @@
include(../common.pri)
DEFINES += HAVE_REPORT_DESIGNER
contains(CONFIG,dialogdesigner){
include($$REPORT_PATH/dialogdesigner/dialogdesigner.pri)
}
DEFINES += INSPECT_BASEDESIGN
INCLUDEPATH += \
$$REPORT_PATH/ \
$$REPORT_PATH/items \
$$REPORT_PATH/bands \
$$REPORT_PATH/base \
$$REPORT_PATH/objectinspector \
$$REPORT_PATH/databrowser \
$$REPORT_PATH/scripteditor \
$$REPORT_PATH/../designer_plugin
SOURCES += \
$$REPORT_PATH/databrowser/lrdatabrowser.cpp \
$$REPORT_PATH/databrowser/lrsqleditdialog.cpp \
$$REPORT_PATH/databrowser/lrconnectiondialog.cpp \
$$REPORT_PATH/databrowser/lrvariabledialog.cpp \
$$REPORT_PATH/databrowser/lrdatabrowsertree.cpp \
$$REPORT_PATH/objectinspector/propertyItems/lrstringpropitem.cpp \
$$REPORT_PATH/objectinspector/propertyItems/lrrectproptem.cpp \
$$REPORT_PATH/objectinspector/propertyItems/lrintpropitem.cpp \
$$REPORT_PATH/objectinspector/propertyItems/lrenumpropitem.cpp \
$$REPORT_PATH/objectinspector/propertyItems/lrboolpropitem.cpp \
$$REPORT_PATH/objectinspector/propertyItems/lrflagspropitem.cpp \
$$REPORT_PATH/objectinspector/propertyItems/lrfontpropitem.cpp \
$$REPORT_PATH/objectinspector/propertyItems/lrimagepropitem.cpp \
$$REPORT_PATH/objectinspector/propertyItems/lrqrealpropitem.cpp \
$$REPORT_PATH/objectinspector/propertyItems/lrcolorpropitem.cpp \
$$REPORT_PATH/objectinspector/propertyItems/lrdatasourcepropitem.cpp \
$$REPORT_PATH/objectinspector/propertyItems/lrgroupfieldpropitem.cpp \
$$REPORT_PATH/objectinspector/propertyItems/lrcontentpropitem.cpp \
$$REPORT_PATH/objectinspector/editors/lrtextitempropertyeditor.cpp \
$$REPORT_PATH/objectinspector/editors/lrcomboboxeditor.cpp \
$$REPORT_PATH/objectinspector/editors/lrcheckboxeditor.cpp \
$$REPORT_PATH/objectinspector/editors/lrbuttonlineeditor.cpp \
$$REPORT_PATH/objectinspector/editors/lrfonteditor.cpp \
$$REPORT_PATH/objectinspector/editors/lrimageeditor.cpp \
$$REPORT_PATH/objectinspector/editors/lrcoloreditor.cpp \
$$REPORT_PATH/objectinspector/lrbasedesignobjectmodel.cpp \
$$REPORT_PATH/objectinspector/lrobjectinspectorwidget.cpp \
$$REPORT_PATH/objectinspector/lrobjectitemmodel.cpp \
$$REPORT_PATH/objectinspector/lrobjectpropitem.cpp \
$$REPORT_PATH/objectinspector/lrpropertydelegate.cpp \
$$REPORT_PATH/objectsbrowser/lrobjectbrowser.cpp \
$$REPORT_PATH/scriptbrowser/lrscriptbrowser.cpp \
$$REPORT_PATH/scripteditor/lrscripteditor.cpp \
$$REPORT_PATH/scripteditor/lrcodeeditor.cpp \
$$REPORT_PATH/scripteditor/lrscripthighlighter.cpp \
$$REPORT_PATH/items/lrsubitemparentpropitem.cpp \
$$REPORT_PATH/items/lralignpropitem.cpp \
$$REPORT_PATH/items/lrhorizontallayout.cpp \
$$REPORT_PATH/items/editors/lritemeditorwidget.cpp \
$$REPORT_PATH/items/editors/lrfonteditorwidget.cpp \
$$REPORT_PATH/items/editors/lrtextalignmenteditorwidget.cpp \
$$REPORT_PATH/items/editors/lritemsaligneditorwidget.cpp \
$$REPORT_PATH/items/editors/lritemsborderseditorwidget.cpp \
$$REPORT_PATH/items/lrchartitem.cpp \
$$REPORT_PATH/items/lrchartitemeditor.cpp \
$$REPORT_PATH/items/lrshapeitem.cpp \
$$REPORT_PATH/items/lrimageitem.cpp \
$$REPORT_PATH/translationeditor/translationeditor.cpp \
$$REPORT_PATH/lrbanddesignintf.cpp \
$$REPORT_PATH/lrpageitemdesignintf.cpp \
$$REPORT_PATH/lrpagedesignintf.cpp \
$$REPORT_PATH/lrbandsmanager.cpp \
$$REPORT_PATH/lrglobal.cpp \
$$REPORT_PATH/lritemdesignintf.cpp \
$$REPORT_PATH/lrdatadesignintf.cpp \
$$REPORT_PATH/lrreportdesignwidget.cpp \
$$REPORT_PATH/lrbasedesignintf.cpp \
$$REPORT_PATH/lrdatasourcemanager.cpp \
$$REPORT_PATH/lrreportdesignwindow.cpp \
$$REPORT_PATH/lrscriptenginemanager.cpp \
$$REPORT_PATH/lraboutdialog.cpp \
$$REPORT_PATH/lrsettingdialog.cpp \
$$REPORT_PATH/lritemscontainerdesignitf.cpp \
$$REPORT_PATH/lrcolorindicator.cpp \
$$REPORT_PATH/lrreporttranslation.cpp \
$$REPORT_PATH/translationeditor/languageselectdialog.cpp \
$$REPORT_PATH/serializators/lrxmlqrectserializator.cpp \
$$REPORT_PATH/serializators/lrxmlbasetypesserializators.cpp \
$$REPORT_PATH/serializators/lrxmlreader.cpp \
$$REPORT_PATH/serializators/lrxmlwriter.cpp \
$$REPORT_PATH/bands/lrpageheader.cpp \
$$REPORT_PATH/bands/lrpagefooter.cpp \
$$REPORT_PATH/bands/lrreportheader.cpp \
$$REPORT_PATH/bands/lrreportfooter.cpp \
$$REPORT_PATH/bands/lrdataband.cpp \
$$REPORT_PATH/bands/lrgroupbands.cpp \
$$REPORT_PATH/bands/lrsubdetailband.cpp \
$$REPORT_PATH/bands/lrtearoffband.cpp \
$$REPORT_PATH/lrgraphicsviewzoom.cpp \
$$REPORT_PATH/lrvariablesholder.cpp \
$$REPORT_PATH/lrgroupfunctions.cpp \
$$REPORT_PATH/lrsimplecrypt.cpp \
$$REPORT_PATH/items/lrsimpletagparser.cpp \
$$REPORT_PATH/items/lrtextitem.cpp \
$$REPORT_PATH/items/lrtextitemeditor.cpp \
$$REPORT_PATH/lrreportengine.cpp \
$$REPORT_PATH/lrpreviewreportwindow.cpp \
$$REPORT_PATH/lrpreviewreportwidget.cpp \
$$REPORT_PATH/lrreportrender.cpp
HEADERS += \
$$REPORT_PATH/base/lrsingleton.h \
$$REPORT_PATH/base/lrsimpleabstractfactory.h \
$$REPORT_PATH/base/lrattribsabstractfactory.h \
$$REPORT_PATH/databrowser/lrdatabrowser.h \
$$REPORT_PATH/databrowser/lrsqleditdialog.h \
$$REPORT_PATH/databrowser/lrconnectiondialog.h \
$$REPORT_PATH/databrowser/lrvariabledialog.h \
$$REPORT_PATH/databrowser/lrdatabrowsertree.h \
$$REPORT_PATH/objectinspector/propertyItems/lrstringpropitem.h \
$$REPORT_PATH/objectinspector/propertyItems/lrrectproptem.h \
$$REPORT_PATH/objectinspector/propertyItems/lrdatasourcepropitem.h \
$$REPORT_PATH/objectinspector/propertyItems/lrfontpropitem.h \
$$REPORT_PATH/objectinspector/propertyItems/lrimagepropitem.h \
$$REPORT_PATH/objectinspector/propertyItems/lrintpropitem.h \
$$REPORT_PATH/objectinspector/propertyItems/lrenumpropitem.h \
$$REPORT_PATH/objectinspector/propertyItems/lrboolpropitem.h \
$$REPORT_PATH/objectinspector/propertyItems/lrflagspropitem.h \
$$REPORT_PATH/objectinspector/propertyItems/lrgroupfieldpropitem.h \
$$REPORT_PATH/objectinspector/propertyItems/lrcontentpropitem.h \
$$REPORT_PATH/objectinspector/propertyItems/lrqrealpropitem.h \
$$REPORT_PATH/objectinspector/propertyItems/lrcolorpropitem.h \
$$REPORT_PATH/objectinspector/editors/lrtextitempropertyeditor.h \
$$REPORT_PATH/objectinspector/editors/lrcomboboxeditor.h \
$$REPORT_PATH/objectinspector/editors/lrcheckboxeditor.h \
$$REPORT_PATH/objectinspector/editors/lrbuttonlineeditor.h \
$$REPORT_PATH/objectinspector/editors/lrimageeditor.h \
$$REPORT_PATH/objectinspector/editors/lrcoloreditor.h \
$$REPORT_PATH/objectinspector/editors/lrfonteditor.h \
$$REPORT_PATH/objectinspector/lrbasedesignobjectmodel.h \
$$REPORT_PATH/objectinspector/lrobjectinspectorwidget.h \
$$REPORT_PATH/objectinspector/lrobjectitemmodel.h \
$$REPORT_PATH/objectinspector/lrobjectpropitem.h \
$$REPORT_PATH/objectinspector/lrpropertydelegate.h \
$$REPORT_PATH/objectsbrowser/lrobjectbrowser.h \
$$REPORT_PATH/scriptbrowser/lrscriptbrowser.h \
$$REPORT_PATH/scripteditor/lrscripteditor.h \
$$REPORT_PATH/scripteditor/lrcodeeditor.h \
$$REPORT_PATH/scripteditor/lrscripthighlighter.h \
$$REPORT_PATH/items/editors/lritemeditorwidget.h \
$$REPORT_PATH/items/editors/lrfonteditorwidget.h \
$$REPORT_PATH/items/editors/lrtextalignmenteditorwidget.h \
$$REPORT_PATH/items/editors/lritemsaligneditorwidget.h \
$$REPORT_PATH/items/editors/lritemsborderseditorwidget.h \
$$REPORT_PATH/items/lrtextitem.h \
$$REPORT_PATH/items/lrtextitemeditor.h \
$$REPORT_PATH/items/lrsubitemparentpropitem.h \
$$REPORT_PATH/items/lralignpropitem.h \
$$REPORT_PATH/items/lrhorizontallayout.h \
$$REPORT_PATH/items/lrchartitem.h \
$$REPORT_PATH/items/lrchartitemeditor.h \
$$REPORT_PATH/items/lrshapeitem.h \
$$REPORT_PATH/items/lrimageitem.h \
$$REPORT_PATH/translationeditor/translationeditor.h \
$$REPORT_PATH/lrbanddesignintf.h \
$$REPORT_PATH/lrpageitemdesignintf.h \
$$REPORT_PATH/lrbandsmanager.h \
$$REPORT_PATH/lrglobal.h \
$$REPORT_PATH/lrdatadesignintf.h \
$$REPORT_PATH/lrpagedesignintf.h \
$$REPORT_PATH/lrreportdesignwidget.h \
$$REPORT_PATH/lrdatasourcemanager.h \
$$REPORT_PATH/lrreportdesignwindow.h \
$$REPORT_PATH/lrgraphicsviewzoom.h \
$$REPORT_PATH/lrbasedesignintf.h \
$$REPORT_PATH/lritemdesignintf.h \
$$REPORT_PATH/lrscriptenginemanager.h \
$$REPORT_PATH/lrgroupfunctions.h \
$$REPORT_PATH/lrdatasourcemanagerintf.h \
$$REPORT_PATH/lrscriptenginemanagerintf.h \
$$REPORT_PATH/lraboutdialog.h \
$$REPORT_PATH/lrcallbackdatasourceintf.h \
$$REPORT_PATH/lrsettingdialog.h \
$$REPORT_PATH/lritemscontainerdesignitf.h \
$$REPORT_PATH/lrcolorindicator.h \
$$REPORT_PATH/lrreporttranslation.h \
$$REPORT_PATH/translationeditor/languageselectdialog.h \
$$REPORT_PATH/serializators/lrserializatorintf.h \
$$REPORT_PATH/serializators/lrstorageintf.h \
$$REPORT_PATH/serializators/lrxmlqrectserializator.h \
$$REPORT_PATH/serializators/lrxmlserializatorsfactory.h \
$$REPORT_PATH/serializators/lrxmlbasetypesserializators.h \
$$REPORT_PATH/serializators/lrxmlreader.h \
$$REPORT_PATH/serializators/lrxmlwriter.h \
$$REPORT_PATH/bands/lrpageheader.h \
$$REPORT_PATH/bands/lrpagefooter.h \
$$REPORT_PATH/bands/lrreportheader.h \
$$REPORT_PATH/bands/lrreportfooter.h \
$$REPORT_PATH/bands/lrdataband.h \
$$REPORT_PATH/bands/lrtearoffband.h \
$$REPORT_PATH/bands/lrsubdetailband.h \
$$REPORT_PATH/bands/lrgroupbands.h \
$$REPORT_PATH/lrvariablesholder.h \
$$REPORT_PATH/lrsimplecrypt.h \
$$REPORT_PATH/items/lrsimpletagparser.h \
$$REPORT_PATH/lrreportengine_p.h \
$$REPORT_PATH/lrreportengine.h \
$$REPORT_PATH/lrpreviewreportwindow.h \
$$REPORT_PATH/lrpreviewreportwidget.h \
$$REPORT_PATH/lrreportrender.h
FORMS += \
$$REPORT_PATH/items/lrtextitemeditor.ui \
$$REPORT_PATH/items/lrchartitemeditor.ui \
$$REPORT_PATH/databrowser/lrsqleditdialog.ui \
$$REPORT_PATH/databrowser/lrconnectiondialog.ui \
$$REPORT_PATH/databrowser/lrdatabrowser.ui \
$$REPORT_PATH/databrowser/lrvariabledialog.ui \
$$REPORT_PATH/objectinspector/editors/ltextitempropertyeditor.ui \
$$REPORT_PATH/lraboutdialog.ui \
$$REPORT_PATH/lrsettingdialog.ui \
$$REPORT_PATH/scriptbrowser/lrscriptbrowser.ui \
$$REPORT_PATH/translationeditor/translationeditor.ui \
$$REPORT_PATH/translationeditor/languageselectdialog.ui \
$$REPORT_PATH/scripteditor/lrscripteditor.ui \
$$REPORT_PATH/lrpreviewreportwindow.ui \
$$REPORT_PATH/lrpreviewreportwidget.ui
RESOURCES += \
$$REPORT_PATH/objectinspector/lobjectinspector.qrc \
$$REPORT_PATH/databrowser/lrdatabrowser.qrc \
$$REPORT_PATH/report.qrc \
$$REPORT_PATH/items/items.qrc \
$$REPORT_PATH/scriptbrowser/lrscriptbrowser.qrc \
$$REPORT_PATH/translationeditor/translationeditor.qrc

View File

@ -0,0 +1,17 @@
#include "lrdesignerplugin.h"
#include <QRect>
#include "lrreportdesignwindow.h"
ReportDesignerFactoryPlugin::~ReportDesignerFactoryPlugin() {
}
LimeReport::ReportDesignWindowInterface* ReportDesignerFactoryPlugin::getDesignerWindow(LimeReport::ReportEnginePrivateInterface* report, QWidget* parent, QSettings* settings)
{
return new LimeReport::ReportDesignWindow(report, parent, settings);
}
#if QT_VERSION < 0x050000
Q_EXPORT_PLUGIN2(LimeReportPluginInterface, ReportDesignerFactoryPlugin)
#endif

View File

@ -0,0 +1,19 @@
#ifndef LRDESIGNERPLUGIN_H
#define LRDESIGNERPLUGIN_H
#include <QMainWindow>
#include <lrdesignerplugininterface.h>
class ReportDesignerFactoryPlugin : public QObject, public LimeReportPluginInterface {
Q_OBJECT
#if QT_VERSION >= 0x050000
Q_PLUGIN_METADATA(IID "ru.limereport.DersignerFactoryInterface")
#endif
Q_INTERFACES( LimeReportPluginInterface )
public:
~ReportDesignerFactoryPlugin();
LimeReport::ReportDesignWindowInterface* getDesignerWindow(LimeReport::ReportEnginePrivateInterface* report, QWidget* parent, QSettings* settings);
};
#endif

13
designer_plugin/main.cpp Normal file
View File

@ -0,0 +1,13 @@
#include <QApplication>
#include <LimeReport>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
LimeReport::ReportEngine report;
if (a.arguments().count()>1){
report.loadFromFile(a.arguments().at(1));
}
report.designReport();
return a.exec();
}

View File

@ -161,6 +161,7 @@ namespace Const{
Enums(){}
Q_GADGET
};
typedef Enums::VariableDataType VariableDataType;
} // namespace LimeReport

91
include/lrrenderengine.h Normal file
View File

@ -0,0 +1,91 @@
#ifndef LRRENDERENGINE_H
#define LRRENDERENGINE_H
#include <QObject>
#include <QSettings>
#include <QPrintDialog>
#include "lrglobal.h"
#include "lrdatasourcemanagerintf.h"
#include "lrscriptenginemanagerintf.h"
#include "lrpreviewreportwidget.h"
namespace LimeReport{
class PrintRange{
public:
int fromPage() const { return m_fromPage;}
int toPage() const { return m_toPage;}
QPrintDialog::PrintRange rangeType() const { return m_rangeType;}
PrintRange(QAbstractPrintDialog::PrintRange rangeType=QPrintDialog::AllPages, int fromPage=0, int toPage=0);
void setRangeType(QAbstractPrintDialog::PrintRange rangeType){ m_rangeType=rangeType;}
void setFromPage(int fromPage){ m_fromPage = fromPage;}
void setToPage(int toPage){ m_toPage = toPage;}
private:
QPrintDialog::PrintRange m_rangeType;
int m_fromPage;
int m_toPage;
};
class DataSourceManager;
class PageDesignIntf;
class PageItemDesignIntf;
class PreviewReportWidget;
typedef QList< QSharedPointer<PageItemDesignIntf> > ReportPages;
class RenderEnginePrivate;
class LIMEREPORT_EXPORT RenderEngine: public QObject{
Q_OBJECT
friend class PreviewReportWidget;
public:
static void setSettings(QSettings *value){m_settings=value;}
public:
explicit RenderEngine(QObject *parent = 0);
explicit RenderEngine(RenderEnginePrivate* dd, QObject *parent = 0);
~RenderEngine();
bool printReport(QPrinter *printer=0);
bool printPages(ReportPages pages, QPrinter *printer);
void printToFile(const QString& fileName);
PageDesignIntf *createPreviewScene(QObject *parent = 0);
bool printToPDF(const QString& fileName);
void previewReport(PreviewHints hints = PreviewBarsUserSetting);
IDataSourceManager* dataManager();
IScriptEngineManager* scriptManager();
bool loadFromFile(const QString& fileName, bool autoLoadPreviewOnChange = false);
bool loadFromByteArray(QByteArray *data);
bool loadFromString(const QString& data);
QString reportFileName();
void setReportFileName(const QString& fileName);
QString lastError();
PreviewReportWidget *createPreviewWidget(QWidget *parent = 0);
void setPreviewWindowTitle(const QString& title);
void setPreviewWindowIcon(const QIcon& icon);
void setResultEditable(bool value);
bool resultIsEditable();
bool isBusy();
void setPassPharse(QString& passPharse);
QList<QLocale::Language> aviableLanguages();
bool setReportLanguage(QLocale::Language language);
Qt::LayoutDirection previewLayoutDirection();
void setPreviewLayoutDirection(const Qt::LayoutDirection& previewLayoutDirection);
QSettings* settings(){ return m_settings;}
signals:
void renderStarted();
void renderFinished();
void renderPageFinished(int renderedPageCount);
void onLoad(bool& loaded);
public slots:
void cancelRender();
protected:
QObject* d_ptr;
private:
static QSettings* m_settings;
void init();
private:
Q_DECLARE_PRIVATE(RenderEngine)
};
} // namespace LimeReport
#endif // LRRENDERENGINE_H

View File

@ -0,0 +1,23 @@
#ifndef LRREPORTDESIGNWINDOWINTRERFACE_H
#define LRREPORTDESIGNWINDOWINTRERFACE_H
#include <QMainWindow>
#include <QSettings>
namespace LimeReport {
class ReportDesignWindowInterface: public QMainWindow{
public:
ReportDesignWindowInterface(QWidget* parent = 0): QMainWindow(parent){}
virtual bool checkNeedToSave() = 0;
virtual void showModal() = 0;
virtual void showNonModal() = 0;
virtual void setSettings(QSettings* value) = 0;
virtual QSettings* settings() = 0;
virtual void restoreSetting() = 0;
virtual void setShowProgressDialog(bool value) = 0;
};
} // namespace LimeReport
#endif // LRREPORTDESIGNWINDOWINTRERFACE_H

View File

@ -39,6 +39,7 @@
#include "lrdatasourcemanagerintf.h"
#include "lrscriptenginemanagerintf.h"
#include "lrpreviewreportwidget.h"
#include "lrreportdesignwindowintrerface.h"
class QPrinter;
@ -85,6 +86,7 @@ public:
bool printToPDF(const QString& fileName);
void previewReport(PreviewHints hints = PreviewBarsUserSetting);
void designReport();
ReportDesignWindowInterface* getDesignerWindow();
void setShowProgressDialog(bool value);
IDataSourceManager* dataManager();
IScriptEngineManager* scriptManager();

120
limerender/limerender.h Normal file
View File

@ -0,0 +1,120 @@
/***************************************************************************
* This file is part of the Lime Report project *
* Copyright (C) 2015 by Alexander Arin *
* arin_a@bk.ru *
* *
** GNU General Public License Usage **
* *
* This library is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
** GNU Lesser General Public License **
* *
* This library is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library. *
* If not, see <http://www.gnu.org/licenses/>. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
****************************************************************************/
#ifndef LRLIMERENDER_H
#define LRLIMERENDER_H
#include <QObject>
#include <QSettings>
#include <QPrintDialog>
//#include <QJSEngine>
#include "lrreportrender.h"
#include "limerender_p.h"
#include "lrglobal.h"
#include "lrdatasourcemanagerintf.h"
#include "lrscriptenginemanagerintf.h"
#include "lrpreviewreportwidget.h"
class QPrinter;
namespace LimeReport {
//class PrintRange{
//public:
// int fromPage() const { return m_fromPage;}
// int toPage() const { return m_toPage;}
// QPrintDialog::PrintRange rangeType() const { return m_rangeType;}
// PrintRange(QAbstractPrintDialog::PrintRange rangeType=QPrintDialog::AllPages, int fromPage=0, int toPage=0);
// void setRangeType(QAbstractPrintDialog::PrintRange rangeType){ m_rangeType=rangeType;}
// void setFromPage(int fromPage){ m_fromPage = fromPage;}
// void setToPage(int toPage){ m_toPage = toPage;}
//private:
// QPrintDialog::PrintRange m_rangeType;
// int m_fromPage;
// int m_toPage;
//};
class DataSourceManager;
class LimeRenderPrivate;
class PageDesignIntf;
class PageItemDesignIntf;
class PreviewReportWidget;
typedef QList< QSharedPointer<PageItemDesignIntf> > ReportPages;
class LIMEREPORT_EXPORT LimeRender : public QObject{
Q_OBJECT
friend class PreviewReportWidget;
public:
static void setSettings(QSettings *value){m_settings=value;}
public:
explicit LimeRender(QObject *parent = 0);
~LimeRender();
bool printReport(QPrinter *printer=0);
bool printPages(ReportPages pages, QPrinter *printer);
void printToFile(const QString& fileName);
PageDesignIntf *createPreviewScene(QObject *parent = 0);
bool printToPDF(const QString& fileName);
void previewReport(PreviewHints hints = PreviewBarsUserSetting);
IDataSourceManager* dataManager();
IScriptEngineManager* scriptManager();
bool loadFromFile(const QString& fileName, bool autoLoadPreviewOnChange = false);
bool loadFromByteArray(QByteArray *data);
bool loadFromString(const QString& data);
QString lastError();
PreviewReportWidget *createPreviewWidget(QWidget *parent = 0);
void setPreviewWindowTitle(const QString& title);
void setPreviewWindowIcon(const QIcon& icon);
void setResultEditable(bool value);
bool resultIsEditable();
bool isBusy();
void setPassPharse(QString& passPharse);
QList<QLocale::Language> aviableLanguages();
bool setReportLanguage(QLocale::Language language);
Qt::LayoutDirection previewLayoutDirection();
void setPreviewLayoutDirection(const Qt::LayoutDirection& previewLayoutDirection);
signals:
void renderStarted();
void renderFinished();
void renderPageFinished(int renderedPageCount);
void onLoad(bool& loaded);
public slots:
void cancelRender();
protected:
LimeRenderPrivate * const d_ptr;
LimeRender(LimeRenderPrivate &dd, QObject * parent=0);
private:
Q_DECLARE_PRIVATE(LimeRender)
static QSettings* m_settings;
};
} // namespace LimeReport
#endif // LRLIMERENDER_H

156
limerender/limerender.pri Normal file
View File

@ -0,0 +1,156 @@
include(../common.pri)
DEFINES += IS_RENDER_BUILD
INCLUDEPATH += \
$$REPORT_PATH/ \
$$REPORT_PATH/items \
$$REPORT_PATH/bands \
$$REPORT_PATH/base \
$$REPORT_PATH/scripteditor
SOURCES += \
$$REPORT_PATH/bands/lrpageheader.cpp \
$$REPORT_PATH/bands/lrpagefooter.cpp \
$$REPORT_PATH/bands/lrreportheader.cpp \
$$REPORT_PATH/bands/lrreportfooter.cpp \
$$REPORT_PATH/bands/lrdataband.cpp \
$$REPORT_PATH/bands/lrgroupbands.cpp \
$$REPORT_PATH/bands/lrsubdetailband.cpp \
$$REPORT_PATH/bands/lrtearoffband.cpp \
$$REPORT_PATH/serializators/lrxmlqrectserializator.cpp \
$$REPORT_PATH/serializators/lrxmlbasetypesserializators.cpp \
$$REPORT_PATH/serializators/lrxmlreader.cpp \
$$REPORT_PATH/serializators/lrxmlwriter.cpp \
$$REPORT_PATH/scripteditor/lrscripteditor.cpp \
$$REPORT_PATH/scripteditor/lrcodeeditor.cpp \
$$REPORT_PATH/scripteditor/lrscripthighlighter.cpp \
$$REPORT_PATH/items/lrhorizontallayout.cpp \
$$REPORT_PATH/items/editors/lritemeditorwidget.cpp \
$$REPORT_PATH/items/editors/lrfonteditorwidget.cpp \
$$REPORT_PATH/items/editors/lrtextalignmenteditorwidget.cpp \
$$REPORT_PATH/items/editors/lritemsaligneditorwidget.cpp \
$$REPORT_PATH/items/editors/lritemsborderseditorwidget.cpp \
$$REPORT_PATH/items/lrsimpletagparser.cpp \
$$REPORT_PATH/items/lrimageitem.cpp \
$$REPORT_PATH/items/lrtextitemeditor.cpp \
$$REPORT_PATH/items/lrshapeitem.cpp \
$$REPORT_PATH/items/lrtextitem.cpp \
$$REPORT_PATH/lrbanddesignintf.cpp \
$$REPORT_PATH/lrpageitemdesignintf.cpp \
$$REPORT_PATH/lrpagedesignintf.cpp \
$$REPORT_PATH/lrbandsmanager.cpp \
$$REPORT_PATH/lrglobal.cpp \
$$REPORT_PATH/lritemdesignintf.cpp \
$$REPORT_PATH/lrdatadesignintf.cpp \
$$REPORT_PATH/lrbasedesignintf.cpp \
$$REPORT_PATH/lrdatasourcemanager.cpp \
$$REPORT_PATH/lrreportrender.cpp \
$$REPORT_PATH/lrscriptenginemanager.cpp \
$$REPORT_PATH/lrpreviewreportwindow.cpp \
$$REPORT_PATH/lrpreviewreportwidget.cpp \
$$REPORT_PATH/lrgraphicsviewzoom.cpp \
$$REPORT_PATH/lrvariablesholder.cpp \
$$REPORT_PATH/lrgroupfunctions.cpp \
$$REPORT_PATH/lrsimplecrypt.cpp \
$$REPORT_PATH/lraboutdialog.cpp \
$$REPORT_PATH/lritemscontainerdesignitf.cpp \
$$REPORT_PATH/lrcolorindicator.cpp \
$$REPORT_PATH/items/lrchartitem.cpp \
$$REPORT_PATH/lrreporttranslation.cpp
# $$PWD/lrreportrender.cpp
contains(CONFIG, staticlib){
SOURCES += $$REPORT_PATH/lrfactoryinitializer.cpp
}
contains(CONFIG, zint){
SOURCES += $$REPORT_PATH/items/lrbarcodeitem.cpp
}
HEADERS += \
$$REPORT_PATH/base/lrsingleton.h \
$$REPORT_PATH/base/lrsimpleabstractfactory.h \
$$REPORT_PATH/base/lrattribsabstractfactory.h \
$$REPORT_PATH/bands/lrpageheader.h \
$$REPORT_PATH/bands/lrpagefooter.h \
$$REPORT_PATH/bands/lrreportheader.h \
$$REPORT_PATH/bands/lrreportfooter.h \
$$REPORT_PATH/bands/lrdataband.h \
$$REPORT_PATH/bands/lrtearoffband.h \
$$REPORT_PATH/bands/lrsubdetailband.h \
$$REPORT_PATH/bands/lrgroupbands.h \
$$REPORT_PATH/serializators/lrserializatorintf.h \
$$REPORT_PATH/serializators/lrstorageintf.h \
$$REPORT_PATH/serializators/lrxmlqrectserializator.h \
$$REPORT_PATH/serializators/lrxmlserializatorsfactory.h \
$$REPORT_PATH/serializators/lrxmlbasetypesserializators.h \
$$REPORT_PATH/serializators/lrxmlreader.h \
$$REPORT_PATH/serializators/lrxmlwriter.h \
$$REPORT_PATH/scripteditor/lrscripteditor.h \
$$REPORT_PATH/scripteditor/lrcodeeditor.h \
$$REPORT_PATH/scripteditor/lrscripthighlighter.h \
$$REPORT_PATH/items/editors/lritemeditorwidget.h \
$$REPORT_PATH/items/editors/lrfonteditorwidget.h \
$$REPORT_PATH/items/editors/lrtextalignmenteditorwidget.h \
$$REPORT_PATH/items/editors/lritemsaligneditorwidget.h \
$$REPORT_PATH/items/editors/lritemsborderseditorwidget.h \
$$REPORT_PATH/items/lrtextitem.h \
$$REPORT_PATH/items/lrhorizontallayout.h \
$$REPORT_PATH/items/lrtextitemeditor.h \
$$REPORT_PATH/items/lrshapeitem.h \
$$REPORT_PATH/items/lrimageitem.h \
$$REPORT_PATH/items/lrsimpletagparser.h \
$$REPORT_PATH/lrfactoryinitializer.h \
$$REPORT_PATH/lrbanddesignintf.h \
$$REPORT_PATH/lrpageitemdesignintf.h \
$$REPORT_PATH/lrbandsmanager.h \
$$REPORT_PATH/lrglobal.h \
$$REPORT_PATH/lrdatadesignintf.h \
$$REPORT_PATH/lrcollection.h \
$$REPORT_PATH/lrpagedesignintf.h \
$$REPORT_PATH/lrdatasourcemanager.h \
$$REPORT_PATH/lrreportrender.h \
$$REPORT_PATH/lrpreviewreportwindow.h \
$$REPORT_PATH/lrpreviewreportwidget.h \
$$REPORT_PATH/lrpreviewreportwidget_p.h \
$$REPORT_PATH/lrgraphicsviewzoom.h \
$$REPORT_PATH/lrbasedesignintf.h \
$$REPORT_PATH/lritemdesignintf.h \
$$REPORT_PATH/lrdesignelementsfactory.h \
$$REPORT_PATH/lrscriptenginemanager.h \
$$REPORT_PATH/lrvariablesholder.h \
$$REPORT_PATH/lrgroupfunctions.h \
$$REPORT_PATH/lrdatasourcemanagerintf.h \
$$REPORT_PATH/lrscriptenginemanagerintf.h \
$$REPORT_PATH/lrsimplecrypt.h \
$$REPORT_PATH/lraboutdialog.h \
$$REPORT_PATH/lrcallbackdatasourceintf.h \
$$REPORT_PATH/lrpreviewreportwidget_p.h \
$$REPORT_PATH/lritemscontainerdesignitf.h \
$$REPORT_PATH/lrcolorindicator.h \
$$REPORT_PATH/items/lrchartitem.h \
$$REPORT_PATH/lrreporttranslation.h
# $$PWD/limerender.h \
# $$PWD/limerender_p.h
contains(CONFIG, staticlib){
HEADERS += $$REPORT_PATH/lrfactoryinitializer.h
}
contains(CONFIG,zint){
HEADERS += $$REPORT_PATH/items/lrbarcodeitem.h
}
FORMS += \
$$REPORT_PATH/lrpreviewreportwindow.ui \
$$REPORT_PATH/lrpreviewreportwidget.ui \
$$REPORT_PATH/items/lrtextitemeditor.ui \
$$REPORT_PATH/lraboutdialog.ui \
$$REPORT_PATH/scripteditor/lrscripteditor.ui
RESOURCES += \
$$REPORT_PATH/report.qrc \
$$REPORT_PATH/items/items.qrc

124
limerender/limerender.pro Normal file
View File

@ -0,0 +1,124 @@
contains(CONFIG,release) {
TARGET = limerender
} else {
TARGET = limerenderd
}
TEMPLATE = lib
contains(CONFIG, static_build){
CONFIG += staticlib
}
!contains(CONFIG, staticlib){
CONFIG += lib
CONFIG += dll
}
CONFIG += create_prl
CONFIG += link_prl
macx{
CONFIG -= dll
CONFIG += lib_bundle
CONFIG += plugin
}
DEFINES += LIMEREPORT_EXPORTS
contains(CONFIG, staticlib){
DEFINES += HAVE_STATIC_BUILD
message(STATIC_BUILD)
DEFINES -= LIMEREPORT_EXPORTS
}
EXTRA_FILES += \
$$PWD/../limereport/lrglobal.cpp \
$$PWD/../limereport/lrglobal.h \
$$PWD/../limereport/lrdatasourcemanagerintf.h \
$$PWD/../limereport/lrreportengine.h \
$$PWD/../limereport/lrscriptenginemanagerintf.h \
$$PWD/../limereport/lrcallbackdatasourceintf.h \
$$PWD/../limereport/lrpreviewreportwidget.h
include(limerender.pri)
unix:{
DESTDIR = $${DEST_LIBS}
linux{
QMAKE_POST_LINK += mkdir -p $$quote($${DEST_INCLUDE_DIR}) $$escape_expand(\\n\\t) # qmake need make mkdir -p on subdirs more than root/
for(FILE,EXTRA_FILES){
QMAKE_POST_LINK += $$QMAKE_COPY $$quote($$FILE) $$quote($${DEST_INCLUDE_DIR}) $$escape_expand(\\n\\t) # inside of libs make /include/files
}
}
macx{
for(FILE,EXTRA_FILES){
QMAKE_POST_LINK += $$QMAKE_COPY $$quote($$FILE) $$quote($${DEST_INCLUDE_DIR}) $$escape_expand(\\n\\t)
}
QMAKE_POST_LINK += mkdir -p $$quote($${DESTDIR}/include) $$escape_expand(\\n\\t)
}
QMAKE_POST_LINK += $$QMAKE_COPY_DIR $$quote($${DEST_INCLUDE_DIR}) $$quote($${DESTDIR})
}
win32 {
EXTRA_FILES ~= s,/,\\,g
BUILD_DIR ~= s,/,\\,g
DESTDIR = $${DEST_LIBS}
DEST_DIR = $$DESTDIR/include
DEST_DIR ~= s,/,\\,g
DEST_INCLUDE_DIR ~= s,/,\\,g
for(FILE,EXTRA_FILES){
QMAKE_POST_LINK += $$QMAKE_COPY \"$$FILE\" \"$${DEST_INCLUDE_DIR}\" $$escape_expand(\\n\\t)
}
QMAKE_POST_LINK += $$QMAKE_COPY_DIR \"$${DEST_INCLUDE_DIR}\" \"$${DEST_DIR}\"
}
contains(CONFIG,zint){
message(zint)
INCLUDEPATH += $$ZINT_PATH/backend $$ZINT_PATH/backend_qt
DEPENDPATH += $$ZINT_PATH/backend $$ZINT_PATH/backend_qt
LIBS += -L$${DEST_LIBS}
contains(CONFIG,release) {
LIBS += -lQtZint
} else {
LIBS += -lQtZintd
}
}
####Automatically build required translation files (*.qm)
contains(CONFIG,build_translations){
LANGUAGES = ru es_ES ar
defineReplace(prependAll) {
for(a,$$1):result += $$2$${a}$$3
return($$result)
}
TRANSLATIONS = $$prependAll(LANGUAGES, \"$$TRANSLATIONS_PATH/limereport_,.ts\")
qtPrepareTool(LUPDATE, lupdate)
greaterThan(QT_MAJOR_VERSION, 4) {
ts.commands = $$LUPDATE $$shell_quote($$PWD) -ts $$TRANSLATIONS
}
lessThan(QT_MAJOR_VERSION, 5){
ts.commands = $$LUPDATE $$quote($$PWD) -ts $$TRANSLATIONS
}
TRANSLATIONS_FILES =
qtPrepareTool(LRELEASE, lrelease)
for(tsfile, TRANSLATIONS) {
qmfile = $$tsfile
qmfile ~= s,".ts\"$",".qm\"",
qm.commands += $$LRELEASE -removeidentical $$tsfile -qm $$qmfile $$escape_expand(\\n\\t)
tmp_command = $$LRELEASE -removeidentical $$tsfile -qm $$qmfile $$escape_expand(\\n\\t)
TRANSLATIONS_FILES += $$qmfile
}
qm.depends = ts
OTHER_FILES += $$TRANSLATIONS
QMAKE_EXTRA_TARGETS += qm ts
POST_TARGETDEPS += qm
}
#### EN AUTOMATIC TRANSLATIONS

192
limerender/limerender_p.h Normal file
View File

@ -0,0 +1,192 @@
/***************************************************************************
* This file is part of the Lime Report project *
* Copyright (C) 2015 by Alexander Arin *
* arin_a@bk.ru *
* *
** GNU General Public License Usage **
* *
* This library is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
** GNU Lesser General Public License **
* *
* This library is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library. *
* If not, see <http://www.gnu.org/licenses/>. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
****************************************************************************/
#ifndef LRLIMERENDER_P_H
#define LRLIMERENDER_P_H
#include <QObject>
#include <QSharedPointer>
#include <QMainWindow>
#include "limerender.h"
#include "lrcollection.h"
#include "lrglobal.h"
#include "lrdatasourcemanager.h"
#include "lrbanddesignintf.h"
#include "serializators/lrstorageintf.h"
#include "lrscriptenginemanager.h"
#include "lrreporttranslation.h"
class QFileSystemWatcher;
namespace LimeReport{
class PageDesignIntf;
class PrintRange;
class ReportDesignWindow;
//TODO: Add on render callback
class LimeRenderPrivate : public QObject, public ICollectionContainer, public ITranslationContainer
{
Q_OBJECT
Q_DECLARE_PUBLIC(ReportEngine)
Q_PROPERTY(ACollectionProperty pages READ fakeCollectionReader())
Q_PROPERTY(QObject* datasourcesManager READ dataManager)
Q_PROPERTY(QObject* scriptContext READ scriptContext)
Q_PROPERTY(bool suppressFieldAndVarError READ suppressFieldAndVarError WRITE setSuppressFieldAndVarError)
Q_PROPERTY(ATranslationProperty translation READ fakeTranslationReader)
friend class PreviewReportWidget;
public:
static void printReport(ItemsReaderIntf::Ptr reader, QPrinter &printer);
static void printReport(ReportPages pages, QPrinter &printer);
Q_INVOKABLE QStringList aviableReportTranslations();
Q_INVOKABLE void setReportTranslation(const QString& languageName);
public:
explicit LimeRenderPrivate(QObject *parent = 0);
virtual ~LimeRenderPrivate();
PageDesignIntf* appendPage(const QString& pageName="");
bool deletePage(PageDesignIntf *page);
PageDesignIntf* createPreviewPage();
PageDesignIntf* pageAt(int index){return (index<=(m_pages.count()-1)) ? m_pages.at(index):0;}
int pageCount() {return m_pages.count();}
DataSourceManager* dataManager(){return m_datasources;}
ScriptEngineContext* scriptContext(){return m_scriptEngineContext;}
ScriptEngineManager* scriptManager();
IDataSourceManager* dataManagerIntf(){return m_datasources;}
IScriptEngineManager* scriptManagerIntf(){
ScriptEngineManager::instance().setDataManager(dataManager());
return &ScriptEngineManager::instance();
}
void clearReport();
bool printReport(QPrinter *printer=0);
bool printPages(ReportPages pages, QPrinter *printer);
void printToFile(const QString& fileName);
bool printToPDF(const QString& fileName);
void previewReport(PreviewHints hints = PreviewBarsUserSetting);
void setSettings(QSettings* value);
QSettings* settings();
bool loadFromFile(const QString& fileName, bool autoLoadPreviewOnChange);
bool loadFromByteArray(QByteArray *data, const QString& name = "");
bool loadFromString(const QString& report, const QString& name = "");
QString lastError();
ReportEngine * q_ptr;
bool emitLoadReport();
bool hasActivePreview(){return m_activePreview;}
PageDesignIntf *createPreviewScene(QObject *parent);
PreviewReportWidget *createPreviewWidget(QWidget *parent);
QIcon previewWindowIcon() const;
void setPreviewWindowIcon(const QIcon &previewWindowIcon);
QString previewWindowTitle() const;
void setPreviewWindowTitle(const QString &previewWindowTitle);
bool suppressFieldAndVarError() const;
void setSuppressFieldAndVarError(bool suppressFieldAndVarError);
bool isBusy();
bool resultIsEditable() const;
void setResultEditable(bool value);
void setPassPhrase(const QString &passPhrase);
bool addTranslationLanguage(QLocale::Language language);
bool removeTranslationLanguage(QLocale::Language language);
bool setReportLanguage(QLocale::Language language);
QList<QLocale::Language> aviableLanguages();
ReportTranslation* reportTranslation(QLocale::Language language);
void reorderPages(const QList<PageDesignIntf *> &reorderedPages);
void clearSelection();
Qt::LayoutDirection previewLayoutDirection();
void setPreviewLayoutDirection(const Qt::LayoutDirection& previewLayoutDirection);
signals:
void pagesLoadFinished();
void datasourceCollectionLoadFinished(const QString& collectionName);
void cleared();
void renderStarted();
void renderFinished();
void renderPageFinished(int renderedPageCount);
void onLoad(bool& loaded);
public slots:
bool slotLoadFromFile(const QString& fileName);
void cancelRender();
protected:
PageDesignIntf* createPage(const QString& pageName="");
protected slots:
void slotDataSourceCollectionLoaded(const QString& collectionName);
private slots:
void slotPreviewWindowDestroyed(QObject *window);
private:
//ICollectionContainer
virtual QObject* createElement(const QString&,const QString&);
virtual int elementsCount(const QString&);
virtual QObject* elementAt(const QString&, int index);
virtual void collectionLoadFinished(const QString&);
void saveError(QString message);
void showError(QString message);
//ICollectionContainer
//ITranslationContainer
Translations* translations(){ return &m_translations;}
void updateTranslations();
//ITranslationContainer
ReportPages renderToPages();
QString renderToString();
PageDesignIntf* getPageByName(const QString& pageName);
ATranslationProperty fakeTranslationReader(){ return ATranslationProperty();}
private:
QList<PageDesignIntf*> m_pages;
DataSourceManager* m_datasources;
ScriptEngineContext* m_scriptEngineContext;
ReportRender::Ptr m_reportRender;
QString m_fileName;
QString m_lastError;
QSettings* m_settings;
bool m_ownedSettings;
QScopedPointer<QPrinter> m_printer;
bool m_printerSelected;
bool m_showProgressDialog;
QString m_reportsDir;
QString m_reportName;
QMainWindow* m_activePreview;
QIcon m_previewWindowIcon;
QString m_previewWindowTitle;
QPointer<ReportDesignWindow> m_designerWindow;
ReportSettings m_reportSettings;
bool m_LimeRendering;
bool m_resultIsEditable;
QString m_passPhrase;
QFileSystemWatcher *m_fileWatcher;
Translations m_translations;
QLocale::Language m_reportLanguage;
void activateLanguage(QLocale::Language language);
Qt::LayoutDirection m_previewLayoutDirection;
};
}
#endif // LRLIMERENDER_P_H

File diff suppressed because it is too large Load Diff

View File

@ -10,12 +10,19 @@ contains(CONFIG, zint){
}
export($$CONFIG)
SUBDIRS += \
limereport
CONFIG += ordered
SUBDIRS += limereport
CONFIG += ordered
SUBDIRS += demo_r1 demo_r2 designer
!contains(CONFIG, embedded_designer){
!contains(CONFIG, static_build){
SUBDIRS += designer_plugin
}
}

View File

@ -277,7 +277,7 @@ QSettings *DataBrowser::settings()
if (m_settings){
return m_settings;
} else {
m_settings = new QSettings("LimeReport",QApplication::applicationName());
m_settings = new QSettings("LimeReport",QCoreApplication::applicationName());
m_ownedSettings = true;
return m_settings;
}

View File

@ -78,7 +78,7 @@ QSettings *SQLEditDialog::settings(){
if (m_settings){
return m_settings;
} else {
m_settings = new QSettings("LimeReport",QApplication::applicationName());
m_settings = new QSettings("LimeReport",QCoreApplication::applicationName());
m_ownedSettings = true;
return m_settings;
}

View File

@ -31,23 +31,9 @@
namespace LimeReport{
FontEditorWidget::FontEditorWidget(ReportDesignWidget *reportEditor, const QString &title, QWidget *parent)
: ItemEditorWidget(reportEditor,title,parent), m_ignoreSlots(false) {
initEditor();
}
FontEditorWidget::FontEditorWidget(ReportDesignWidget *reportEditor, QWidget *parent)
:ItemEditorWidget(reportEditor,parent), m_ignoreSlots(false) {
initEditor();
}
FontEditorWidget::FontEditorWidget(PageDesignIntf *page, const QString &title, QWidget *parent)
:ItemEditorWidget(page,title,parent), m_ignoreSlots(false) {
initEditor();
}
FontEditorWidget::FontEditorWidget(LimeReport::PageDesignIntf *page, QWidget *parent)
:ItemEditorWidget(page,parent), m_ignoreSlots(false){
FontEditorWidget::FontEditorWidget(const QString& title, QWidget* parent)
:ItemEditorWidget(title, parent), m_ignoreSlots(false)
{
initEditor();
}
@ -101,10 +87,6 @@ void FontEditorWidget::initEditor()
connect(m_fontUnderline,SIGNAL(toggled(bool)),this,SLOT(slotFontAttribsChanged(bool)));
addAction(m_fontUnderline);
if (reportEditor()){
connect(reportEditor(),SIGNAL(itemPropertyChanged(QString,QString,QVariant,QVariant)),
this,SLOT(slotPropertyChanged(QString,QString,QVariant,QVariant)));
}
}
void FontEditorWidget::updateValues(const QFont& font)
@ -118,35 +100,31 @@ void FontEditorWidget::updateValues(const QFont& font)
m_ignoreSlots=false;
}
void FontEditorWidget::slotFontChanged(const QFont &font)
bool FontEditorWidget::ignoreSlots() const
{
if (reportEditor() && !m_ignoreSlots) reportEditor()->setFont(font);
if (page()) page()->setFont(font);
return m_ignoreSlots;
}
void FontEditorWidget::slotFontChanged(const QFont /*&font*/)
{
// if (page()) page()->setFont(font);
}
void FontEditorWidget::slotFontSizeChanged(const QString &value)
{
if (m_ignoreSlots) return;
QFont resFont(fontNameEditor()->currentFont());
resFont.setPointSize(value.toInt());
if (reportEditor()) reportEditor()->setFont(resFont);
if (page()) page()->setFont(resFont);
m_resFont = fontNameEditor()->currentFont();
m_resFont.setPointSize(value.toInt());
}
void FontEditorWidget::slotFontAttribsChanged(bool)
{
if (m_ignoreSlots) return;
QFont resFont(m_fontNameEditor->currentFont());
resFont.setBold(m_fontBold->isChecked());
resFont.setItalic(m_fontItalic->isChecked());
resFont.setUnderline(m_fontUnderline->isChecked());
if (reportEditor()) reportEditor()->setFont(resFont);
if (page()) page()->setFont(resFont);
m_resFont = m_fontNameEditor->currentFont();
m_resFont.setBold(m_fontBold->isChecked());
m_resFont.setItalic(m_fontItalic->isChecked());
m_resFont.setUnderline(m_fontUnderline->isChecked());
}
void FontEditorWidget::slotPropertyChanged(const QString &objectName, const QString &property, const QVariant& oldValue, const QVariant& newValue)
@ -159,4 +137,49 @@ void FontEditorWidget::slotPropertyChanged(const QString &objectName, const QStr
}
void FontEditorWidgetForPage::slotFontChanged(const QFont& font)
{
m_page->setFont(font);
}
void FontEditorWidgetForPage::slotFontSizeChanged(const QString& value)
{
FontEditorWidget::slotFontSizeChanged(value);
m_page->setFont(resFont());
}
void FontEditorWidgetForPage::slotFontAttribsChanged(bool value)
{
FontEditorWidget::slotFontAttribsChanged(value);
m_page->setFont(resFont());
}
#ifdef HAVE_REPORT_DESIGNER
void FontEditorWidgetForDesigner::initEditor()
{
FontEditorWidget::initEditor();
connect(m_reportEditor,SIGNAL(itemPropertyChanged(QString,QString,QVariant,QVariant)),
this,SLOT(slotPropertyChanged(QString,QString,QVariant,QVariant)));
}
void FontEditorWidgetForDesigner::slotFontChanged(const QFont& font)
{
if (!ignoreSlots()) m_reportEditor->setFont(font);
}
void FontEditorWidgetForDesigner::slotFontSizeChanged(const QString& value)
{
FontEditorWidget::slotFontSizeChanged(value);
m_reportEditor->setFont(resFont());
}
void FontEditorWidgetForDesigner::slotFontAttribsChanged(bool value)
{
FontEditorWidget::slotFontAttribsChanged(value);
m_reportEditor->setFont(resFont());
}
#endif
} //namespace LimeReport

View File

@ -35,7 +35,10 @@
#include <QStringListModel>
#include <QAction>
#ifdef HAVE_REPORT_DESIGNER
#include "lrreportdesignwidget.h"
#endif
#include "lritemeditorwidget.h"
namespace LimeReport{
@ -43,20 +46,21 @@ namespace LimeReport{
class FontEditorWidget :public ItemEditorWidget{
Q_OBJECT
public:
explicit FontEditorWidget(ReportDesignWidget* reportEditor, const QString &title, QWidget *parent = 0);
explicit FontEditorWidget(ReportDesignWidget* reportEditor, QWidget *parent = 0);
explicit FontEditorWidget(PageDesignIntf* page, const QString &title, QWidget *parent = 0);
explicit FontEditorWidget(PageDesignIntf* page, QWidget *parent = 0);
explicit FontEditorWidget(const QString &title, QWidget *parent = 0);
bool ignoreSlots() const;
protected:
void setItemEvent(BaseDesignIntf *item);
QFontComboBox* fontNameEditor(){return m_fontNameEditor;}
private slots:
void slotFontChanged(const QFont& font);
void slotFontSizeChanged(const QString& value);
void slotFontAttribsChanged(bool);
virtual void initEditor();
protected slots:
virtual void slotFontChanged(const QFont);
virtual void slotFontSizeChanged(const QString& value);
virtual void slotFontAttribsChanged(bool);
void slotPropertyChanged(const QString& objectName, const QString& property, const QVariant &oldValue, const QVariant &newValue);
protected:
QFont resFont(){return m_resFont;}
private:
void initEditor();
void updateValues(const QFont &font);
QFontComboBox* m_fontNameEditor;
@ -68,9 +72,41 @@ private:
QAction* m_fontUnderline;
bool m_ignoreSlots;
QFont m_resFont;
};
class FontEditorWidgetForPage : public FontEditorWidget{
Q_OBJECT
public:
explicit FontEditorWidgetForPage(PageDesignIntf* page, const QString &title, QWidget *parent = 0)
: FontEditorWidget(title, parent), m_page(page){}
protected slots:
virtual void slotFontChanged(const QFont& font);
virtual void slotFontSizeChanged(const QString& value);
virtual void slotFontAttribsChanged(bool value);
private:
PageDesignIntf* m_page;
};
#ifdef HAVE_REPORT_DESIGNER
class FontEditorWidgetForDesigner : public FontEditorWidget{
Q_OBJECT
public:
explicit FontEditorWidgetForDesigner(ReportDesignWidget* reportEditor, const QString &title, QWidget *parent = 0)
: FontEditorWidget(title, parent), m_reportEditor(reportEditor){}
protected:
void initEditor();
protected slots:
virtual void slotFontChanged(const QFont& font);
virtual void slotFontSizeChanged(const QString& value);
virtual void slotFontAttribsChanged(bool value);
private:
ReportDesignWidget* m_reportEditor;
};
#endif
} //namespace LimeReport
#endif // LRFONTEDITORWIDGET_H

View File

@ -31,26 +31,6 @@
namespace LimeReport{
ItemEditorWidget::ItemEditorWidget(ReportDesignWidget* reportEditor, const QString& title, QWidget* parent)
:QToolBar(title,parent), m_reportEditor(reportEditor), m_item(0), m_page(0)
{
}
ItemEditorWidget::ItemEditorWidget(ReportDesignWidget* reportEditor, QWidget* parent)
:QToolBar(parent), m_reportEditor(reportEditor), m_item(0), m_page(0)
{
}
ItemEditorWidget::ItemEditorWidget(PageDesignIntf* page, const QString& title, QWidget* parent)
:QToolBar(title,parent), m_reportEditor(0), m_item(0), m_page(page)
{
}
ItemEditorWidget::ItemEditorWidget(PageDesignIntf* page, QWidget* parent)
:QToolBar(parent), m_reportEditor(0), m_item(0), m_page(page)
{
}
void ItemEditorWidget::setItem(BaseDesignIntf* item)
{
if (m_item!=item){

View File

@ -31,7 +31,11 @@
#define LRITEMEDITORWIDGET_H
#include <QToolBar>
#ifdef HAVE_REPORT_DESIGNER
#include "lrreportdesignwidget.h"
#endif
#include "lrpagedesignintf.h"
namespace LimeReport {
@ -39,26 +43,18 @@ class ItemEditorWidget : public QToolBar
{
Q_OBJECT
public:
explicit ItemEditorWidget(ReportDesignWidget* reportEditor, const QString &title, QWidget *parent = 0);
explicit ItemEditorWidget(ReportDesignWidget* reportEditor, QWidget *parent = 0);
explicit ItemEditorWidget(PageDesignIntf* page, const QString &title, QWidget *parent = 0);
explicit ItemEditorWidget(PageDesignIntf* page, QWidget *parent = 0);
explicit ItemEditorWidget(const QString &title, QWidget *parent = 0)
: QToolBar(title, parent), m_item(0){}
void setItem(BaseDesignIntf *item);
void setReportEditor(ReportDesignWidget* editor){m_reportEditor = editor;}
protected:
virtual void setItemEvent(BaseDesignIntf*){}
virtual void properyChangedEvent(const QString& propertName, const QVariant& oldValue, const QVariant& newValue);
BaseDesignIntf* item(){return m_item;}
ReportDesignWidget* reportEditor(){return m_reportEditor;}
PageDesignIntf* page(){return m_page;}
private slots:
void slotItemDestroyed(QObject* item);
void slotPropertyChanged(const QString& propertName, const QVariant& oldValue, const QVariant& newValue);
private:
ReportDesignWidget* m_reportEditor;
BaseDesignIntf* m_item;
PageDesignIntf* m_page;
};
} // namespace LimeReport

View File

@ -32,18 +32,6 @@
namespace LimeReport{
ItemsBordersEditorWidget::ItemsBordersEditorWidget(ReportDesignWidget* reportEditor, const QString& title, QWidget* parent)
: ItemEditorWidget(reportEditor,title,parent), m_changing(false)
{
initEditor();
}
ItemsBordersEditorWidget::ItemsBordersEditorWidget(ReportDesignWidget* reportEditor, QWidget* parent)
: ItemEditorWidget(reportEditor,parent), m_changing(false)
{
initEditor();
}
void ItemsBordersEditorWidget::setItemEvent(BaseDesignIntf* item)
{
QVariant borders=item->property("borders");
@ -65,8 +53,6 @@ void ItemsBordersEditorWidget::properyChangedEvent(const QString& property, cons
void ItemsBordersEditorWidget::noBordesClicked()
{
if (reportEditor())
reportEditor()->setBorders(0);
updateValues(0);
}
@ -78,14 +64,11 @@ void ItemsBordersEditorWidget::allBordesClicked()
BaseDesignIntf::BottomLine;
updateValues((BaseDesignIntf::BorderLines)borders);
if (reportEditor())
reportEditor()->setBorders((BaseDesignIntf::BorderLines)borders);
}
void ItemsBordersEditorWidget::buttonClicked(bool)
{
if (!m_changing&&reportEditor())
reportEditor()->setBorders(createBorders());
}
void ItemsBordersEditorWidget::initEditor()
@ -151,4 +134,29 @@ BaseDesignIntf::BorderLines ItemsBordersEditorWidget::createBorders()
return (BaseDesignIntf::BorderLines)borders;
}
bool ItemsBordersEditorWidget::changing() const
{
return m_changing;
}
#ifdef HAVE_REPORT_DESIGNER
void ItemsBordersEditorWidgetForDesigner::buttonClicked(bool)
{
if (!changing())
m_reportEditor->setBorders(createBorders());
}
void ItemsBordersEditorWidgetForDesigner::noBordesClicked()
{
m_reportEditor->setBorders(0);
ItemsBordersEditorWidget::noBordesClicked();
}
void ItemsBordersEditorWidgetForDesigner::allBordesClicked()
{
ItemsBordersEditorWidget::allBordesClicked();
m_reportEditor->setBorders(createBorders());
}
#endif
} //namespace LimeReport

View File

@ -40,19 +40,22 @@ class ItemsBordersEditorWidget : public ItemEditorWidget
{
Q_OBJECT
public:
explicit ItemsBordersEditorWidget(ReportDesignWidget* reportEditor, const QString &title, QWidget *parent = 0);
explicit ItemsBordersEditorWidget(ReportDesignWidget* reportEditor, QWidget *parent = 0);
private slots:
void noBordesClicked();
void allBordesClicked();
void buttonClicked(bool);
explicit ItemsBordersEditorWidget(const QString &title, QWidget *parent = 0)
: ItemEditorWidget(title, parent), m_changing(false), m_borders(0){
initEditor();
}
bool changing() const;
protected slots:
virtual void noBordesClicked();
virtual void allBordesClicked();
virtual void buttonClicked(bool);
protected:
void setItemEvent(BaseDesignIntf *item);
void properyChangedEvent(const QString &property, const QVariant &oldValue, const QVariant &newValue);
BaseDesignIntf::BorderLines createBorders();
private:
void initEditor();
void updateValues(BaseDesignIntf::BorderLines borders);
BaseDesignIntf::BorderLines createBorders();
QAction* m_noLines;
QAction* m_leftLine;
QAction* m_rightLine;
@ -60,8 +63,24 @@ private:
QAction* m_bottomLine;
QAction* m_allLines;
bool m_changing;
int m_borders;
};
#ifdef HAVE_REPORT_DESIGNER
class ItemsBordersEditorWidgetForDesigner : public ItemsBordersEditorWidget{
Q_OBJECT
public:
explicit ItemsBordersEditorWidgetForDesigner(ReportDesignWidget* reportEditor, const QString &title="", QWidget *parent = 0)
: ItemsBordersEditorWidget(title,parent), m_reportEditor(reportEditor){}
protected slots:
void buttonClicked(bool);
void noBordesClicked();
void allBordesClicked();
private:
ReportDesignWidget* m_reportEditor;
};
#endif
}//namespace LimeReport
#endif // LRITEMSBORDERSEDITORWIDGET_H

View File

@ -30,27 +30,8 @@
#include "lrtextalignmenteditorwidget.h"
namespace LimeReport{
TextAlignmentEditorWidget::TextAlignmentEditorWidget(ReportDesignWidget *reportEditor, const QString &title, QWidget *parent)
:ItemEditorWidget(reportEditor,title,parent), m_textAttibutesIsChanging(false)
{
initEditor();
}
TextAlignmentEditorWidget::TextAlignmentEditorWidget(ReportDesignWidget *reportEditor, QWidget *parent)
:ItemEditorWidget(reportEditor,parent), m_textAttibutesIsChanging(false)
{
initEditor();
}
TextAlignmentEditorWidget::TextAlignmentEditorWidget(PageDesignIntf* page, const QString& title, QWidget* parent)
:ItemEditorWidget(page,title,parent), m_textAttibutesIsChanging(false)
{
initEditor();
}
TextAlignmentEditorWidget::TextAlignmentEditorWidget(PageDesignIntf* page, QWidget* parent)
:ItemEditorWidget(page,parent), m_textAttibutesIsChanging(false)
TextAlignmentEditorWidget::TextAlignmentEditorWidget(const QString& title, QWidget* parent)
:ItemEditorWidget(title, parent), m_textAttibutesIsChanging(false), m_flag(0)
{
initEditor();
}
@ -109,15 +90,6 @@ void TextAlignmentEditorWidget::initEditor()
m_textAliginBottom->setCheckable(true);
connect(m_textAliginBottom,SIGNAL(toggled(bool)),this,SLOT(slotTextVAttribsChanged(bool)));
addAction(m_textAliginBottom);
if (reportEditor()){
connect(reportEditor(),SIGNAL(itemPropertyChanged(QString,QString,QVariant,QVariant)),
this,SLOT(slotPropertyChanged(QString,QString,QVariant,QVariant)));
}
if (page()){
connect(page(),SIGNAL(itemPropertyChanged(QString,QString,QVariant,QVariant)),
this,SLOT(slotPropertyChanged(QString,QString,QVariant,QVariant)));
}
setEnabled(false);
}
@ -157,17 +129,11 @@ void TextAlignmentEditorWidget::slotTextHAttribsChanged(bool)
m_textAliginRight->setChecked(sender()==m_textAliginRight);
m_textAliginJustify->setChecked(sender()==m_textAliginJustify);
int flag = 0;
if (sender()==m_textAliginLeft) flag |= Qt::AlignLeft;
if (sender()==m_textAliginHCenter) flag |= Qt::AlignHCenter;
if (sender()==m_textAliginRight) flag |= Qt::AlignRight;
if (sender()==m_textAliginJustify) flag |= Qt::AlignJustify;
if (reportEditor()) reportEditor()->setTextAlign(true,Qt::AlignmentFlag(flag));
if (page()) {
//page()->setTextAlign(createAlignment());
page()->changeSelectedGrpoupTextAlignPropperty(true,Qt::AlignmentFlag(flag));
}
m_flag = 0;
if (sender()==m_textAliginLeft) m_flag |= Qt::AlignLeft;
if (sender()==m_textAliginHCenter) m_flag |= Qt::AlignHCenter;
if (sender()==m_textAliginRight) m_flag |= Qt::AlignRight;
if (sender()==m_textAliginJustify) m_flag |= Qt::AlignJustify;
m_textAttibutesIsChanging = false;
}
@ -180,13 +146,10 @@ void TextAlignmentEditorWidget::slotTextVAttribsChanged(bool)
m_textAliginVCenter->setChecked(sender()==m_textAliginVCenter);
m_textAliginBottom->setChecked(sender()==m_textAliginBottom);
int flag = 0;
if (sender()==m_textAliginTop) flag |= Qt::AlignTop;
if (sender()==m_textAliginVCenter) flag |= Qt::AlignVCenter;
if (sender()==m_textAliginBottom) flag |= Qt::AlignBottom;
if (reportEditor()) reportEditor()->setTextAlign(false,Qt::AlignmentFlag(flag));
if (page()) page()->changeSelectedGrpoupTextAlignPropperty(false,Qt::AlignmentFlag(flag) );
m_flag = 0;
if (sender()==m_textAliginTop) m_flag |= Qt::AlignTop;
if (sender()==m_textAliginVCenter) m_flag |= Qt::AlignVCenter;
if (sender()==m_textAliginBottom) m_flag |= Qt::AlignBottom;
m_textAttibutesIsChanging = false;
}
@ -200,5 +163,63 @@ void TextAlignmentEditorWidget::slotPropertyChanged(const QString &objectName, c
}
}
int TextAlignmentEditorWidget::flag() const
{
return m_flag;
}
void TextAlignmentEditorWidgetForPage::initEditor()
{
TextAlignmentEditorWidget::initEditor();
connect(m_page,SIGNAL(itemPropertyChanged(QString,QString,QVariant,QVariant)),
this,SLOT(slotPropertyChanged(QString,QString,QVariant,QVariant)));
}
void TextAlignmentEditorWidgetForPage::slotTextHAttribsChanged(bool value)
{
TextAlignmentEditorWidget::slotTextHAttribsChanged(value);
if (m_textAttibutesIsChanging) return;
m_textAttibutesIsChanging = true;
m_page->changeSelectedGrpoupTextAlignPropperty(true,Qt::AlignmentFlag(flag()));
m_textAttibutesIsChanging = false;
}
void TextAlignmentEditorWidgetForPage::slotTextVAttribsChanged(bool value)
{
TextAlignmentEditorWidget::slotTextVAttribsChanged(value);
if (m_textAttibutesIsChanging) return;
m_textAttibutesIsChanging = true;
m_page->changeSelectedGrpoupTextAlignPropperty(false,Qt::AlignmentFlag(flag()) );
m_textAttibutesIsChanging = false;
}
#ifdef HAVE_REPORT_DESIGNER
void TextAlignmentEditorWidgetForDesigner::initEditor()
{
TextAlignmentEditorWidget::initEditor();
connect(m_reportEditor,SIGNAL(itemPropertyChanged(QString,QString,QVariant,QVariant)),
this,SLOT(slotPropertyChanged(QString,QString,QVariant,QVariant)));
}
void TextAlignmentEditorWidgetForDesigner::slotTextHAttribsChanged(bool value)
{
TextAlignmentEditorWidget::slotTextHAttribsChanged(value);
if (m_textAttibutesIsChanging) return;
m_textAttibutesIsChanging = true;
m_reportEditor->setTextAlign(true,Qt::AlignmentFlag(flag()));
m_textAttibutesIsChanging = false;
}
void TextAlignmentEditorWidgetForDesigner::slotTextVAttribsChanged(bool value)
{
TextAlignmentEditorWidget::slotTextVAttribsChanged(value);
if (m_textAttibutesIsChanging) return;
m_textAttibutesIsChanging = true;
m_reportEditor->setTextAlign(false,Qt::AlignmentFlag(flag()));
m_textAttibutesIsChanging = false;
}
#endif
} //namespace LimeReport

View File

@ -41,23 +41,20 @@ class TextAlignmentEditorWidget:public ItemEditorWidget
{
Q_OBJECT
public:
explicit TextAlignmentEditorWidget(ReportDesignWidget* reportEditor, const QString &title, QWidget *parent = 0);
explicit TextAlignmentEditorWidget(ReportDesignWidget* reportEditor, QWidget *parent = 0);
explicit TextAlignmentEditorWidget(PageDesignIntf* page, const QString &title, QWidget *parent = 0);
explicit TextAlignmentEditorWidget(PageDesignIntf* page, QWidget *parent = 0);
explicit TextAlignmentEditorWidget(const QString &title, QWidget *parent = 0);
int flag() const;
protected:
void setItemEvent(BaseDesignIntf *item);
virtual void initEditor();
bool m_textAttibutesIsChanging;
private:
void initEditor();
void updateValues(const Qt::Alignment& align);
Qt::Alignment createAlignment();
private slots:
void slotTextHAttribsChanged(bool);
void slotTextVAttribsChanged(bool);
void slotPropertyChanged(const QString& objectName, const QString& property, const QVariant &oldValue, const QVariant &newValue);
protected slots:
virtual void slotTextHAttribsChanged(bool);
virtual void slotTextVAttribsChanged(bool);
virtual void slotPropertyChanged(const QString& objectName, const QString& property, const QVariant &oldValue, const QVariant &newValue);
private:
bool m_textAttibutesIsChanging;
QAction* m_textAliginLeft;
QAction* m_textAliginRight;
QAction* m_textAliginHCenter;
@ -65,9 +62,39 @@ private:
QAction* m_textAliginTop;
QAction* m_textAliginBottom;
QAction* m_textAliginVCenter;
int m_flag;
};
class TextAlignmentEditorWidgetForPage: public TextAlignmentEditorWidget{
Q_OBJECT
public:
TextAlignmentEditorWidgetForPage(PageDesignIntf* page, const QString &title, QWidget *parent = 0)
:TextAlignmentEditorWidget(title, parent), m_page(page){}
protected:
void initEditor();
protected slots:
void slotTextHAttribsChanged(bool value);
void slotTextVAttribsChanged(bool value);
private:
PageDesignIntf* m_page;
};
#ifdef HAVE_REPORT_DESIGNER
class TextAlignmentEditorWidgetForDesigner: public TextAlignmentEditorWidget{
Q_OBJECT
public:
TextAlignmentEditorWidgetForDesigner(ReportDesignWidget* reportEditor, const QString &title, QWidget *parent = 0)
:TextAlignmentEditorWidget(title, parent), m_reportEditor(reportEditor){}
protected:
void initEditor();
protected slots:
void slotTextHAttribsChanged(bool value);
void slotTextVAttribsChanged(bool value);
private:
ReportDesignWidget* m_reportEditor;
};
#endif
} //namespace LimeReport
#endif // LRTEXTALIGNMENTEDITORWIDGET_H

View File

@ -41,7 +41,7 @@ QSettings* ChartItemEditor::settings()
if (m_settings){
return m_settings;
} else {
m_settings = new QSettings("LimeReport",QApplication::applicationName());
m_settings = new QSettings("LimeReport",QCoreApplication::applicationName());
m_ownedSettings = true;
return m_settings;
}

View File

@ -483,7 +483,6 @@ TextItem::TextPtr TextItem::textDocument() const
QTextOption to;
to.setAlignment(m_alignment);
to.setTextDirection(m_textLayoutDirection);
//to.setTextDirection(QApplication::layoutDirection());
if (m_autoWidth!=MaxStringLength)
if (m_adaptFontToSize && (!(m_autoHeight || m_autoWidth)))

View File

@ -76,7 +76,7 @@ QSettings*TextItemEditor::settings()
if (m_settings){
return m_settings;
} else {
m_settings = new QSettings("LimeReport",QApplication::applicationName());
m_settings = new QSettings("LimeReport",QCoreApplication::applicationName());
m_ownedSettings = true;
return m_settings;
}

View File

@ -1,7 +1,9 @@
include(../common.pri)
contains(CONFIG,dialogdesigner){
include($$REPORT_PATH/dialogdesigner/dialogdesigner.pri)
contains(CONFIG, embedded_designer){
contains(CONFIG,dialogdesigner){
include($$REPORT_PATH/dialogdesigner/dialogdesigner.pri)
}
}
DEFINES += INSPECT_BASEDESIGN
@ -11,9 +13,11 @@ INCLUDEPATH += \
$$REPORT_PATH/items \
$$REPORT_PATH/bands \
$$REPORT_PATH/base \
$$REPORT_PATH/objectinspector \
$$REPORT_PATH/databrowser \
$$REPORT_PATH/scripteditor
contains(CONFIG, embedded_designer){
INCLUDEPATH += $$REPORT_PATH/objectinspector \
$$REPORT_PATH/databrowser
}
SOURCES += \
$$REPORT_PATH/bands/lrpageheader.cpp \
@ -24,15 +28,56 @@ SOURCES += \
$$REPORT_PATH/bands/lrgroupbands.cpp \
$$REPORT_PATH/bands/lrsubdetailband.cpp \
$$REPORT_PATH/bands/lrtearoffband.cpp \
$$REPORT_PATH/serializators/lrxmlqrectserializator.cpp \
$$REPORT_PATH/serializators/lrxmlbasetypesserializators.cpp \
$$REPORT_PATH/serializators/lrxmlreader.cpp \
$$REPORT_PATH/serializators/lrxmlwriter.cpp \
$$REPORT_PATH/scripteditor/lrscripteditor.cpp \
$$REPORT_PATH/scripteditor/lrcodeeditor.cpp \
$$REPORT_PATH/scripteditor/lrscripthighlighter.cpp \
$$REPORT_PATH/items/lrhorizontallayout.cpp \
$$REPORT_PATH/items/editors/lritemeditorwidget.cpp \
$$REPORT_PATH/items/editors/lrfonteditorwidget.cpp \
$$REPORT_PATH/items/editors/lrtextalignmenteditorwidget.cpp \
$$REPORT_PATH/items/editors/lritemsborderseditorwidget.cpp \
$$REPORT_PATH/items/lrsimpletagparser.cpp \
$$REPORT_PATH/items/lrimageitem.cpp \
$$REPORT_PATH/items/lrtextitemeditor.cpp \
$$REPORT_PATH/items/lrshapeitem.cpp \
$$REPORT_PATH/items/lrtextitem.cpp \
$$REPORT_PATH/lrbanddesignintf.cpp \
$$REPORT_PATH/lrpageitemdesignintf.cpp \
$$REPORT_PATH/lrpagedesignintf.cpp \
$$REPORT_PATH/lrbandsmanager.cpp \
$$REPORT_PATH/lrglobal.cpp \
$$REPORT_PATH/lritemdesignintf.cpp \
$$REPORT_PATH/lrdatadesignintf.cpp \
$$REPORT_PATH/lrbasedesignintf.cpp \
$$REPORT_PATH/lrreportengine.cpp \
$$REPORT_PATH/lrdatasourcemanager.cpp \
$$REPORT_PATH/lrreportrender.cpp \
$$REPORT_PATH/lrscriptenginemanager.cpp \
$$REPORT_PATH/lrpreviewreportwindow.cpp \
$$REPORT_PATH/lrpreviewreportwidget.cpp \
$$REPORT_PATH/lrgraphicsviewzoom.cpp \
$$REPORT_PATH/lrvariablesholder.cpp \
$$REPORT_PATH/lrgroupfunctions.cpp \
$$REPORT_PATH/lrsimplecrypt.cpp \
$$REPORT_PATH/lraboutdialog.cpp \
$$REPORT_PATH/lrsettingdialog.cpp \
$$REPORT_PATH/lritemscontainerdesignitf.cpp \
$$REPORT_PATH/lrcolorindicator.cpp \
$$REPORT_PATH/items/lrchartitem.cpp \
$$REPORT_PATH/items/lrchartitemeditor.cpp \
$$REPORT_PATH/lrreporttranslation.cpp
contains(CONFIG, embedded_designer){
SOURCES += \
$$REPORT_PATH/databrowser/lrdatabrowser.cpp \
$$REPORT_PATH/databrowser/lrsqleditdialog.cpp \
$$REPORT_PATH/databrowser/lrconnectiondialog.cpp \
$$REPORT_PATH/databrowser/lrvariabledialog.cpp \
$$REPORT_PATH/databrowser/lrdatabrowsertree.cpp \
$$REPORT_PATH/serializators/lrxmlqrectserializator.cpp \
$$REPORT_PATH/serializators/lrxmlbasetypesserializators.cpp \
$$REPORT_PATH/serializators/lrxmlreader.cpp \
$$REPORT_PATH/serializators/lrxmlwriter.cpp \
$$REPORT_PATH/objectinspector/propertyItems/lrstringpropitem.cpp \
$$REPORT_PATH/objectinspector/propertyItems/lrrectproptem.cpp \
$$REPORT_PATH/objectinspector/propertyItems/lrintpropitem.cpp \
@ -58,54 +103,17 @@ SOURCES += \
$$REPORT_PATH/objectinspector/lrobjectitemmodel.cpp \
$$REPORT_PATH/objectinspector/lrobjectpropitem.cpp \
$$REPORT_PATH/objectinspector/lrpropertydelegate.cpp \
$$REPORT_PATH/objectsbrowser/lrobjectbrowser.cpp \
$$REPORT_PATH/objectsbrowser/lrobjectbrowser.cpp \
$$REPORT_PATH/scriptbrowser/lrscriptbrowser.cpp \
$$REPORT_PATH/scripteditor/lrscripteditor.cpp \
$$REPORT_PATH/scripteditor/lrcodeeditor.cpp \
$$REPORT_PATH/scripteditor/lrscripthighlighter.cpp \
$$REPORT_PATH/items/lrsubitemparentpropitem.cpp \
$$REPORT_PATH/items/lralignpropitem.cpp \
$$REPORT_PATH/items/lrhorizontallayout.cpp \
$$REPORT_PATH/items/editors/lritemeditorwidget.cpp \
$$REPORT_PATH/items/editors/lrfonteditorwidget.cpp \
$$REPORT_PATH/items/editors/lrtextalignmenteditorwidget.cpp \
$$REPORT_PATH/items/editors/lritemsaligneditorwidget.cpp \
$$REPORT_PATH/items/editors/lritemsborderseditorwidget.cpp \
$$REPORT_PATH/items/lrsimpletagparser.cpp \
$$REPORT_PATH/items/lrimageitem.cpp \
$$REPORT_PATH/items/lrtextitemeditor.cpp \
$$REPORT_PATH/items/lrshapeitem.cpp \
$$REPORT_PATH/items/lrtextitem.cpp \
$$REPORT_PATH/translationeditor/translationeditor.cpp \
$$REPORT_PATH/lrbanddesignintf.cpp \
$$REPORT_PATH/lrpageitemdesignintf.cpp \
$$REPORT_PATH/lrpagedesignintf.cpp \
$$REPORT_PATH/lrbandsmanager.cpp \
$$REPORT_PATH/lrglobal.cpp \
$$REPORT_PATH/lritemdesignintf.cpp \
$$REPORT_PATH/lrdatadesignintf.cpp \
$$REPORT_PATH/translationeditor/languageselectdialog.cpp \
$$REPORT_PATH/lrreportdesignwidget.cpp \
$$REPORT_PATH/lrbasedesignintf.cpp \
$$REPORT_PATH/lrreportengine.cpp \
$$REPORT_PATH/lrdatasourcemanager.cpp \
$$REPORT_PATH/lrreportdesignwindow.cpp \
$$REPORT_PATH/lrreportrender.cpp \
$$REPORT_PATH/lrscriptenginemanager.cpp \
$$REPORT_PATH/lrpreviewreportwindow.cpp \
$$REPORT_PATH/lrpreviewreportwidget.cpp \
$$REPORT_PATH/lrgraphicsviewzoom.cpp \
$$REPORT_PATH/lrvariablesholder.cpp \
$$REPORT_PATH/lrgroupfunctions.cpp \
$$REPORT_PATH/lrsimplecrypt.cpp \
$$REPORT_PATH/lraboutdialog.cpp \
$$REPORT_PATH/lrsettingdialog.cpp \
$$REPORT_PATH/lritemscontainerdesignitf.cpp \
$$REPORT_PATH/lrcolorindicator.cpp \
$$REPORT_PATH/items/lrchartitem.cpp \
$$REPORT_PATH/items/lrchartitemeditor.cpp \
$$REPORT_PATH/lrreporttranslation.cpp \
$$REPORT_PATH/translationeditor/languageselectdialog.cpp
$$REPORT_PATH/lrreportdesignwindow.cpp
}
contains(CONFIG, staticlib){
SOURCES += $$REPORT_PATH/lrfactoryinitializer.cpp
}
@ -126,11 +134,6 @@ HEADERS += \
$$REPORT_PATH/bands/lrtearoffband.h \
$$REPORT_PATH/bands/lrsubdetailband.h \
$$REPORT_PATH/bands/lrgroupbands.h \
$$REPORT_PATH/databrowser/lrdatabrowser.h \
$$REPORT_PATH/databrowser/lrsqleditdialog.h \
$$REPORT_PATH/databrowser/lrconnectiondialog.h \
$$REPORT_PATH/databrowser/lrvariabledialog.h \
$$REPORT_PATH/databrowser/lrdatabrowsertree.h \
$$REPORT_PATH/serializators/lrserializatorintf.h \
$$REPORT_PATH/serializators/lrstorageintf.h \
$$REPORT_PATH/serializators/lrxmlqrectserializator.h \
@ -138,6 +141,62 @@ HEADERS += \
$$REPORT_PATH/serializators/lrxmlbasetypesserializators.h \
$$REPORT_PATH/serializators/lrxmlreader.h \
$$REPORT_PATH/serializators/lrxmlwriter.h \
$$REPORT_PATH/scripteditor/lrscripteditor.h \
$$REPORT_PATH/scripteditor/lrcodeeditor.h \
$$REPORT_PATH/scripteditor/lrscripthighlighter.h \
$$REPORT_PATH/items/editors/lritemeditorwidget.h \
$$REPORT_PATH/items/editors/lrfonteditorwidget.h \
$$REPORT_PATH/items/lrtextitem.h \
$$REPORT_PATH/items/lrhorizontallayout.h \
$$REPORT_PATH/items/lrtextitemeditor.h \
$$REPORT_PATH/items/lrshapeitem.h \
$$REPORT_PATH/items/lrimageitem.h \
$$REPORT_PATH/items/lrsimpletagparser.h \
$$REPORT_PATH/lrbanddesignintf.h \
$$REPORT_PATH/lrpageitemdesignintf.h \
$$REPORT_PATH/lrbandsmanager.h \
$$REPORT_PATH/lrglobal.h \
$$REPORT_PATH/lrdatadesignintf.h \
$$REPORT_PATH/lrcollection.h \
$$REPORT_PATH/lrpagedesignintf.h \
$$REPORT_PATH/lrreportengine_p.h \
$$REPORT_PATH/lrdatasourcemanager.h \
$$REPORT_PATH/lrreportrender.h \
$$REPORT_PATH/lrpreviewreportwindow.h \
$$REPORT_PATH/lrpreviewreportwidget.h \
$$REPORT_PATH/lrpreviewreportwidget_p.h \
$$REPORT_PATH/lrgraphicsviewzoom.h \
$$REPORT_PATH/lrbasedesignintf.h \
$$REPORT_PATH/lritemdesignintf.h \
$$REPORT_PATH/lrdesignelementsfactory.h \
$$REPORT_PATH/lrscriptenginemanager.h \
$$REPORT_PATH/lrvariablesholder.h \
$$REPORT_PATH/lrgroupfunctions.h \
$$REPORT_PATH/lrreportengine.h \
$$REPORT_PATH/lrdatasourcemanagerintf.h \
$$REPORT_PATH/lrscriptenginemanagerintf.h \
$$REPORT_PATH/lrsimplecrypt.h \
$$REPORT_PATH/lraboutdialog.h \
$$REPORT_PATH/lrcallbackdatasourceintf.h \
$$REPORT_PATH/lrsettingdialog.h \
$$REPORT_PATH/lrpreviewreportwidget_p.h \
$$REPORT_PATH/lritemscontainerdesignitf.h \
$$REPORT_PATH/lrcolorindicator.h \
$$REPORT_PATH/items/lrchartitem.h \
$$REPORT_PATH/items/lrchartitemeditor.h \
$$REPORT_PATH/items/editors/lrtextalignmenteditorwidget.h \
$$REPORT_PATH/items/editors/lritemsborderseditorwidget.h \
$$REPORT_PATH/lrreporttranslation.h \
$$REPORT_PATH/lrreportdesignwindowintrerface.h
contains(CONFIG, embedded_designer){
HEADERS += \
$$REPORT_PATH/databrowser/lrdatabrowser.h \
$$REPORT_PATH/databrowser/lrsqleditdialog.h \
$$REPORT_PATH/databrowser/lrconnectiondialog.h \
$$REPORT_PATH/databrowser/lrvariabledialog.h \
$$REPORT_PATH/databrowser/lrdatabrowsertree.h \
$$REPORT_PATH/scriptbrowser/lrscriptbrowser.h \
$$REPORT_PATH/objectinspector/propertyItems/lrstringpropitem.h \
$$REPORT_PATH/objectinspector/propertyItems/lrrectproptem.h \
$$REPORT_PATH/objectinspector/propertyItems/lrdatasourcepropitem.h \
@ -164,62 +223,15 @@ HEADERS += \
$$REPORT_PATH/objectinspector/lrobjectpropitem.h \
$$REPORT_PATH/objectinspector/lrpropertydelegate.h \
$$REPORT_PATH/objectsbrowser/lrobjectbrowser.h \
$$REPORT_PATH/scriptbrowser/lrscriptbrowser.h \
$$REPORT_PATH/scripteditor/lrscripteditor.h \
$$REPORT_PATH/scripteditor/lrcodeeditor.h \
$$REPORT_PATH/scripteditor/lrscripthighlighter.h \
$$REPORT_PATH/items/editors/lritemeditorwidget.h \
$$REPORT_PATH/items/editors/lrfonteditorwidget.h \
$$REPORT_PATH/items/editors/lrtextalignmenteditorwidget.h \
$$REPORT_PATH/translationeditor/translationeditor.h \
$$REPORT_PATH/translationeditor/languageselectdialog.h \
$$REPORT_PATH/items/editors/lritemsaligneditorwidget.h \
$$REPORT_PATH/items/editors/lritemsborderseditorwidget.h \
$$REPORT_PATH/items/lrtextitem.h \
$$REPORT_PATH/items/lrsubitemparentpropitem.h \
$$REPORT_PATH/items/lralignpropitem.h \
$$REPORT_PATH/items/lrhorizontallayout.h \
$$REPORT_PATH/items/lrtextitemeditor.h \
$$REPORT_PATH/items/lrshapeitem.h \
$$REPORT_PATH/items/lrimageitem.h \
$$REPORT_PATH/items/lrsimpletagparser.h \
$$REPORT_PATH/translationeditor/translationeditor.h \
$$REPORT_PATH/lrfactoryinitializer.h \
$$REPORT_PATH/lrbanddesignintf.h \
$$REPORT_PATH/lrpageitemdesignintf.h \
$$REPORT_PATH/lrbandsmanager.h \
$$REPORT_PATH/lrglobal.h \
$$REPORT_PATH/lrdatadesignintf.h \
$$REPORT_PATH/lrcollection.h \
$$REPORT_PATH/lrpagedesignintf.h \
$$REPORT_PATH/lrreportdesignwidget.h \
$$REPORT_PATH/lrreportengine_p.h \
$$REPORT_PATH/lrdatasourcemanager.h \
$$REPORT_PATH/lrreportdesignwindow.h \
$$REPORT_PATH/lrreportrender.h \
$$REPORT_PATH/lrpreviewreportwindow.h \
$$REPORT_PATH/lrpreviewreportwidget.h \
$$REPORT_PATH/lrpreviewreportwidget_p.h \
$$REPORT_PATH/lrgraphicsviewzoom.h \
$$REPORT_PATH/lrbasedesignintf.h \
$$REPORT_PATH/lritemdesignintf.h \
$$REPORT_PATH/lrdesignelementsfactory.h \
$$REPORT_PATH/lrscriptenginemanager.h \
$$REPORT_PATH/lrvariablesholder.h \
$$REPORT_PATH/lrgroupfunctions.h \
$$REPORT_PATH/lrreportengine.h \
$$REPORT_PATH/lrdatasourcemanagerintf.h \
$$REPORT_PATH/lrscriptenginemanagerintf.h \
$$REPORT_PATH/lrsimplecrypt.h \
$$REPORT_PATH/lraboutdialog.h \
$$REPORT_PATH/lrcallbackdatasourceintf.h \
$$REPORT_PATH/lrsettingdialog.h \
$$REPORT_PATH/lrpreviewreportwidget_p.h \
$$REPORT_PATH/lritemscontainerdesignitf.h \
$$REPORT_PATH/lrcolorindicator.h \
$$REPORT_PATH/items/lrchartitem.h \
$$REPORT_PATH/items/lrchartitemeditor.h \
$$REPORT_PATH/lrreporttranslation.h \
$$REPORT_PATH/translationeditor/languageselectdialog.h
$$REPORT_PATH/lrreportdesignwindow.h
}
contains(CONFIG, staticlib){
HEADERS += $$REPORT_PATH/lrfactoryinitializer.h
}
@ -229,26 +241,32 @@ contains(CONFIG,zint){
}
FORMS += \
$$REPORT_PATH/databrowser/lrsqleditdialog.ui \
$$REPORT_PATH/databrowser/lrconnectiondialog.ui \
$$REPORT_PATH/databrowser/lrdatabrowser.ui \
$$REPORT_PATH/databrowser/lrvariabledialog.ui \
$$REPORT_PATH/objectinspector/editors/ltextitempropertyeditor.ui \
$$REPORT_PATH/lrpreviewreportwindow.ui \
$$REPORT_PATH/lrpreviewreportwidget.ui \
$$REPORT_PATH/items/lrtextitemeditor.ui \
$$REPORT_PATH/lraboutdialog.ui \
$$REPORT_PATH/lrsettingdialog.ui \
$$REPORT_PATH/scriptbrowser/lrscriptbrowser.ui \
$$REPORT_PATH/items/lrchartitemeditor.ui \
$$REPORT_PATH/translationeditor/translationeditor.ui \
$$REPORT_PATH/translationeditor/languageselectdialog.ui \
$$REPORT_PATH/scripteditor/lrscripteditor.ui
contains(CONFIG, embedded_designer){
FORMS += \
$$REPORT_PATH/databrowser/lrsqleditdialog.ui \
$$REPORT_PATH/databrowser/lrconnectiondialog.ui \
$$REPORT_PATH/databrowser/lrdatabrowser.ui \
$$REPORT_PATH/databrowser/lrvariabledialog.ui \
$$REPORT_PATH/objectinspector/editors/ltextitempropertyeditor.ui \
$$REPORT_PATH/scriptbrowser/lrscriptbrowser.ui \
$$REPORT_PATH/translationeditor/translationeditor.ui \
$$REPORT_PATH/translationeditor/languageselectdialog.ui
}
RESOURCES += \
$$REPORT_PATH/report.qrc \
$$REPORT_PATH/items/items.qrc
contains(CONFIG, embedded_designer){
RESOURCES += \
$$REPORT_PATH/objectinspector/lobjectinspector.qrc \
$$REPORT_PATH/databrowser/lrdatabrowser.qrc \
$$REPORT_PATH/report.qrc \
$$REPORT_PATH/items/items.qrc \
$$REPORT_PATH/scriptbrowser/lrscriptbrowser.qrc \
$$REPORT_PATH/translationeditor/translationeditor.qrc
}

View File

@ -28,7 +28,7 @@ DEFINES += LIMEREPORT_EXPORTS
contains(CONFIG, staticlib){
DEFINES += HAVE_STATIC_BUILD
message(STATIC_BUILD)
message(Static Build)
DEFINES -= LIMEREPORT_EXPORTS
}
@ -39,7 +39,8 @@ EXTRA_FILES += \
$$PWD/lrreportengine.h \
$$PWD/lrscriptenginemanagerintf.h \
$$PWD/lrcallbackdatasourceintf.h \
$$PWD/lrpreviewreportwidget.h
$$PWD/lrpreviewreportwidget.h \
$$PWD/lrreportdesignwindowintrerface.h
include(limereport.pri)

View File

@ -365,11 +365,9 @@ void BaseDesignIntf::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
if (event->button() == Qt::LeftButton) {
m_resizeDirectionFlags = resizeDirectionFlags(event->pos());
//m_startScenePos = event->scenePos();
m_startPos = pos();
m_oldGeometry = geometry();
QGraphicsItem::mousePressEvent(event);
//QApplication::processEvents();
emit(itemSelected(this));
}
else QGraphicsItem::mousePressEvent(event);
@ -1141,8 +1139,16 @@ void BaseDesignIntf::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
}
}
QWidget* findRootWidget(QWidget* widget){
while (widget->parentWidget()) {
widget = widget->parentWidget();
}
return widget;
}
void BaseDesignIntf::showEditorDialog(){
QWidget *editor = defaultEditor();
QWidget *editor = defaultEditor();
editor->setStyleSheet(findRootWidget(scene()->views().at(0))->styleSheet());
if (editor) {
#ifdef Q_OS_WIN

View File

@ -1503,7 +1503,7 @@ VariableDataType DataSourceManager::variableDataType(const QString& name)
{
if (m_reportVariables.containsVariable(name))
return m_reportVariables.variableByName(name)->dataType();
return VariableDataType::Undefined;
return Enums::Undefined;
}
void DataSourceManager::setVariableDataType(const QString& name, VariableDataType value)

View File

@ -31,7 +31,7 @@
#define LRDESIGNELEMENTSFACTORY_H
#include "lrbanddesignintf.h"
#include "lrpageheader.h"
//#include "lrpageheader.h"
#include "lrattribsabstractfactory.h"
#include "lrsimpleabstractfactory.h"
#include "lrsingleton.h"

View File

@ -0,0 +1,28 @@
#ifndef LRDESIGNERPLUGININTERFACE_H
#define LRDESIGNERPLUGININTERFACE_H
#include <QString>
#include <QVariant>
#include <QtPlugin>
#include "lrreportdesignwindowintrerface.h"
QT_BEGIN_NAMESPACE
class QSettings;
class QMainWindow;
QT_END_NAMESPACE
namespace LimeReport {
class ReportDesignWindow;
class ReportEnginePrivateInterface;
}
class LimeReportPluginInterface {
public:
virtual ~LimeReportPluginInterface() { }
virtual LimeReport::ReportDesignWindowInterface* getDesignerWindow(LimeReport::ReportEnginePrivateInterface* report, QWidget *parent = 0, QSettings* settings=0) = 0;
};
Q_DECLARE_INTERFACE( LimeReportPluginInterface, "ru.limereport.LimeReport.DesignerPluginInterface/1.0" )
#endif // LRDESIGNERPLUGININTERFACE_H

View File

@ -15,9 +15,10 @@
#include "items/lrhorizontallayout.h"
#include "items/lrimageitem.h"
#include "items/lrshapeitem.h"
#include "items/lrchartitem.h"
#include "lrdesignelementsfactory.h"
#ifdef HAVE_REPORT_DESIGNER
#include "objectinspector/lrobjectpropitem.h"
#include "objectinspector/propertyItems/lrboolpropitem.h"
#include "objectinspector/propertyItems/lrcolorpropitem.h"
@ -34,6 +35,7 @@
#include "objectinspector/propertyItems/lrstringpropitem.h"
#include "items/lralignpropitem.h"
#include "items/lrsubitemparentpropitem.h"
#endif
#include "serializators/lrxmlbasetypesserializators.h"
#include "serializators/lrxmlqrectserializator.h"
@ -41,10 +43,13 @@
void initResources(){
Q_INIT_RESOURCE(report);
#ifdef HAVE_REPORT_DESIGNER
Q_INIT_RESOURCE(lobjectinspector);
Q_INIT_RESOURCE(lrdatabrowser);
Q_INIT_RESOURCE(items);
Q_INIT_RESOURCE(lrscriptbrowser);
Q_INIT_RESOURCE(translationeditor);
#endif
}
namespace LimeReport{
@ -106,14 +111,18 @@ BaseDesignIntf* createHLayout(QObject *owner, LimeReport::BaseDesignIntf *paren
return new HorizontalLayout(owner, parent);
}
BaseDesignIntf * createImageItem(QObject* owner, LimeReport::BaseDesignIntf* parent){
BaseDesignIntf* createImageItem(QObject* owner, LimeReport::BaseDesignIntf* parent){
return new ImageItem(owner,parent);
}
BaseDesignIntf * createShapeItem(QObject* owner, LimeReport::BaseDesignIntf* parent){
BaseDesignIntf* createShapeItem(QObject* owner, LimeReport::BaseDesignIntf* parent){
return new ShapeItem(owner,parent);
}
BaseDesignIntf* createChartItem(QObject* owner, LimeReport::BaseDesignIntf* parent){
return new ChartItem(owner,parent);
}
void initReportItems(){
initResources();
DesignElementsFactory::instance().registerCreator(
@ -139,6 +148,9 @@ void initReportItems(){
DesignElementsFactory::instance().registerCreator(
"ShapeItem", LimeReport::ItemAttribs(QObject::tr("Shape Item"),"Item"), createShapeItem
);
DesignElementsFactory::instance().registerCreator(
"ChartItem", LimeReport::ItemAttribs(QObject::tr("Chart Item"),"Item"), createChartItem
);
DesignElementsFactory::instance().registerCreator(
"Data",
LimeReport::ItemAttribs(QObject::tr("Data"),LimeReport::Const::bandTAG),
@ -198,6 +210,8 @@ void initReportItems(){
}
#ifdef HAVE_REPORT_DESIGNER
ObjectPropItem * createBoolPropItem(
QObject *object, LimeReport::ObjectPropItem::ObjectsList* objects, const QString& name, const QString& displayName, const QVariant& data, LimeReport::ObjectPropItem* parent, bool readonly)
{
@ -360,7 +374,7 @@ void initObjectInspectorProperties()
);
}
#endif
SerializatorIntf * createIntSerializator(QDomDocument *doc, QDomElement *node){
return new LimeReport::XmlIntSerializator(doc,node);
}

View File

@ -161,6 +161,7 @@ namespace Const{
Enums(){}
Q_GADGET
};
typedef Enums::VariableDataType VariableDataType;
} // namespace LimeReport

View File

@ -66,10 +66,10 @@ PreviewReportWindow::PreviewReportWindow(ReportEngine *report, QWidget *parent,
connect(m_previewReportWidget->d_ptr->m_previewPage,SIGNAL(selectionChanged()),this,SLOT(slotSelectionChanged()));
connect(m_pagesNavigator,SIGNAL(valueChanged(int)),this,SLOT(slotPageNavigatorChanged(int)));
m_fontEditor = new FontEditorWidget(m_previewReportWidget->d_ptr->m_previewPage,tr("Font"),this);
m_fontEditor = new FontEditorWidgetForPage(m_previewReportWidget->d_ptr->m_previewPage,tr("Font"),this);
m_fontEditor->setObjectName("fontTools");
m_fontEditor->setIconSize(ui->toolBar->iconSize());
m_textAlignmentEditor = new TextAlignmentEditorWidget(m_previewReportWidget->d_ptr->m_previewPage,tr("Text align"),this);
m_textAlignmentEditor = new TextAlignmentEditorWidgetForPage(m_previewReportWidget->d_ptr->m_previewPage,tr("Text align"),this);
m_textAlignmentEditor->setObjectName("textAlignmentTools");
m_textAlignmentEditor->setIconSize(ui->toolBar->iconSize());
addToolBar(Qt::TopToolBarArea,m_fontEditor);
@ -183,7 +183,7 @@ QSettings*PreviewReportWindow::settings()
if (m_settings){
return m_settings;
} else {
m_settings = new QSettings("LimeReport",QApplication::applicationName());
m_settings = new QSettings("LimeReport",QCoreApplication::applicationName());
m_ownedSettings = true;
return m_settings;
}

View File

@ -51,12 +51,12 @@ namespace LimeReport {
// ReportDesignIntf
ReportDesignWidget::ReportDesignWidget(ReportEngine *report, QMainWindow *mainWindow, QWidget *parent) :
ReportDesignWidget::ReportDesignWidget(ReportEnginePrivateInterface* report, QMainWindow *mainWindow, QWidget *parent) :
QWidget(parent),
#ifdef HAVE_QTDESIGNER_INTEGRATION
m_dialogDesignerManager(new DialogDesignerManager(this)),
#endif
m_mainWindow(mainWindow), m_verticalGridStep(10), m_horizontalGridStep(10), m_useGrid(false), m_dialogChanged(false)
m_mainWindow(mainWindow), m_verticalGridStep(10), m_horizontalGridStep(10), m_useGrid(false), m_dialogChanged(false), m_useDarkTheme(false)
{
#ifdef HAVE_QT4
m_tabWidget = new LimeReportTabWidget(this);
@ -72,20 +72,20 @@ ReportDesignWidget::ReportDesignWidget(ReportEngine *report, QMainWindow *mainWi
mainLayout->addWidget(m_tabWidget);
setLayout(mainLayout);
if (!report) {
m_report=new ReportEnginePrivate(this);
m_report->setObjectName("report");
m_report->appendPage("page1");
}
else {
m_report=report->d_ptr;
// if (!report) {
// m_report=new ReportEnginePrivate(this);
// m_report->setObjectName("report");
// m_report->appendPage("page1");
// }
// else {
m_report=report;//report->d_ptr;
if (!m_report->pageCount()) m_report->appendPage("page1");
}
// }
createTabs();
connect(m_report,SIGNAL(pagesLoadFinished()),this,SLOT(slotPagesLoadFinished()));
connect(m_report,SIGNAL(cleared()),this,SIGNAL(cleared()));
connect(dynamic_cast<QObject*>(m_report), SIGNAL(pagesLoadFinished()),this,SLOT(slotPagesLoadFinished()));
connect(dynamic_cast<QObject*>(m_report), SIGNAL(cleared()),this,SIGNAL(cleared()));
connect(m_tabWidget, SIGNAL(currentChanged(int)), this, SLOT(slotCurrentTabChanged(int)));
#ifdef HAVE_UI_LOADER
connect(m_report->scriptContext(), SIGNAL(dialogDeleted(QString)), this, SLOT(slotDialogDeleted(QString)));
@ -189,6 +189,7 @@ void ReportDesignWidget::saveState(QSettings* settings)
settings->setValue("vGridStep",m_verticalGridStep);
settings->setValue("defaultFont",m_defaultFont);
settings->setValue("useGrid",m_useGrid);
settings->setValue("useDarkTheme",m_useDarkTheme);
settings->setValue("ScriptEditorState", m_scriptEditor->saveState());
settings->endGroup();
}
@ -199,6 +200,13 @@ void ReportDesignWidget::applySettings()
m_report->pageAt(i)->pageItem()->setFont(m_defaultFont);
}
applyUseGrid();
if (m_useDarkTheme) {
QFile theme(":/qdarkstyle/style.qss");
theme.open(QIODevice::ReadOnly);
QString styleSheet = theme.readAll();
parentWidget()->setStyleSheet(styleSheet);
m_report->setStyleSheet(styleSheet);
} else parentWidget()->setStyleSheet("");
}
void ReportDesignWidget::loadState(QSettings* settings)
@ -223,6 +231,11 @@ void ReportDesignWidget::loadState(QSettings* settings)
m_useGrid = v.toBool();
}
v = settings->value("useDarkTheme");
if (v.isValid()){
m_useDarkTheme = v.toBool();
}
v = settings->value("ScriptEditorState");
if (v.isValid()){
m_scriptEditor->restoreState(v.toByteArray());
@ -241,9 +254,11 @@ void ReportDesignWidget::createTabs(){
view->setFrameShape(QFrame::NoFrame);
view->setScene(m_report->pageAt(i));
foreach(QGraphicsItem* item, m_report->pageAt(i)->selectedItems()){
item->setSelected(false);
}
// foreach(QGraphicsItem* item, m_report->pageAt(i)->selectedItems()){
// item->setSelected(false);
// }
m_report->pageAt(i)->clearSelection();
view->centerOn(0,0);
view->scale(0.5,0.5);
@ -363,12 +378,10 @@ void ReportDesignWidget::startEditMode()
PageDesignIntf * ReportDesignWidget::activePage()
{
if (activeView())
return qobject_cast<PageDesignIntf*>(activeView()->scene());
return dynamic_cast<PageDesignIntf*>(activeView()->scene());
return 0;
}
QList<QGraphicsItem *> ReportDesignWidget::selectedItems(){
return activePage()->selectedItems();
}
@ -695,11 +708,13 @@ void ReportDesignWidget::editSetting()
setting.setHorizontalGridStep(m_horizontalGridStep);
setting.setDefaultFont(m_defaultFont);
setting.setSuppressAbsentFieldsAndVarsWarnings(m_report->suppressFieldAndVarError());
setting.setUseDarkTheme(m_useDarkTheme);
if (setting.exec()){
m_horizontalGridStep = setting.horizontalGridStep();
m_verticalGridStep = setting.verticalGridStep();
m_defaultFont = setting.defaultFont();
m_useDarkTheme = setting.userDarkTheme();
m_report->setSuppressFieldAndVarError(setting.suppressAbsentFieldsAndVarsWarnings());
applySettings();
}
@ -796,7 +811,8 @@ void ReportDesignWidget::slotCurrentTabChanged(int index)
QGraphicsView* view = dynamic_cast<QGraphicsView*>(m_tabWidget->widget(index));
if (view) {
if (view->scene()){
foreach (QGraphicsItem* item, view->scene()->selectedItems()) item->setSelected(false);
//foreach (QGraphicsItem* item, view->scene()->selectedItems()) item->setSelected(false);
view->scene()->clearSelection();
}
m_zoomer->setView(view);
}
@ -807,7 +823,7 @@ void ReportDesignWidget::slotCurrentTabChanged(int index)
updateDialogs();
#endif
if (activeTabType() == Translations){
m_traslationEditor->setReportEngine(report());
m_traslationEditor->setReportEngine(dynamic_cast<ITranslationContainer*>(report()));
}
if (activeTabType() == Script){
@ -816,6 +832,8 @@ void ReportDesignWidget::slotCurrentTabChanged(int index)
}
emit activePageChanged();
if (view) view->centerOn(0,0);
}
#ifdef HAVE_QTDESIGNER_INTEGRATION

View File

@ -84,7 +84,7 @@ public:
Translations,
TabTypeCount
};
ReportDesignWidget(ReportEngine* report, QMainWindow *mainWindow, QWidget *parent = 0);
ReportDesignWidget(ReportEnginePrivateInterface* report, QMainWindow *mainWindow, QWidget *parent = 0);
~ReportDesignWidget();
void createStartPage();
void clear();
@ -105,7 +105,7 @@ public:
QList<QGraphicsItem *> selectedItems();
QStringList datasourcesNames();
void scale( qreal sx, qreal sy);
ReportEnginePrivate* report(){return m_report;}
ReportEnginePrivateInterface* report(){return m_report;}
QString reportFileName();
bool isNeedToSave();
bool emitLoadReport();
@ -199,8 +199,9 @@ protected:
#endif
private:
bool eventFilter(QObject *target, QEvent *event);
void prepareReport();
private:
ReportEnginePrivate* m_report;
ReportEnginePrivateInterface* m_report;
QGraphicsView *m_view;
ScriptEditor* m_scriptEditor;
TranslationEditor* m_traslationEditor;
@ -221,7 +222,7 @@ private:
bool m_useGrid;
bool m_useMagnet;
bool m_dialogChanged;
void prepareReport();
bool m_useDarkTheme;
};
} // namespace LimeReport

View File

@ -62,8 +62,8 @@ namespace LimeReport{
ReportDesignWindow* ReportDesignWindow::m_instance=0;
ReportDesignWindow::ReportDesignWindow(ReportEngine *report, QWidget *parent, QSettings* settings) :
QMainWindow(parent), m_textAttibutesIsChanging(false), m_settings(settings), m_ownedSettings(false),
ReportDesignWindow::ReportDesignWindow(ReportEnginePrivateInterface* report, QWidget *parent, QSettings* settings) :
ReportDesignWindowInterface(parent), m_textAttibutesIsChanging(false), m_settings(settings), m_ownedSettings(false),
m_progressDialog(0), m_showProgressDialog(true), m_editorTabType(ReportDesignWidget::Page), m_reportItemIsLocked(false)
{
initReportEditor(report);
@ -309,11 +309,11 @@ void ReportDesignWindow::createToolBars()
//m_mainToolBar->addAction(m_printReportAction);
m_fontEditorBar = new FontEditorWidget(m_reportDesignWidget,tr("Font"),this);
m_fontEditorBar = new FontEditorWidgetForDesigner(m_reportDesignWidget,tr("Font"),this);
m_fontEditorBar->setIconSize(m_mainToolBar->iconSize());
m_fontEditorBar->setObjectName("fontTools");
addToolBar(m_fontEditorBar);
m_textAlignmentEditorBar = new TextAlignmentEditorWidget(m_reportDesignWidget,tr("Text alignment"),this);
m_textAlignmentEditorBar = new TextAlignmentEditorWidgetForDesigner(m_reportDesignWidget,tr("Text alignment"),this);
m_textAlignmentEditorBar->setIconSize(m_mainToolBar->iconSize());
m_textAlignmentEditorBar->setObjectName("textAlignmentTools");
addToolBar(m_textAlignmentEditorBar);
@ -324,7 +324,7 @@ void ReportDesignWindow::createToolBars()
m_itemsAlignmentEditorBar->insertAction(m_itemsAlignmentEditorBar->actions().at(1),m_useMagnetAction);
m_itemsAlignmentEditorBar->insertSeparator(m_itemsAlignmentEditorBar->actions().at(2));
addToolBar(m_itemsAlignmentEditorBar);
m_itemsBordersEditorBar = new ItemsBordersEditorWidget(m_reportDesignWidget,tr("Borders"),this);
m_itemsBordersEditorBar = new ItemsBordersEditorWidgetForDesigner(m_reportDesignWidget,tr("Borders"),this);
m_itemsBordersEditorBar->setIconSize(m_mainToolBar->iconSize());
m_itemsBordersEditorBar->setObjectName("itemsBorderTools");
addToolBar(m_itemsBordersEditorBar);
@ -459,7 +459,7 @@ void ReportDesignWindow::createMainMenu()
m_recentFilesMenu->setDisabled(m_recentFiles.isEmpty());
}
void ReportDesignWindow::initReportEditor(ReportEngine* report)
void ReportDesignWindow::initReportEditor(ReportEnginePrivateInterface* report)
{
m_reportDesignWidget=new ReportDesignWidget(report,this,this);
setCentralWidget(m_reportDesignWidget);
@ -472,16 +472,16 @@ void ReportDesignWindow::initReportEditor(ReportEngine* report)
connect(m_reportDesignWidget,SIGNAL(itemInserted(LimeReport::PageDesignIntf*,QPointF,QString)),
this,SLOT(slotItemInserted(LimeReport::PageDesignIntf*,QPointF,QString)));
connect(m_reportDesignWidget,SIGNAL(itemInsertCanceled(QString)),this,SLOT(slotItemInsertCanceled(QString)));
connect(m_reportDesignWidget->report(),SIGNAL(datasourceCollectionLoadFinished(QString)),this,SLOT(slotUpdateDataBrowser(QString)));
connect(dynamic_cast<QObject*>(report), SIGNAL(datasourceCollectionLoadFinished(QString)),this,SLOT(slotUpdateDataBrowser(QString)));
connect(m_reportDesignWidget,SIGNAL(commandHistoryChanged()),this,SLOT(slotCommandHistoryChanged()));
connect(m_reportDesignWidget,SIGNAL(activePageChanged()),this,SLOT(slotActivePageChanged()));
connect(m_reportDesignWidget, SIGNAL(bandAdded(LimeReport::PageDesignIntf*,LimeReport::BandDesignIntf*)),
this, SLOT(slotBandAdded(LimeReport::PageDesignIntf*,LimeReport::BandDesignIntf*)));
connect(m_reportDesignWidget, SIGNAL(bandDeleted(LimeReport::PageDesignIntf*,LimeReport::BandDesignIntf*)),
this, SLOT(slotBandDeleted(LimeReport::PageDesignIntf*,LimeReport::BandDesignIntf*)));
connect(m_reportDesignWidget->report(), SIGNAL(renderStarted()), this, SLOT(renderStarted()));
connect(m_reportDesignWidget->report(), SIGNAL(renderPageFinished(int)), this, SLOT(renderPageFinished(int)));
connect(m_reportDesignWidget->report(), SIGNAL(renderFinished()), this, SLOT(renderFinished()));
connect(dynamic_cast<QObject*>(report), SIGNAL(renderStarted()), this, SLOT(renderStarted()));
connect(dynamic_cast<QObject*>(report), SIGNAL(renderPageFinished(int)), this, SLOT(renderPageFinished(int)));
connect(dynamic_cast<QObject*>(report), SIGNAL(renderFinished()), this, SLOT(renderFinished()));
connect(m_reportDesignWidget, SIGNAL(pageAdded(PageDesignIntf*)), this, SLOT(slotPageAdded(PageDesignIntf*)));
connect(m_reportDesignWidget, SIGNAL(pageDeleted()), this, SLOT(slotPageDeleted()));
}
@ -1311,7 +1311,7 @@ void ReportDesignWindow::renderStarted()
{
if (m_showProgressDialog){
m_progressDialog = new QProgressDialog(tr("Rendering report"),tr("Abort"),0,0,this);
m_progressDialog->open(m_reportDesignWidget->report(),SLOT(cancelRender()));
m_progressDialog->open(dynamic_cast<QObject*>(m_reportDesignWidget->report()), SLOT(cancelRender()));
QApplication::processEvents();
}
}

View File

@ -43,6 +43,7 @@
#include "items/editors/lritemsaligneditorwidget.h"
#include "items/editors/lritemsborderseditorwidget.h"
#include "lrobjectitemmodel.h"
#include "lrreportdesignwindowintrerface.h"
namespace LimeReport{
@ -55,11 +56,11 @@ class BaseDesignIntf;
class PageDesignIntf;
class ObjectBrowser;
class ReportDesignWindow : public QMainWindow
class ReportDesignWindow : public ReportDesignWindowInterface
{
Q_OBJECT
public:
explicit ReportDesignWindow(ReportEngine *report, QWidget *parent = 0, QSettings* settings=0);
explicit ReportDesignWindow(ReportEnginePrivateInterface *report, QWidget *parent = 0, QSettings* settings=0);
~ReportDesignWindow();
static ReportDesignWindow* instance(){return m_instance;}
@ -140,7 +141,7 @@ private:
void createItemsActions();
void createObjectInspector();
void createObjectsBrowser();
void initReportEditor(ReportEngine *report);
void initReportEditor(ReportEnginePrivateInterface* report);
void createDataWindow();
void createScriptWindow();
#ifdef HAVE_QTDESIGNER_INTEGRATION

View File

@ -0,0 +1,23 @@
#ifndef LRREPORTDESIGNWINDOWINTRERFACE_H
#define LRREPORTDESIGNWINDOWINTRERFACE_H
#include <QMainWindow>
#include <QSettings>
namespace LimeReport {
class ReportDesignWindowInterface: public QMainWindow{
public:
ReportDesignWindowInterface(QWidget* parent = 0): QMainWindow(parent){}
virtual bool checkNeedToSave() = 0;
virtual void showModal() = 0;
virtual void showNonModal() = 0;
virtual void setSettings(QSettings* value) = 0;
virtual QSettings* settings() = 0;
virtual void restoreSetting() = 0;
virtual void setShowProgressDialog(bool value) = 0;
};
} // namespace LimeReport
#endif // LRREPORTDESIGNWINDOWINTRERFACE_H

View File

@ -34,6 +34,7 @@
#include <QApplication>
#include <QDesktopWidget>
#include <QFileSystemWatcher>
#include <QPluginLoader>
#include "time.h"
@ -42,8 +43,11 @@
#include "lrpagedesignintf.h"
#include "lrdatasourcemanager.h"
#ifdef HAVE_REPORT_DESIGNER
#include "lrdatabrowser.h"
#include "lrreportdesignwindow.h"
#endif
#include "serializators/lrxmlwriter.h"
#include "serializators/lrxmlreader.h"
@ -51,6 +55,8 @@
#include "lrpreviewreportwindow.h"
#include "lrpreviewreportwidget.h"
#include "lrpreviewreportwidget_p.h"
#ifdef HAVE_STATIC_BUILD
#include "lrfactoryinitializer.h"
#endif
@ -64,12 +70,14 @@ ReportEnginePrivate::ReportEnginePrivate(QObject *parent) :
m_showProgressDialog(true), m_reportName(""), m_activePreview(0),
m_previewWindowIcon(":/report/images/logo32"), m_previewWindowTitle(tr("Preview")),
m_reportRendering(false), m_resultIsEditable(true), m_passPhrase("HjccbzHjlbyfCkjy"),
m_fileWatcher( new QFileSystemWatcher( this ) ), m_reportLanguage(QLocale::AnyLanguage)
m_fileWatcher( new QFileSystemWatcher( this ) ), m_reportLanguage(QLocale::AnyLanguage), m_designerFactory(0)
{
#ifdef HAVE_STATIC_BUILD
initResources();
initReportItems();
#ifdef HAVE_REPORT_DESIGNER
initObjectInspectorProperties();
#endif
initSerializators();
#endif
m_datasources = new DataSourceManager(this);
@ -83,6 +91,25 @@ ReportEnginePrivate::ReportEnginePrivate(QObject *parent) :
m_datasources->setObjectName("datasources");
connect(m_datasources,SIGNAL(loadCollectionFinished(QString)),this,SLOT(slotDataSourceCollectionLoaded(QString)));
connect(m_fileWatcher,SIGNAL(fileChanged(const QString &)),this,SLOT(slotLoadFromFile(const QString &)));
#ifndef HAVE_REPORT_DESIGNER
QDir pluginsDir = QCoreApplication::applicationDirPath();
pluginsDir.cd("../lib" );
if (!pluginsDir.exists()){
pluginsDir.cd("./lib");
if (!pluginsDir.exists()) pluginsDir.setPath(QCoreApplication::applicationDirPath());
}
foreach( const QString& pluginName, pluginsDir.entryList( QDir::Files ) ) {
QPluginLoader loader( pluginsDir.absoluteFilePath( pluginName ) );
if( loader.load() ) {
if( LimeReportPluginInterface* myPlugin = qobject_cast< LimeReportPluginInterface* >( loader.instance() ) ) {
m_designerFactory = myPlugin;
break;
}
}
}
#endif
}
ReportEnginePrivate::~ReportEnginePrivate()
@ -475,7 +502,7 @@ void ReportEnginePrivate::previewReport(PreviewHints hints)
}
w->setHideResultEditButton(resultIsEditable());
w->setStyleSheet(m_styleSheet);
m_activePreview = w;
connect(w,SIGNAL(destroyed(QObject*)), this, SLOT(slotPreviewWindowDestroyed(QObject*)));
w->exec();
@ -486,6 +513,29 @@ void ReportEnginePrivate::previewReport(PreviewHints hints)
}
}
ReportDesignWindowInterface*ReportEnginePrivate::getDesignerWindow()
{
if (!m_designerWindow) {
if (m_designerFactory){
m_designerWindow = m_designerFactory->getDesignerWindow(this,QApplication::activeWindow(),settings());
m_designerWindow->setAttribute(Qt::WA_DeleteOnClose,true);
m_designerWindow->setWindowIcon(QIcon(":report/images/logo32"));
m_designerWindow->setShowProgressDialog(m_showProgressDialog);
} else {
#ifdef HAVE_REPORT_DESIGNER
m_designerWindow = new LimeReport::ReportDesignWindow(this,QApplication::activeWindow(),settings());
m_designerWindow->setAttribute(Qt::WA_DeleteOnClose,true);
m_designerWindow->setWindowIcon(QIcon(":report/images/logo32"));
m_designerWindow->setShowProgressDialog(m_showProgressDialog);
#endif
}
}
if (m_designerWindow){
m_datasources->updateDatasourceModel();
}
return m_designerWindow;
}
PreviewReportWidget* ReportEnginePrivate::createPreviewWidget(QWidget* parent){
Q_Q(ReportEngine);
@ -618,21 +668,18 @@ PageDesignIntf* ReportEngine::createPreviewScene(QObject* parent){
void ReportEnginePrivate::designReport()
{
if (!m_designerWindow) {
Q_Q(ReportEngine);
m_designerWindow = new LimeReport::ReportDesignWindow(q,QApplication::activeWindow(),settings());
m_designerWindow->setAttribute(Qt::WA_DeleteOnClose,true);
m_designerWindow->setWindowIcon(QIcon(":report/images/logo32"));
m_designerWindow->setShowProgressDialog(m_showProgressDialog);
}
m_datasources->updateDatasourceModel();
ReportDesignWindowInterface* designerWindow = getDesignerWindow();
if (designerWindow){
#ifdef Q_OS_WIN
m_designerWindow->setWindowModality(Qt::ApplicationModal);
designerWindow->setWindowModality(Qt::ApplicationModal);
#endif
if (QApplication::activeWindow()==0){
m_designerWindow->show();;
if (QApplication::activeWindow()==0){
designerWindow->show();;
} else {
designerWindow->showModal();
}
} else {
m_designerWindow->showModal();
qDebug()<<(tr("Designer not found!"));
}
}
@ -885,10 +932,20 @@ void ReportEnginePrivate::activateLanguage(QLocale::Language language)
}
}
QString ReportEnginePrivate::styleSheet() const
{
return m_styleSheet;
}
void ReportEnginePrivate::setStyleSheet(const QString &styleSheet)
{
m_styleSheet = styleSheet;
}
bool ReportEnginePrivate::setReportLanguage(QLocale::Language language){
m_reportLanguage = language;
if (!m_translations.keys().contains(language)) return false;
// activateLanguage(language);
// activateLanguage(language);
return true;
}
@ -1089,6 +1146,12 @@ void ReportEngine::designReport()
d->designReport();
}
ReportDesignWindowInterface*ReportEngine::getDesignerWindow()
{
Q_D(ReportEngine);
return d->getDesignerWindow();
}
PreviewReportWidget* ReportEngine::createPreviewWidget(QWidget *parent)
{
Q_D(ReportEngine);

View File

@ -39,6 +39,7 @@
#include "lrdatasourcemanagerintf.h"
#include "lrscriptenginemanagerintf.h"
#include "lrpreviewreportwidget.h"
#include "lrreportdesignwindowintrerface.h"
class QPrinter;
@ -85,6 +86,7 @@ public:
bool printToPDF(const QString& fileName);
void previewReport(PreviewHints hints = PreviewBarsUserSetting);
void designReport();
ReportDesignWindowInterface* getDesignerWindow();
void setShowProgressDialog(bool value);
IDataSourceManager* dataManager();
IScriptEngineManager* scriptManager();

View File

@ -42,6 +42,8 @@
#include "serializators/lrstorageintf.h"
#include "lrscriptenginemanager.h"
#include "lrreporttranslation.h"
#include "lrdesignerplugininterface.h"
#include "lrreportdesignwindowintrerface.h"
class QFileSystemWatcher;
@ -51,9 +53,41 @@ class PageDesignIntf;
class PrintRange;
class ReportDesignWindow;
//TODO: Add on render callback
class ReportEnginePrivateInterface {
public:
virtual PageDesignIntf* appendPage(const QString& pageName="") = 0;
virtual bool deletePage(PageDesignIntf *page) = 0;
virtual void reorderPages(const QList<PageDesignIntf *> &reorderedPages) = 0;
virtual int pageCount() = 0;
virtual PageDesignIntf* pageAt(int index) = 0;
virtual void clearReport() = 0;
virtual ScriptEngineContext* scriptContext() = 0;
virtual ScriptEngineManager* scriptManager() = 0;
virtual DataSourceManager* dataManager() = 0;
virtual QString reportFileName() = 0;
virtual void setReportFileName(const QString& reportFileName) = 0;
virtual void emitSaveFinished() = 0;
virtual bool isNeedToSave() = 0;
virtual void emitSaveReport() = 0;
virtual bool saveToFile() = 0;
virtual bool saveToFile(const QString& fileName) = 0;
virtual bool isSaved() = 0;
virtual QString reportName() = 0;
virtual bool loadFromFile(const QString& fileName, bool autoLoadPreviewOnChange) = 0;
virtual bool emitLoadReport() = 0;
virtual void clearSelection() = 0;
virtual bool printReport(QPrinter *printer=0) = 0;
virtual void previewReport(PreviewHints hints = PreviewBarsUserSetting) = 0;
virtual void setCurrentReportsDir(const QString& dirName) = 0;
virtual QString currentReportsDir() = 0;
virtual bool suppressFieldAndVarError() const = 0;
virtual void setSuppressFieldAndVarError(bool suppressFieldAndVarError) = 0;
virtual void setStyleSheet(const QString& styleSheet) = 0;
virtual QString styleSheet() const = 0;
};
class ReportEnginePrivate : public QObject, public ICollectionContainer, public ITranslationContainer
class ReportEnginePrivate : public QObject, public ICollectionContainer, public ITranslationContainer,
public ReportEnginePrivateInterface
{
Q_OBJECT
Q_DECLARE_PUBLIC(ReportEngine)
@ -94,6 +128,8 @@ public:
void printToFile(const QString& fileName);
bool printToPDF(const QString& fileName);
void previewReport(PreviewHints hints = PreviewBarsUserSetting);
ReportDesignWindowInterface* getDesignerWindow();
void designReport();
void setSettings(QSettings* value);
void setShowProgressDialog(bool value){m_showProgressDialog = value;}
@ -142,6 +178,9 @@ public:
void clearSelection();
Qt::LayoutDirection previewLayoutDirection();
void setPreviewLayoutDirection(const Qt::LayoutDirection& previewLayoutDirection);
QString styleSheet() const;
void setStyleSheet(const QString &styleSheet);
signals:
void pagesLoadFinished();
void datasourceCollectionLoadFinished(const QString& collectionName);
@ -195,7 +234,7 @@ private:
QMainWindow* m_activePreview;
QIcon m_previewWindowIcon;
QString m_previewWindowTitle;
QPointer<ReportDesignWindow> m_designerWindow;
QPointer<ReportDesignWindowInterface> m_designerWindow;
ReportSettings m_reportSettings;
bool m_reportRendering;
bool m_resultIsEditable;
@ -205,6 +244,8 @@ private:
QLocale::Language m_reportLanguage;
void activateLanguage(QLocale::Language language);
Qt::LayoutDirection m_previewLayoutDirection;
LimeReportPluginInterface* m_designerFactory;
QString m_styleSheet;
};
}

View File

@ -29,7 +29,6 @@
****************************************************************************/
#include <stdexcept>
#include <QMessageBox>
#include <QApplication>
#include "lrglobal.h"
#include "lrreportrender.h"
@ -411,7 +410,7 @@ void ReportRender::replaceGroupsFunction(BandDesignIntf *band)
BandDesignIntf* ReportRender::renderBand(BandDesignIntf *patternBand, BandDesignIntf* bandData, ReportRender::DataRenderMode mode, bool isLast)
{
QApplication::processEvents();
QCoreApplication::processEvents();
if (patternBand){
BandDesignIntf* bandClone = 0;

View File

@ -1,5 +1,6 @@
#include "lrsettingdialog.h"
#include "ui_lrsettingdialog.h"
#include <QFile>
namespace LimeReport{
@ -8,6 +9,10 @@ SettingDialog::SettingDialog(QWidget *parent) :
ui(new Ui::SettingDialog)
{
ui->setupUi(this);
QFile theme(":/qdarkstyle/style.qss");
if (!theme.exists()){
ui->cbbUseDarkTheme->setVisible(false);
}
}
SettingDialog::~SettingDialog()
@ -32,6 +37,11 @@ QFont SettingDialog::defaultFont()
return result;
}
bool SettingDialog::userDarkTheme()
{
return ui->cbbUseDarkTheme->isChecked();
}
bool SettingDialog::suppressAbsentFieldsAndVarsWarnings()
{
return ui->cbSuppressWarnings->isChecked();
@ -57,4 +67,9 @@ void SettingDialog::setDefaultFont(const QFont &value)
ui->defaultFontSize->setValue(value.pointSize());
}
void SettingDialog::setUseDarkTheme(bool value)
{
ui->cbbUseDarkTheme->setChecked(value);
}
} // namespace LimeReport

View File

@ -19,11 +19,13 @@ public:
int verticalGridStep();
int horizontalGridStep();
QFont defaultFont();
bool userDarkTheme();
bool suppressAbsentFieldsAndVarsWarnings();
void setSuppressAbsentFieldsAndVarsWarnings(bool value);
void setHorizontalGridStep(int value);
void setVerticalGridStep(int value);
void setDefaultFont(const QFont& value);
void setUseDarkTheme(bool value);
private:
Ui::SettingDialog *ui;
};

View File

@ -108,6 +108,13 @@
</layout>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cbbUseDarkTheme">
<property name="text">
<string>Use dark theme</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>

View File

@ -45,7 +45,7 @@ class VarDesc : public QObject{
Q_PROPERTY(bool isMandatory READ isMandatory WRITE setMandatory)
Q_PROPERTY(int dataType READ readDataTypeProperty WRITE setDataTypeProperty)
public:
VarDesc() : m_dataType(VariableDataType::Undefined), m_mandatory(false){}
VarDesc() : m_dataType(Enums::Undefined), m_mandatory(false){}
enum VarType {System, User, Report};
void setVarType(VarType value){m_varType=value;}
VarType varType(){return m_varType;}

View File

@ -35,7 +35,6 @@
#include <QIcon>
#include <QImage>
#include <QPainter>
#include <QApplication>
#include <QStyle>
#include <QStylePainter>

View File

@ -8,7 +8,6 @@
#include <QPainter>
#include <QTextBlock>
#include <QDebug>
#include <QApplication>
#include "lrscripthighlighter.h"

View File

@ -48,7 +48,7 @@ void ScriptEditor::initEditor(DataSourceManager* dm)
}
}
void ScriptEditor::setReportEngine(ReportEnginePrivate* reportEngine)
void ScriptEditor::setReportEngine(ReportEnginePrivateInterface* reportEngine)
{
m_reportEngine = reportEngine;
DataSourceManager* dm = m_reportEngine->dataManager();

View File

@ -9,7 +9,7 @@
namespace LimeReport{
class ReportEnginePrivate;
class ReportEnginePrivateInterface;
class BaseDesignIntf;
class PageDesignIntf;
class BandDesignIntf;
@ -25,7 +25,7 @@ class ScriptEditor : public QWidget
public:
explicit ScriptEditor(QWidget *parent = 0);
~ScriptEditor();
void setReportEngine(ReportEnginePrivate* reportEngine);
void setReportEngine(LimeReport::ReportEnginePrivateInterface* reportEngine);
void setReportPage(PageDesignIntf* page);
void setPageBand(BandDesignIntf* band);
void initCompleter();
@ -48,7 +48,7 @@ private:
void addItemToCompleater(const QString& pageName, BaseDesignIntf* item, QStringList& dataWords);
private:
Ui::ScriptEditor *ui;
ReportEnginePrivate* m_reportEngine;
ReportEnginePrivateInterface* m_reportEngine;
PageDesignIntf* m_page;
QCompleter* m_completer;