mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2025-01-11 20:31:04 +03:00
commit
797edd541c
561
.travis.yml
561
.travis.yml
@ -1,27 +1,548 @@
|
|||||||
language: cpp
|
matrix:
|
||||||
|
include:
|
||||||
|
- env: Qt4.8.5_Ubuntu_14.04
|
||||||
|
os: linux
|
||||||
|
dist: trusty
|
||||||
|
language: cpp
|
||||||
|
compiler: gcc
|
||||||
|
cache: ccache
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- qt4-default
|
||||||
|
|
||||||
compiler:
|
script:
|
||||||
- gcc
|
|
||||||
|
|
||||||
sudo: required
|
|
||||||
dist: trusty
|
|
||||||
|
|
||||||
env:
|
|
||||||
- QT_BASE=56
|
|
||||||
|
|
||||||
before_install:
|
|
||||||
- if [ "$QT_BASE" = "56" ]; then sudo add-apt-repository ppa:beineri/opt-qt562-trusty -y; fi
|
|
||||||
- sudo apt-get update -qq
|
|
||||||
|
|
||||||
install:
|
|
||||||
- if [ "$QT_BASE" = "56" ]; then sudo apt-get install -qq qt56base qt56script qt56tools ; source /opt/qt56/bin/qt56-env.sh; fi
|
|
||||||
|
|
||||||
|
|
||||||
script:
|
|
||||||
- qmake -r limereport.pro
|
- qmake -r limereport.pro
|
||||||
- make
|
- make
|
||||||
- make check
|
- make check
|
||||||
|
|
||||||
|
- env: Qt4.8.5_Ubuntu_14.04
|
||||||
|
os: linux
|
||||||
|
dist: trusty
|
||||||
|
language: cpp
|
||||||
|
compiler: clang
|
||||||
|
cache: ccache
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- qt4-default
|
||||||
|
|
||||||
|
script:
|
||||||
|
- qmake -r limereport.pro
|
||||||
|
- make
|
||||||
|
- make check
|
||||||
|
|
||||||
|
- env: Qt5.1.1_Ubuntu_14.04
|
||||||
|
os: linux
|
||||||
|
dist: trusty
|
||||||
|
language: cpp
|
||||||
|
compiler: gcc
|
||||||
|
cache: ccache
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- sourceline: 'ppa:beineri/opt-qt511-trusty'
|
||||||
|
packages:
|
||||||
|
- qt51base
|
||||||
|
- qt51script
|
||||||
|
- qt51tools
|
||||||
|
|
||||||
|
script:
|
||||||
|
- source /opt/qt51/bin/qt51-env.sh
|
||||||
|
- /opt/qt51/bin/qmake -r limereport.pro
|
||||||
|
- make
|
||||||
|
- make check
|
||||||
|
|
||||||
|
- env: Qt5.1.1_Ubuntu_14.04
|
||||||
|
os: linux
|
||||||
|
dist: trusty
|
||||||
|
language: cpp
|
||||||
|
compiler: clang
|
||||||
|
cache: ccache
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- sourceline: 'ppa:beineri/opt-qt511-trusty'
|
||||||
|
packages:
|
||||||
|
- qt51base
|
||||||
|
- qt51script
|
||||||
|
- qt51tools
|
||||||
|
|
||||||
|
script:
|
||||||
|
- source /opt/qt51/bin/qt51-env.sh
|
||||||
|
- /opt/qt51/bin/qmake -r limereport.pro
|
||||||
|
- make
|
||||||
|
- make check
|
||||||
|
|
||||||
|
- env: Qt5.2.1_Ubuntu_14.04
|
||||||
|
os: linux
|
||||||
|
dist: trusty
|
||||||
|
language: cpp
|
||||||
|
compiler: gcc
|
||||||
|
cache: ccache
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- sourceline: 'ppa:beineri/opt-qt521-trusty'
|
||||||
|
packages:
|
||||||
|
- qt52base
|
||||||
|
- qt52script
|
||||||
|
- qt52tools
|
||||||
|
|
||||||
|
script:
|
||||||
|
- source /opt/qt52/bin/qt52-env.sh
|
||||||
|
- /opt/qt52/bin/qmake -r limereport.pro
|
||||||
|
- make
|
||||||
|
- make check
|
||||||
|
|
||||||
|
- env: Qt5.2.1_Ubuntu_14.04
|
||||||
|
os: linux
|
||||||
|
dist: trusty
|
||||||
|
language: cpp
|
||||||
|
compiler: clang
|
||||||
|
cache: ccache
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- sourceline: 'ppa:beineri/opt-qt521-trusty'
|
||||||
|
packages:
|
||||||
|
- qt52base
|
||||||
|
- qt52script
|
||||||
|
- qt52tools
|
||||||
|
|
||||||
|
script:
|
||||||
|
- source /opt/qt52/bin/qt52-env.sh
|
||||||
|
- /opt/qt52/bin/qmake -r limereport.pro
|
||||||
|
- make
|
||||||
|
- make check
|
||||||
|
|
||||||
|
- env: Qt5.3.2_Ubuntu_14.04
|
||||||
|
os: linux
|
||||||
|
dist: trusty
|
||||||
|
language: cpp
|
||||||
|
compiler: gcc
|
||||||
|
cache: ccache
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- sourceline: 'ppa:beineri/opt-qt532-trusty'
|
||||||
|
packages:
|
||||||
|
- qt53base
|
||||||
|
- qt53script
|
||||||
|
- qt53tools
|
||||||
|
|
||||||
|
script:
|
||||||
|
- source /opt/qt53/bin/qt53-env.sh
|
||||||
|
- /opt/qt53/bin/qmake -r limereport.pro
|
||||||
|
- make
|
||||||
|
- make check
|
||||||
|
|
||||||
|
- env: Qt5.3.2_Ubuntu_14.04
|
||||||
|
os: linux
|
||||||
|
dist: trusty
|
||||||
|
language: cpp
|
||||||
|
compiler: clang
|
||||||
|
cache: ccache
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- sourceline: 'ppa:beineri/opt-qt532-trusty'
|
||||||
|
packages:
|
||||||
|
- qt53base
|
||||||
|
- qt53script
|
||||||
|
- qt53tools
|
||||||
|
|
||||||
|
script:
|
||||||
|
- source /opt/qt53/bin/qt53-env.sh
|
||||||
|
- /opt/qt53/bin/qmake -r limereport.pro
|
||||||
|
- make
|
||||||
|
- make check
|
||||||
|
|
||||||
|
- env: Qt5.4.2_Ubuntu_14.04
|
||||||
|
os: linux
|
||||||
|
dist: trusty
|
||||||
|
language: cpp
|
||||||
|
compiler: gcc
|
||||||
|
cache: ccache
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- sourceline: 'ppa:beineri/opt-qt542-trusty'
|
||||||
|
packages:
|
||||||
|
- qt54base
|
||||||
|
- qt54script
|
||||||
|
- qt54tools
|
||||||
|
|
||||||
|
script:
|
||||||
|
- source /opt/qt54/bin/qt54-env.sh
|
||||||
|
- /opt/qt54/bin/qmake -r limereport.pro
|
||||||
|
- make
|
||||||
|
- make check
|
||||||
|
|
||||||
|
- env: Qt5.4.2_Ubuntu_14.04
|
||||||
|
os: linux
|
||||||
|
dist: trusty
|
||||||
|
language: cpp
|
||||||
|
compiler: clang
|
||||||
|
cache: ccache
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- sourceline: 'ppa:beineri/opt-qt542-trusty'
|
||||||
|
packages:
|
||||||
|
- qt54base
|
||||||
|
- qt54script
|
||||||
|
- qt54tools
|
||||||
|
|
||||||
|
script:
|
||||||
|
- source /opt/qt54/bin/qt54-env.sh
|
||||||
|
- /opt/qt54/bin/qmake -r limereport.pro
|
||||||
|
- make
|
||||||
|
- make check
|
||||||
|
|
||||||
|
- env: Qt5.5.1_Ubuntu_14.04
|
||||||
|
os: linux
|
||||||
|
dist: trusty
|
||||||
|
language: cpp
|
||||||
|
compiler: gcc
|
||||||
|
cache: ccache
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- sourceline: 'ppa:beineri/opt-qt551-trusty'
|
||||||
|
packages:
|
||||||
|
- qt55base
|
||||||
|
- qt55script
|
||||||
|
- qt55tools
|
||||||
|
|
||||||
|
script:
|
||||||
|
- source /opt/qt55/bin/qt55-env.sh
|
||||||
|
- /opt/qt55/bin/qmake -r limereport.pro
|
||||||
|
- make
|
||||||
|
- make check
|
||||||
|
|
||||||
|
- env: Qt5.5.1_Ubuntu_14.04
|
||||||
|
os: linux
|
||||||
|
dist: trusty
|
||||||
|
language: cpp
|
||||||
|
compiler: clang
|
||||||
|
cache: ccache
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- sourceline: 'ppa:beineri/opt-qt551-trusty'
|
||||||
|
packages:
|
||||||
|
- qt55base
|
||||||
|
- qt55script
|
||||||
|
- qt55tools
|
||||||
|
|
||||||
|
script:
|
||||||
|
- source /opt/qt55/bin/qt55-env.sh
|
||||||
|
- /opt/qt55/bin/qmake -r limereport.pro
|
||||||
|
- make
|
||||||
|
- make check
|
||||||
|
|
||||||
|
- env: Qt5.6.3_Ubuntu_14.04
|
||||||
|
os: linux
|
||||||
|
dist: trusty
|
||||||
|
language: cpp
|
||||||
|
compiler: gcc
|
||||||
|
cache: ccache
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- sourceline: 'ppa:beineri/opt-qt563-trusty'
|
||||||
|
packages:
|
||||||
|
- qt56base
|
||||||
|
- qt56script
|
||||||
|
- qt56tools
|
||||||
|
|
||||||
|
script:
|
||||||
|
- source /opt/qt56/bin/qt56-env.sh
|
||||||
|
- /opt/qt56/bin/qmake -r limereport.pro
|
||||||
|
- make
|
||||||
|
- make check
|
||||||
|
|
||||||
|
- env: Qt5.6.3_Ubuntu_14.04
|
||||||
|
os: linux
|
||||||
|
dist: trusty
|
||||||
|
language: cpp
|
||||||
|
compiler: clang
|
||||||
|
cache: ccache
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- sourceline: 'ppa:beineri/opt-qt563-trusty'
|
||||||
|
packages:
|
||||||
|
- qt56base
|
||||||
|
- qt56script
|
||||||
|
- qt56tools
|
||||||
|
|
||||||
|
script:
|
||||||
|
- source /opt/qt56/bin/qt56-env.sh
|
||||||
|
- /opt/qt56/bin/qmake -r limereport.pro
|
||||||
|
- make
|
||||||
|
- make check
|
||||||
|
|
||||||
|
- env: Qt5.7.1_Ubuntu_14.04
|
||||||
|
os: linux
|
||||||
|
dist: trusty
|
||||||
|
language: cpp
|
||||||
|
compiler: gcc
|
||||||
|
cache: ccache
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- sourceline: 'ppa:beineri/opt-qt571-trusty'
|
||||||
|
packages:
|
||||||
|
- qt57base
|
||||||
|
- qt57script
|
||||||
|
- qt57tools
|
||||||
|
|
||||||
|
script:
|
||||||
|
- source /opt/qt57/bin/qt57-env.sh
|
||||||
|
- /opt/qt57/bin/qmake -r limereport.pro
|
||||||
|
- make
|
||||||
|
- make check
|
||||||
|
|
||||||
|
- env: Qt5.7.1_Ubuntu_14.04
|
||||||
|
os: linux
|
||||||
|
dist: trusty
|
||||||
|
language: cpp
|
||||||
|
compiler: clang
|
||||||
|
cache: ccache
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- sourceline: 'ppa:beineri/opt-qt571-trusty'
|
||||||
|
packages:
|
||||||
|
- qt57base
|
||||||
|
- qt57script
|
||||||
|
- qt57tools
|
||||||
|
|
||||||
|
script:
|
||||||
|
- source /opt/qt57/bin/qt57-env.sh
|
||||||
|
- /opt/qt57/bin/qmake -r limereport.pro
|
||||||
|
- make
|
||||||
|
- make check
|
||||||
|
|
||||||
|
- env: Qt5.8.0_Ubuntu_14.04
|
||||||
|
os: linux
|
||||||
|
dist: trusty
|
||||||
|
language: cpp
|
||||||
|
compiler: gcc
|
||||||
|
cache: ccache
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- sourceline: 'ppa:beineri/opt-qt58-trusty'
|
||||||
|
packages:
|
||||||
|
- qt58base
|
||||||
|
- qt58script
|
||||||
|
- qt58tools
|
||||||
|
|
||||||
|
script:
|
||||||
|
- source /opt/qt58/bin/qt58-env.sh
|
||||||
|
- /opt/qt58/bin/qmake -r limereport.pro
|
||||||
|
- make
|
||||||
|
- make check
|
||||||
|
|
||||||
|
- env: Qt5.8.0_Ubuntu_14.04
|
||||||
|
os: linux
|
||||||
|
dist: trusty
|
||||||
|
language: cpp
|
||||||
|
compiler: clang
|
||||||
|
cache: ccache
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- sourceline: 'ppa:beineri/opt-qt58-trusty'
|
||||||
|
packages:
|
||||||
|
- qt58base
|
||||||
|
- qt58script
|
||||||
|
- qt58tools
|
||||||
|
|
||||||
|
script:
|
||||||
|
- source /opt/qt58/bin/qt58-env.sh
|
||||||
|
- /opt/qt58/bin/qmake -r limereport.pro
|
||||||
|
- make
|
||||||
|
- make check
|
||||||
|
|
||||||
|
- env: Qt5.9.7_Ubuntu_14.04
|
||||||
|
os: linux
|
||||||
|
dist: trusty
|
||||||
|
language: cpp
|
||||||
|
compiler: gcc
|
||||||
|
cache: ccache
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- sourceline: 'ppa:beineri/opt-qt597-trusty'
|
||||||
|
packages:
|
||||||
|
- qt59base
|
||||||
|
- qt59script
|
||||||
|
- qt59tools
|
||||||
|
|
||||||
|
script:
|
||||||
|
- source /opt/qt59/bin/qt59-env.sh
|
||||||
|
- /opt/qt59/bin/qmake -r limereport.pro
|
||||||
|
- make
|
||||||
|
- make check
|
||||||
|
|
||||||
|
- env: Qt5.9.7_Ubuntu_14.04
|
||||||
|
os: linux
|
||||||
|
dist: trusty
|
||||||
|
language: cpp
|
||||||
|
compiler: clang
|
||||||
|
cache: ccache
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- sourceline: 'ppa:beineri/opt-qt597-trusty'
|
||||||
|
packages:
|
||||||
|
- qt59base
|
||||||
|
- qt59script
|
||||||
|
- qt59tools
|
||||||
|
|
||||||
|
script:
|
||||||
|
- source /opt/qt59/bin/qt59-env.sh
|
||||||
|
- /opt/qt59/bin/qmake -r limereport.pro
|
||||||
|
- make
|
||||||
|
- make check
|
||||||
|
|
||||||
|
- env: Qt5.10.1_Ubuntu_14.04
|
||||||
|
os: linux
|
||||||
|
dist: trusty
|
||||||
|
language: cpp
|
||||||
|
compiler: gcc
|
||||||
|
cache: ccache
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- sourceline: 'ppa:beineri/opt-qt-5.10.1-trusty'
|
||||||
|
packages:
|
||||||
|
- qt510base
|
||||||
|
- qt510script
|
||||||
|
- qt510tools
|
||||||
|
|
||||||
|
script:
|
||||||
|
- source /opt/qt510/bin/qt510-env.sh
|
||||||
|
- /opt/qt510/bin/qmake -r limereport.pro
|
||||||
|
- make
|
||||||
|
- make check
|
||||||
|
|
||||||
|
- env: Qt5.10.1_Ubuntu_14.04
|
||||||
|
os: linux
|
||||||
|
dist: trusty
|
||||||
|
language: cpp
|
||||||
|
compiler: clang
|
||||||
|
cache: ccache
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- sourceline: 'ppa:beineri/opt-qt-5.10.1-trusty'
|
||||||
|
packages:
|
||||||
|
- qt510base
|
||||||
|
- qt510script
|
||||||
|
- qt510tools
|
||||||
|
|
||||||
|
script:
|
||||||
|
- source /opt/qt510/bin/qt510-env.sh
|
||||||
|
- /opt/qt510/bin/qmake -r limereport.pro
|
||||||
|
- make
|
||||||
|
- make check
|
||||||
|
|
||||||
|
- env: Qt5.11.3_Ubuntu_18.04
|
||||||
|
os: linux
|
||||||
|
dist: bionic
|
||||||
|
language: cpp
|
||||||
|
compiler: gcc
|
||||||
|
cache: ccache
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- sourceline: 'ppa:beineri/opt-qt-5.11.3-bionic'
|
||||||
|
packages:
|
||||||
|
- qt511base
|
||||||
|
- qt511script
|
||||||
|
- qt511tools
|
||||||
|
- mesa-common-dev
|
||||||
|
- libgl1-mesa-dev
|
||||||
|
|
||||||
|
script:
|
||||||
|
- source /opt/qt511/bin/qt511-env.sh
|
||||||
|
- /opt/qt511/bin/qmake -r limereport.pro
|
||||||
|
- make
|
||||||
|
- make check
|
||||||
|
|
||||||
|
- env: Qt5.11.3_Ubuntu_18.04
|
||||||
|
os: linux
|
||||||
|
dist: bionic
|
||||||
|
language: cpp
|
||||||
|
compiler: clang
|
||||||
|
cache: ccache
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- sourceline: 'ppa:beineri/opt-qt-5.11.3-bionic'
|
||||||
|
packages:
|
||||||
|
- qt511base
|
||||||
|
- qt511script
|
||||||
|
- qt511tools
|
||||||
|
- mesa-common-dev
|
||||||
|
- libgl1-mesa-dev
|
||||||
|
|
||||||
|
script:
|
||||||
|
- source /opt/qt511/bin/qt511-env.sh
|
||||||
|
- /opt/qt511/bin/qmake -r limereport.pro
|
||||||
|
- make
|
||||||
|
- make check
|
||||||
|
|
||||||
|
- env: Qt5.12.3_Ubuntu_18.04
|
||||||
|
os: linux
|
||||||
|
dist: bionic
|
||||||
|
language: cpp
|
||||||
|
compiler: gcc
|
||||||
|
cache: ccache
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- sourceline: 'ppa:beineri/opt-qt-5.12.3-bionic'
|
||||||
|
packages:
|
||||||
|
- qt512base
|
||||||
|
- qt512script
|
||||||
|
- qt512tools
|
||||||
|
- mesa-common-dev
|
||||||
|
- libgl1-mesa-dev
|
||||||
|
|
||||||
|
script:
|
||||||
|
- source /opt/qt512/bin/qt512-env.sh
|
||||||
|
- /opt/qt512/bin/qmake -r limereport.pro
|
||||||
|
- make
|
||||||
|
- make check
|
||||||
|
|
||||||
|
- env: Qt5.12.3_Ubuntu_18.04
|
||||||
|
os: linux
|
||||||
|
dist: bionic
|
||||||
|
language: cpp
|
||||||
|
compiler: clang
|
||||||
|
cache: ccache
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- sourceline: 'ppa:beineri/opt-qt-5.12.3-bionic'
|
||||||
|
packages:
|
||||||
|
- qt512base
|
||||||
|
- qt512script
|
||||||
|
- qt512tools
|
||||||
|
- mesa-common-dev
|
||||||
|
- libgl1-mesa-dev
|
||||||
|
|
||||||
|
script:
|
||||||
|
- source /opt/qt512/bin/qt512-env.sh
|
||||||
|
- /opt/qt512/bin/qmake -r limereport.pro
|
||||||
|
- make
|
||||||
|
- make check
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
email: false
|
email: false
|
||||||
|
|
||||||
|
@ -66,7 +66,8 @@ HEADERS += $$PWD/../backend/aztec.h \
|
|||||||
$$PWD/../backend/sjis.h \
|
$$PWD/../backend/sjis.h \
|
||||||
$$PWD/../backend/stdint_msvc.h \
|
$$PWD/../backend/stdint_msvc.h \
|
||||||
$$PWD/../backend/zint.h \
|
$$PWD/../backend/zint.h \
|
||||||
$$PWD/qzint.h
|
$$PWD/qzint.h \
|
||||||
|
$$PWD/qzint_global.h
|
||||||
|
|
||||||
SOURCES += $$PWD/../backend/2of5.c \
|
SOURCES += $$PWD/../backend/2of5.c \
|
||||||
$$PWD/../backend/auspost.c \
|
$$PWD/../backend/auspost.c \
|
||||||
|
@ -3,10 +3,14 @@
|
|||||||
|
|
||||||
#include <QtCore/qglobal.h>
|
#include <QtCore/qglobal.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_STATIC_BUILD
|
||||||
|
# define QZINTSHARED_EXPORT /**/
|
||||||
|
#else
|
||||||
#if defined(QZINT_LIBRARY)
|
#if defined(QZINT_LIBRARY)
|
||||||
# define QZINTSHARED_EXPORT Q_DECL_EXPORT
|
# define QZINTSHARED_EXPORT Q_DECL_EXPORT
|
||||||
#else
|
#else
|
||||||
# define QZINTSHARED_EXPORT Q_DECL_IMPORT
|
# define QZINTSHARED_EXPORT Q_DECL_IMPORT
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // QZINT_GLOBAL_H
|
#endif // QZINT_GLOBAL_H
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
# LimeReport v1.5.0 [![Build Status](https://api.travis-ci.org/fralx/LimeReport.svg?branch=master)](https://travis-ci.org/fralx/LimeReport) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/bc31412ea4814f30825b5ed3723e9a70)](https://app.codacy.com/app/fralx/LimeReport?utm_source=github.com&utm_medium=referral&utm_content=fralx/LimeReport&utm_campaign=Badge_Grade_Dashboard)
|
|
||||||
|
# LimeReport v1.5.16 [![Build Status](https://api.travis-ci.org/fralx/LimeReport.svg?branch=master)](https://travis-ci.org/fralx/LimeReport) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/bc31412ea4814f30825b5ed3723e9a70)](https://app.codacy.com/app/fralx/LimeReport?utm_source=github.com&utm_medium=referral&utm_content=fralx/LimeReport&utm_campaign=Badge_Grade_Dashboard)
|
||||||
|
|
||||||
## Official LimeReport web site [http://limereport.ru](http://limereport.ru)
|
## Official LimeReport web site [http://limereport.ru](http://limereport.ru)
|
||||||
|
|
||||||
### Features
|
## Donation [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/arinalex)
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
* Multi-platform support
|
* Multi-platform support
|
||||||
* Pure Qt4/Qt5 compatible code
|
* Pure Qt4/Qt5 compatible code
|
||||||
|
@ -127,7 +127,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc
|
|||||||
|
|
||||||
LIMEREPORT_VERSION_MAJOR = 1
|
LIMEREPORT_VERSION_MAJOR = 1
|
||||||
LIMEREPORT_VERSION_MINOR = 5
|
LIMEREPORT_VERSION_MINOR = 5
|
||||||
LIMEREPORT_VERSION_RELEASE = 1
|
LIMEREPORT_VERSION_RELEASE = 21
|
||||||
|
|
||||||
LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}'
|
LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}'
|
||||||
DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\"
|
DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\"
|
||||||
|
@ -681,7 +681,7 @@
|
|||||||
<itemLocation Type="enumAndFlags" Value="0"/>
|
<itemLocation Type="enumAndFlags" Value="0"/>
|
||||||
<stretchToMaxHeight Type="bool" Value="0"/>
|
<stretchToMaxHeight Type="bool" Value="0"/>
|
||||||
<itemAlign Type="enumAndFlags" Value="4"/>
|
<itemAlign Type="enumAndFlags" Value="4"/>
|
||||||
<content Type="QString">Count: $S{COUNT("DataBand1")}</content>
|
<content Type="QString">Count: $S{COUNT(DataBand1)}</content>
|
||||||
<margin Type="int" Value="4"/>
|
<margin Type="int" Value="4"/>
|
||||||
<alignment Type="enumAndFlags" Value="34"/>
|
<alignment Type="enumAndFlags" Value="34"/>
|
||||||
<autoWidth Type="enumAndFlags" Value="0"/>
|
<autoWidth Type="enumAndFlags" Value="0"/>
|
||||||
|
@ -77,7 +77,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
int index = m_customers->record().indexOf("CustomerID");
|
int index = m_customers->record().indexOf("CustomerID");
|
||||||
m_orders->bindValue(":id",m_customers->value(index));
|
m_orders->bindValue(":id",m_customers->value(index));
|
||||||
m_orders->exec();
|
m_orders->exec();
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LimeReport::ICallbackDatasource * callbackDatasource = report->dataManager()->createCallbackDatasource("master");
|
LimeReport::ICallbackDatasource * callbackDatasource = report->dataManager()->createCallbackDatasource("master");
|
||||||
@ -156,18 +156,21 @@ void MainWindow::on_pushButton_2_clicked()
|
|||||||
// printers.insert("default",printer);
|
// printers.insert("default",printer);
|
||||||
// report->printReport(printers);
|
// report->printReport(printers);
|
||||||
// }
|
// }
|
||||||
|
report->setShowProgressDialog(true);
|
||||||
report->previewReport();
|
report->previewReport();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::renderStarted()
|
void MainWindow::renderStarted()
|
||||||
{
|
{
|
||||||
|
if (report->isShowProgressDialog()){
|
||||||
m_currentPage = 0;
|
m_currentPage = 0;
|
||||||
m_progressDialog = new QProgressDialog(tr("Start render"),tr("Cancel"),0,0,this);
|
m_progressDialog = new QProgressDialog(tr("Start render"),tr("Cancel"),0,0,this);
|
||||||
m_progressDialog->setWindowModality(Qt::WindowModal);
|
//m_progressDialog->setWindowModality(Qt::WindowModal);
|
||||||
connect(m_progressDialog, SIGNAL(canceled()), report, SLOT(cancelRender()));
|
connect(m_progressDialog, SIGNAL(canceled()), report, SLOT(cancelRender()));
|
||||||
m_progressDialog->show();
|
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
|
m_progressDialog->show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::renderPageFinished(int renderedPageCount)
|
void MainWindow::renderPageFinished(int renderedPageCount)
|
||||||
|
@ -15,10 +15,11 @@ void DesignerSettingManager::getAvailableLanguages(QList<QLocale::Language>* lan
|
|||||||
{
|
{
|
||||||
languages->append(QLocale::Russian);
|
languages->append(QLocale::Russian);
|
||||||
languages->append(QLocale::English);
|
languages->append(QLocale::English);
|
||||||
languages->append(QLocale::Arabic);
|
// languages->append(QLocale::Arabic);
|
||||||
languages->append(QLocale::French);
|
languages->append(QLocale::French);
|
||||||
languages->append(QLocale::Chinese);
|
languages->append(QLocale::Chinese);
|
||||||
languages->append(QLocale::Spanish);
|
languages->append(QLocale::Spanish);
|
||||||
|
languages->append(QLocale::Polish);
|
||||||
}
|
}
|
||||||
|
|
||||||
QLocale::Language DesignerSettingManager::getCurrentDefaultLanguage()
|
QLocale::Language DesignerSettingManager::getCurrentDefaultLanguage()
|
||||||
|
@ -12,7 +12,6 @@ class DesignerSettingManager : public QObject
|
|||||||
public:
|
public:
|
||||||
explicit DesignerSettingManager(QObject *parent = 0);
|
explicit DesignerSettingManager(QObject *parent = 0);
|
||||||
~DesignerSettingManager();
|
~DesignerSettingManager();
|
||||||
void setApplicationInstance(QApplication* application);
|
|
||||||
public slots:
|
public slots:
|
||||||
void getAvailableLanguages(QList<QLocale::Language>* languages);
|
void getAvailableLanguages(QList<QLocale::Language>* languages);
|
||||||
QLocale::Language getCurrentDefaultLanguage();
|
QLocale::Language getCurrentDefaultLanguage();
|
||||||
|
@ -52,6 +52,7 @@ namespace LimeReport {
|
|||||||
|
|
||||||
|
|
||||||
namespace Const{
|
namespace Const{
|
||||||
|
int const DEFAULT_GRID_STEP = 1;
|
||||||
int const RESIZE_HANDLE_SIZE = 5;
|
int const RESIZE_HANDLE_SIZE = 5;
|
||||||
int const SELECTION_PEN_SIZE = 1;
|
int const SELECTION_PEN_SIZE = 1;
|
||||||
int const MINIMUM_ITEM_WIDTH = 2*RESIZE_HANDLE_SIZE;
|
int const MINIMUM_ITEM_WIDTH = 2*RESIZE_HANDLE_SIZE;
|
||||||
@ -91,6 +92,10 @@ namespace Const{
|
|||||||
const QString EOW("~!@#$%^&*()+{}|:\"<>?,/;'[]\\-=");
|
const QString EOW("~!@#$%^&*()+{}|:\"<>?,/;'[]\\-=");
|
||||||
const int DEFAULT_TAB_INDENTION = 4;
|
const int DEFAULT_TAB_INDENTION = 4;
|
||||||
const int DOCKWIDGET_MARGINS = 4;
|
const int DOCKWIDGET_MARGINS = 4;
|
||||||
|
|
||||||
|
const char SCRIPT_SIGN = 'S';
|
||||||
|
const char FIELD_SIGN = 'D';
|
||||||
|
const char VARIABLE_SIGN = 'V';
|
||||||
}
|
}
|
||||||
QString extractClassName(QString className);
|
QString extractClassName(QString className);
|
||||||
QString escapeSimbols(const QString& value);
|
QString escapeSimbols(const QString& value);
|
||||||
|
@ -164,6 +164,7 @@ public:
|
|||||||
void designReport();
|
void designReport();
|
||||||
ReportDesignWindowInterface* getDesignerWindow();
|
ReportDesignWindowInterface* getDesignerWindow();
|
||||||
void setShowProgressDialog(bool value);
|
void setShowProgressDialog(bool value);
|
||||||
|
bool isShowProgressDialog();
|
||||||
IDataSourceManager* dataManager();
|
IDataSourceManager* dataManager();
|
||||||
IScriptEngineManager* scriptManager();
|
IScriptEngineManager* scriptManager();
|
||||||
bool loadFromFile(const QString& fileName, bool autoLoadPreviewOnChange = false);
|
bool loadFromFile(const QString& fileName, bool autoLoadPreviewOnChange = false);
|
||||||
@ -212,6 +213,11 @@ signals:
|
|||||||
void renderStarted();
|
void renderStarted();
|
||||||
void renderFinished();
|
void renderFinished();
|
||||||
void renderPageFinished(int renderedPageCount);
|
void renderPageFinished(int renderedPageCount);
|
||||||
|
|
||||||
|
void printingStarted(int pageCount);
|
||||||
|
void printingFinished();
|
||||||
|
void pagePrintingFinished(int index);
|
||||||
|
|
||||||
void onSave(bool& saved);
|
void onSave(bool& saved);
|
||||||
void onSaveAs(bool& saved);
|
void onSaveAs(bool& saved);
|
||||||
void onLoad(bool& loaded);
|
void onLoad(bool& loaded);
|
||||||
@ -228,6 +234,7 @@ signals:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void cancelRender();
|
void cancelRender();
|
||||||
|
void cancelPrinting();
|
||||||
protected:
|
protected:
|
||||||
ReportEnginePrivate * const d_ptr;
|
ReportEnginePrivate * const d_ptr;
|
||||||
ReportEngine(ReportEnginePrivate &dd, QObject * parent=0);
|
ReportEngine(ReportEnginePrivate &dd, QObject * parent=0);
|
||||||
|
@ -16,9 +16,14 @@ SUBDIRS += \
|
|||||||
limereport \
|
limereport \
|
||||||
demo_r1 \
|
demo_r1 \
|
||||||
demo_r2 \
|
demo_r2 \
|
||||||
console \
|
|
||||||
designer
|
designer
|
||||||
|
|
||||||
|
greaterThan(QT_MAJOR_VERSION, 4){
|
||||||
|
greaterThan(QT_MINOR_VERSION, 1){
|
||||||
|
SUBDIRS += console
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
!contains(CONFIG, embedded_designer){
|
!contains(CONFIG, embedded_designer){
|
||||||
!contains(CONFIG, static_build){
|
!contains(CONFIG, static_build){
|
||||||
SUBDIRS += designer_plugin
|
SUBDIRS += designer_plugin
|
||||||
|
@ -278,7 +278,8 @@ void SQLEditDialog::initQueryMode()
|
|||||||
ui->cbSubdetail->setChecked(false);
|
ui->cbSubdetail->setChecked(false);
|
||||||
ui->leMaster->setVisible(false);
|
ui->leMaster->setVisible(false);
|
||||||
ui->lbMaster->setVisible(false);
|
ui->lbMaster->setVisible(false);
|
||||||
ui->tabWidget->removeTab(1);
|
//ui->tabWidget->removeTab(1);
|
||||||
|
ui->tabWidget->addTab(ui->csvTab, tr("CSV"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void SQLEditDialog::initSubQueryMode()
|
void SQLEditDialog::initSubQueryMode()
|
||||||
@ -314,7 +315,7 @@ void SQLEditDialog::initProxyMode()
|
|||||||
|
|
||||||
void SQLEditDialog::initCSVMode()
|
void SQLEditDialog::initCSVMode()
|
||||||
{
|
{
|
||||||
ui->tabWidget->removeTab(0);
|
ui->tabWidget->setCurrentWidget(ui->csvTab);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SQLEditDialog::slotPreviewData()
|
void SQLEditDialog::slotPreviewData()
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>422</width>
|
<width>422</width>
|
||||||
<height>622</height>
|
<height>624</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
@ -27,7 +27,7 @@ bool PDFExporter::exportPages(ReportPages pages, const QString &fileName, const
|
|||||||
printer.setOutputFileName(fileName);
|
printer.setOutputFileName(fileName);
|
||||||
printer.setOutputFormat(QPrinter::PdfFormat);
|
printer.setOutputFormat(QPrinter::PdfFormat);
|
||||||
if (!pages.isEmpty()){
|
if (!pages.isEmpty()){
|
||||||
m_reportEngine->printReport(pages, printer);
|
m_reportEngine->printPages(pages, &printer);
|
||||||
}
|
}
|
||||||
m_reportEngine->emitPrintedToPDF(fileName);
|
m_reportEngine->emitPrintedToPDF(fileName);
|
||||||
return true;
|
return true;
|
||||||
|
@ -11,7 +11,7 @@ class PDFExporter : public QObject, public ReportExporterInterface
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit PDFExporter(ReportEnginePrivate *parent = nullptr);
|
explicit PDFExporter(ReportEnginePrivate *parent = NULL);
|
||||||
// ReportExporterInterface interface
|
// ReportExporterInterface interface
|
||||||
bool exportPages(ReportPages pages, const QString &fileName, const QMap<QString, QVariant> ¶ms);
|
bool exportPages(ReportPages pages, const QString &fileName, const QMap<QString, QVariant> ¶ms);
|
||||||
QString exporterName()
|
QString exporterName()
|
||||||
|
@ -158,6 +158,7 @@ void AbstractLayout::beforeDelete()
|
|||||||
#endif
|
#endif
|
||||||
BaseDesignIntf *bi = dynamic_cast<BaseDesignIntf*>(item);
|
BaseDesignIntf *bi = dynamic_cast<BaseDesignIntf*>(item);
|
||||||
if (bi) {
|
if (bi) {
|
||||||
|
bi->disconnect(this);
|
||||||
bi->setParentItem(parentItem());
|
bi->setParentItem(parentItem());
|
||||||
bi->setParent(parent());
|
bi->setParent(parent());
|
||||||
bi->setVisible(true);
|
bi->setVisible(true);
|
||||||
|
@ -34,7 +34,7 @@ public:
|
|||||||
int childrenCount();
|
int childrenCount();
|
||||||
int layoutSpacing() const;
|
int layoutSpacing() const;
|
||||||
void setLayoutSpacing(int layoutSpacing);
|
void setLayoutSpacing(int layoutSpacing);
|
||||||
qreal layoutSpacingMM(){ return m_layoutSpacing * unitFactor();}
|
qreal layoutSpacingMM(){ return m_layoutSpacing * Const::mmFACTOR;}
|
||||||
protected:
|
protected:
|
||||||
void beforeDelete();
|
void beforeDelete();
|
||||||
void childAddedEvent(BaseDesignIntf *child);
|
void childAddedEvent(BaseDesignIntf *child);
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
#include "lrglobal.h"
|
#include "lrglobal.h"
|
||||||
#include "lrdatasourcemanager.h"
|
#include "lrdatasourcemanager.h"
|
||||||
#include "lrpagedesignintf.h"
|
#include "lrpagedesignintf.h"
|
||||||
|
#include "lrimageitemeditor.h"
|
||||||
|
|
||||||
namespace{
|
namespace{
|
||||||
|
|
||||||
@ -83,9 +84,15 @@ void ImageItem::loadPictureFromVariant(QVariant& data){
|
|||||||
|
|
||||||
void ImageItem::preparePopUpMenu(QMenu &menu)
|
void ImageItem::preparePopUpMenu(QMenu &menu)
|
||||||
{
|
{
|
||||||
|
QAction* editAction = menu.addAction(QIcon(":/report/images/edit_pecil2.png"),tr("Edit"));
|
||||||
|
menu.insertAction(menu.actions().at(0),editAction);
|
||||||
|
menu.insertSeparator(menu.actions().at(1));
|
||||||
|
|
||||||
|
menu.addSeparator();
|
||||||
QAction* action = menu.addAction(tr("Watermark"));
|
QAction* action = menu.addAction(tr("Watermark"));
|
||||||
action->setCheckable(true);
|
action->setCheckable(true);
|
||||||
action->setChecked(isWatermark());
|
action->setChecked(isWatermark());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImageItem::processPopUpAction(QAction *action)
|
void ImageItem::processPopUpAction(QAction *action)
|
||||||
@ -93,9 +100,26 @@ void ImageItem::processPopUpAction(QAction *action)
|
|||||||
if (action->text().compare(tr("Watermark")) == 0){
|
if (action->text().compare(tr("Watermark")) == 0){
|
||||||
page()->setPropertyToSelectedItems("watermark",action->isChecked());
|
page()->setPropertyToSelectedItems("watermark",action->isChecked());
|
||||||
}
|
}
|
||||||
|
if (action->text().compare(tr("Edit")) == 0){
|
||||||
|
this->showEditorDialog();
|
||||||
|
}
|
||||||
ItemDesignIntf::processPopUpAction(action);
|
ItemDesignIntf::processPopUpAction(action);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QImage getFileByResourcePath(QString resourcePath){
|
||||||
|
QFileInfo resourceFile(resourcePath);
|
||||||
|
if (resourceFile.exists())
|
||||||
|
return QImage(resourcePath);
|
||||||
|
return QImage();
|
||||||
|
}
|
||||||
|
|
||||||
|
QImage ImageItem::drawImage()
|
||||||
|
{
|
||||||
|
if (image().isNull())
|
||||||
|
return getFileByResourcePath(m_resourcePath);
|
||||||
|
return image();
|
||||||
|
}
|
||||||
|
|
||||||
bool ImageItem::useExternalPainter() const
|
bool ImageItem::useExternalPainter() const
|
||||||
{
|
{
|
||||||
return m_useExternalPainter;
|
return m_useExternalPainter;
|
||||||
@ -110,6 +134,13 @@ void ImageItem::setUseExternalPainter(bool value)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QWidget *ImageItem::defaultEditor()
|
||||||
|
{
|
||||||
|
ImageItemEditor* editor = new ImageItemEditor(this);
|
||||||
|
editor->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
return editor;
|
||||||
|
}
|
||||||
|
|
||||||
void ImageItem::updateItemSize(DataSourceManager* dataManager, RenderPass pass, int maxHeight)
|
void ImageItem::updateItemSize(DataSourceManager* dataManager, RenderPass pass, int maxHeight)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -220,8 +251,8 @@ void ImageItem::setAutoSize(bool autoSize)
|
|||||||
if (m_autoSize != autoSize){
|
if (m_autoSize != autoSize){
|
||||||
m_autoSize = autoSize;
|
m_autoSize = autoSize;
|
||||||
if (m_autoSize && !m_picture.isNull()){
|
if (m_autoSize && !m_picture.isNull()){
|
||||||
setWidth(image().width());
|
setWidth(drawImage().width());
|
||||||
setHeight(image().height());
|
setHeight(drawImage().height());
|
||||||
setPossibleResizeDirectionFlags(Fixed);
|
setPossibleResizeDirectionFlags(Fixed);
|
||||||
} else {
|
} else {
|
||||||
setPossibleResizeDirectionFlags(AllDirections);
|
setPossibleResizeDirectionFlags(AllDirections);
|
||||||
@ -271,10 +302,10 @@ void ImageItem::paint(QPainter *ppainter, const QStyleOptionGraphicsItem *option
|
|||||||
QPointF point = rect().topLeft();
|
QPointF point = rect().topLeft();
|
||||||
QImage img;
|
QImage img;
|
||||||
|
|
||||||
if (m_scale && !image().isNull()){
|
if (m_scale && !drawImage().isNull()){
|
||||||
img = image().scaled(rect().width(), rect().height(), keepAspectRatio() ? Qt::KeepAspectRatio : Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
|
img = drawImage().scaled(rect().width(), rect().height(), keepAspectRatio() ? Qt::KeepAspectRatio : Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
|
||||||
} else {
|
} else {
|
||||||
img = image();
|
img = drawImage();
|
||||||
}
|
}
|
||||||
|
|
||||||
qreal shiftHeight = rect().height() - img.height();
|
qreal shiftHeight = rect().height() - img.height();
|
||||||
@ -328,9 +359,9 @@ void ImageItem::paint(QPainter *ppainter, const QStyleOptionGraphicsItem *option
|
|||||||
|
|
||||||
void ImageItem::setImage(QImage value)
|
void ImageItem::setImage(QImage value)
|
||||||
{
|
{
|
||||||
if (m_picture!=value){
|
if (m_picture != value){
|
||||||
QImage oldValue = m_picture;
|
QImage oldValue = m_picture;
|
||||||
m_picture=value;
|
m_picture = value;
|
||||||
if (m_autoSize){
|
if (m_autoSize){
|
||||||
setWidth(m_picture.width());
|
setWidth(m_picture.width());
|
||||||
setHeight(m_picture.height());
|
setHeight(m_picture.height());
|
||||||
@ -340,6 +371,19 @@ void ImageItem::setImage(QImage value)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QImage ImageItem::image(){
|
||||||
|
return m_picture;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImageItem::setResourcePath(const QString &value){
|
||||||
|
if (m_resourcePath != value){
|
||||||
|
QString oldValue = m_resourcePath;
|
||||||
|
m_resourcePath = value;
|
||||||
|
update();
|
||||||
|
notify("resourcePath", oldValue, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ImageItem::Format ImageItem::format() const
|
ImageItem::Format ImageItem::format() const
|
||||||
{
|
{
|
||||||
return m_format;
|
return m_format;
|
||||||
|
@ -61,8 +61,8 @@ public:
|
|||||||
ImageItem(QObject *owner, QGraphicsItem *parent);
|
ImageItem(QObject *owner, QGraphicsItem *parent);
|
||||||
virtual void paint(QPainter *ppainter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
virtual void paint(QPainter *ppainter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||||
void setImage(QImage value);
|
void setImage(QImage value);
|
||||||
QImage image(){return m_picture;}
|
QImage image();
|
||||||
void setResourcePath(const QString &value){m_resourcePath=value;}
|
void setResourcePath(const QString &value);
|
||||||
QString resourcePath() const;
|
QString resourcePath() const;
|
||||||
QString datasource() const;
|
QString datasource() const;
|
||||||
void setDatasource(const QString &datasource);
|
void setDatasource(const QString &datasource);
|
||||||
@ -89,6 +89,7 @@ public:
|
|||||||
bool useExternalPainter() const;
|
bool useExternalPainter() const;
|
||||||
void setUseExternalPainter(bool value);
|
void setUseExternalPainter(bool value);
|
||||||
|
|
||||||
|
QWidget* defaultEditor();
|
||||||
protected:
|
protected:
|
||||||
BaseDesignIntf* createSameTypeItem(QObject *owner, QGraphicsItem *parent);
|
BaseDesignIntf* createSameTypeItem(QObject *owner, QGraphicsItem *parent);
|
||||||
void updateItemSize(DataSourceManager *dataManager, RenderPass pass, int maxHeight);
|
void updateItemSize(DataSourceManager *dataManager, RenderPass pass, int maxHeight);
|
||||||
@ -97,6 +98,7 @@ protected:
|
|||||||
void loadPictureFromVariant(QVariant& data);
|
void loadPictureFromVariant(QVariant& data);
|
||||||
void preparePopUpMenu(QMenu &menu);
|
void preparePopUpMenu(QMenu &menu);
|
||||||
void processPopUpAction(QAction *action);
|
void processPopUpAction(QAction *action);
|
||||||
|
QImage drawImage();
|
||||||
private:
|
private:
|
||||||
QImage m_picture;
|
QImage m_picture;
|
||||||
bool m_useExternalPainter;
|
bool m_useExternalPainter;
|
||||||
@ -110,7 +112,6 @@ private:
|
|||||||
bool m_center;
|
bool m_center;
|
||||||
Format m_format;
|
Format m_format;
|
||||||
QString m_variable;
|
QString m_variable;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
70
limereport/items/lrimageitemeditor.cpp
Normal file
70
limereport/items/lrimageitemeditor.cpp
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
#include "lrimageitemeditor.h"
|
||||||
|
#include "ui_lrimageitemeditor.h"
|
||||||
|
#include "lrimageitem.h"
|
||||||
|
|
||||||
|
#include <QFileInfo>
|
||||||
|
#include <QFileDialog>
|
||||||
|
|
||||||
|
ImageItemEditor::ImageItemEditor(LimeReport::ImageItem *item, QWidget *parent) :
|
||||||
|
QWidget(parent),
|
||||||
|
ui(new Ui::ImageItemEditor), m_item(item)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
m_image = QPixmap::fromImage(m_item->image());
|
||||||
|
ui->resourcePath->setText(m_item->resourcePath());
|
||||||
|
updateImage();
|
||||||
|
}
|
||||||
|
|
||||||
|
ImageItemEditor::~ImageItemEditor()
|
||||||
|
{
|
||||||
|
delete ui;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImageItemEditor::updateImage()
|
||||||
|
{
|
||||||
|
ui->imageViewer->setPixmap(m_image);
|
||||||
|
if (m_image.isNull() && !ui->resourcePath->text().isEmpty()){
|
||||||
|
if (m_resourcePathImage.isNull())
|
||||||
|
m_resourcePathImage = QPixmap(ui->resourcePath->text());
|
||||||
|
ui->imageViewer->setPixmap(m_resourcePathImage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImageItemEditor::on_tbLoadImage_clicked()
|
||||||
|
{
|
||||||
|
QString fileName = QFileDialog::getOpenFileName(this, tr("Select image file"));
|
||||||
|
m_image = QPixmap(fileName);
|
||||||
|
updateImage();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImageItemEditor::on_tbClearImage_clicked()
|
||||||
|
{
|
||||||
|
m_image = QPixmap();
|
||||||
|
updateImage();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImageItemEditor::on_buttonBox_accepted()
|
||||||
|
{
|
||||||
|
m_item->setImage(m_image.toImage());
|
||||||
|
m_item->setResourcePath(ui->resourcePath->text());
|
||||||
|
this->close();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImageItemEditor::on_buttonBox_rejected()
|
||||||
|
{
|
||||||
|
this->close();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImageItemEditor::on_toolButton_clicked()
|
||||||
|
{
|
||||||
|
ui->resourcePath->setText(QFileDialog::getOpenFileName(this, tr("Select image file")));
|
||||||
|
m_resourcePathImage = QPixmap(ui->resourcePath->text());
|
||||||
|
if (!m_resourcePathImage.isNull() && m_image.isNull())
|
||||||
|
ui->imageViewer->setPixmap(m_resourcePathImage);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImageItemEditor::on_tbResourcePath_clicked()
|
||||||
|
{
|
||||||
|
ui->resourcePath->setText("");
|
||||||
|
updateImage();
|
||||||
|
}
|
37
limereport/items/lrimageitemeditor.h
Normal file
37
limereport/items/lrimageitemeditor.h
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
#ifndef LRIMAGEITEMEDITOR_H
|
||||||
|
#define LRIMAGEITEMEDITOR_H
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class ImageItemEditor;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace LimeReport {
|
||||||
|
class ImageItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
class ImageItemEditor : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit ImageItemEditor(LimeReport::ImageItem* item, QWidget *parent = NULL);
|
||||||
|
~ImageItemEditor();
|
||||||
|
private:
|
||||||
|
void updateImage();
|
||||||
|
private:
|
||||||
|
Ui::ImageItemEditor *ui;
|
||||||
|
LimeReport::ImageItem* m_item;
|
||||||
|
QPixmap m_image;
|
||||||
|
QPixmap m_resourcePathImage;
|
||||||
|
private slots:
|
||||||
|
void on_tbLoadImage_clicked();
|
||||||
|
void on_tbClearImage_clicked();
|
||||||
|
void on_buttonBox_accepted();
|
||||||
|
void on_buttonBox_rejected();
|
||||||
|
void on_toolButton_clicked();
|
||||||
|
void on_tbResourcePath_clicked();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // LRIMAGEITEMEDITOR_H
|
170
limereport/items/lrimageitemeditor.ui
Normal file
170
limereport/items/lrimageitemeditor.ui
Normal file
@ -0,0 +1,170 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>ImageItemEditor</class>
|
||||||
|
<widget class="QWidget" name="ImageItemEditor">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>358</width>
|
||||||
|
<height>403</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Ignored" vsizetype="Ignored">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Image Item Editor</string>
|
||||||
|
</property>
|
||||||
|
<property name="windowIcon">
|
||||||
|
<iconset resource="items.qrc">
|
||||||
|
<normaloff>:/items/images/imageItem3.png</normaloff>:/items/images/imageItem3.png</iconset>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupBox">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="title">
|
||||||
|
<string>Image</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="tbLoadImage">
|
||||||
|
<property name="text">
|
||||||
|
<string>...</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../report.qrc">
|
||||||
|
<normaloff>:/report/images/folder</normaloff>:/report/images/folder</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="autoRaise">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="tbClearImage">
|
||||||
|
<property name="text">
|
||||||
|
<string>...</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../objectinspector/lobjectinspector.qrc">
|
||||||
|
<normaloff>:/items/clear.png</normaloff>:/items/clear.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="autoRaise">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="imageViewer">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="pixmap">
|
||||||
|
<pixmap resource="../../demo_r2/demo_r2.qrc">:/images/images/logo.png</pixmap>
|
||||||
|
</property>
|
||||||
|
<property name="scaledContents">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>Resource path</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="resourcePath"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="toolButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>...</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../report.qrc">
|
||||||
|
<normaloff>:/report/images/folder</normaloff>:/report/images/folder</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="autoRaise">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="tbResourcePath">
|
||||||
|
<property name="text">
|
||||||
|
<string>...</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../objectinspector/lobjectinspector.qrc">
|
||||||
|
<normaloff>:/items/clear.png</normaloff>:/items/clear.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="autoRaise">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="standardButtons">
|
||||||
|
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources>
|
||||||
|
<include location="../../demo_r2/demo_r2.qrc"/>
|
||||||
|
<include location="../report.qrc"/>
|
||||||
|
<include location="items.qrc"/>
|
||||||
|
<include location="../objectinspector/lobjectinspector.qrc"/>
|
||||||
|
<include location="../report.qrc"/>
|
||||||
|
<include location="items.qrc"/>
|
||||||
|
<include location="../objectinspector/lobjectinspector.qrc"/>
|
||||||
|
</resources>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
@ -36,6 +36,7 @@ SOURCES += \
|
|||||||
$$REPORT_PATH/items/editors/lritemsborderseditorwidget.cpp \
|
$$REPORT_PATH/items/editors/lritemsborderseditorwidget.cpp \
|
||||||
$$REPORT_PATH/items/lrsimpletagparser.cpp \
|
$$REPORT_PATH/items/lrsimpletagparser.cpp \
|
||||||
$$REPORT_PATH/items/lrimageitem.cpp \
|
$$REPORT_PATH/items/lrimageitem.cpp \
|
||||||
|
$$REPORT_PATH/items/lrimageitemeditor.cpp \
|
||||||
$$REPORT_PATH/items/lrtextitemeditor.cpp \
|
$$REPORT_PATH/items/lrtextitemeditor.cpp \
|
||||||
$$REPORT_PATH/items/lrshapeitem.cpp \
|
$$REPORT_PATH/items/lrshapeitem.cpp \
|
||||||
$$REPORT_PATH/items/lrtextitem.cpp \
|
$$REPORT_PATH/items/lrtextitem.cpp \
|
||||||
@ -108,6 +109,7 @@ HEADERS += \
|
|||||||
$$REPORT_PATH/items/lrtextitemeditor.h \
|
$$REPORT_PATH/items/lrtextitemeditor.h \
|
||||||
$$REPORT_PATH/items/lrshapeitem.h \
|
$$REPORT_PATH/items/lrshapeitem.h \
|
||||||
$$REPORT_PATH/items/lrimageitem.h \
|
$$REPORT_PATH/items/lrimageitem.h \
|
||||||
|
$$REPORT_PATH/items/lrimageitemeditor.h \
|
||||||
$$REPORT_PATH/items/lrsimpletagparser.h \
|
$$REPORT_PATH/items/lrsimpletagparser.h \
|
||||||
$$REPORT_PATH/items/lrverticallayout.h \
|
$$REPORT_PATH/items/lrverticallayout.h \
|
||||||
$$REPORT_PATH/items/lrlayoutmarker.h \
|
$$REPORT_PATH/items/lrlayoutmarker.h \
|
||||||
@ -171,6 +173,7 @@ FORMS += \
|
|||||||
$$REPORT_PATH/lraboutdialog.ui \
|
$$REPORT_PATH/lraboutdialog.ui \
|
||||||
$$REPORT_PATH/lrsettingdialog.ui \
|
$$REPORT_PATH/lrsettingdialog.ui \
|
||||||
$$REPORT_PATH/items/lrchartitemeditor.ui \
|
$$REPORT_PATH/items/lrchartitemeditor.ui \
|
||||||
|
$$REPORT_PATH/items/lrimageitemeditor.ui \
|
||||||
$$REPORT_PATH/scripteditor/lrscripteditor.ui
|
$$REPORT_PATH/scripteditor/lrscripteditor.ui
|
||||||
|
|
||||||
RESOURCES += \
|
RESOURCES += \
|
||||||
|
@ -166,7 +166,8 @@ BandDesignIntf::BandDesignIntf(BandsType bandType, const QString &xmlTypeName, Q
|
|||||||
m_printAlways(false),
|
m_printAlways(false),
|
||||||
m_repeatOnEachRow(false),
|
m_repeatOnEachRow(false),
|
||||||
m_useAlternateBackgroundColor(false),
|
m_useAlternateBackgroundColor(false),
|
||||||
m_bottomSpace(0)
|
m_bottomSpace(0),
|
||||||
|
m_shiftItems(0)
|
||||||
{
|
{
|
||||||
setPossibleResizeDirectionFlags(ResizeBottom);
|
setPossibleResizeDirectionFlags(ResizeBottom);
|
||||||
setPossibleMoveFlags(TopBotom);
|
setPossibleMoveFlags(TopBotom);
|
||||||
@ -176,7 +177,7 @@ BandDesignIntf::BandDesignIntf(BandsType bandType, const QString &xmlTypeName, Q
|
|||||||
if (parentItem) setWidth(parentItem->width());
|
if (parentItem) setWidth(parentItem->width());
|
||||||
}
|
}
|
||||||
|
|
||||||
setBackgroundMode(BGMode::TransparentMode);
|
setBackgroundMode(BaseDesignIntf::TransparentMode);
|
||||||
setFillTransparentInDesignMode(false);
|
setFillTransparentInDesignMode(false);
|
||||||
setHeight(100);
|
setHeight(100);
|
||||||
setFixedPos(true);
|
setFixedPos(true);
|
||||||
@ -277,6 +278,11 @@ void BandDesignIntf::paint(QPainter *painter, const QStyleOptionGraphicsItem *op
|
|||||||
BaseDesignIntf::paint(painter,option,widget);
|
BaseDesignIntf::paint(painter,option,widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QRectF BandDesignIntf::boundingRect() const
|
||||||
|
{
|
||||||
|
return ItemsContainerDesignInft::boundingRect().adjusted(0,-4,0,4);
|
||||||
|
}
|
||||||
|
|
||||||
void BandDesignIntf::translateBandsName()
|
void BandDesignIntf::translateBandsName()
|
||||||
{
|
{
|
||||||
tr("DataBand");
|
tr("DataBand");
|
||||||
@ -356,7 +362,7 @@ void BandDesignIntf::setDataSourceName(const QString &datasource){
|
|||||||
m_dataSourceName=datasource;
|
m_dataSourceName=datasource;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BandDesignIntf::setKeepBottomSpaceOption(bool value){
|
void BandDesignIntf::setKeepBottomSpace(bool value){
|
||||||
if (m_keepBottomSpace!=value){
|
if (m_keepBottomSpace!=value){
|
||||||
m_keepBottomSpace=value;
|
m_keepBottomSpace=value;
|
||||||
if (!isLoading())
|
if (!isLoading())
|
||||||
@ -582,9 +588,13 @@ void BandDesignIntf::preparePopUpMenu(QMenu &menu)
|
|||||||
currAction->setCheckable(true);
|
currAction->setCheckable(true);
|
||||||
currAction->setChecked(isSplittable());
|
currAction->setChecked(isSplittable());
|
||||||
|
|
||||||
|
currAction = menu.addAction(tr("Keep top space"));
|
||||||
|
currAction->setCheckable(true);
|
||||||
|
currAction->setChecked(keepTopSpace());
|
||||||
|
|
||||||
currAction = menu.addAction(tr("Keep bottom space"));
|
currAction = menu.addAction(tr("Keep bottom space"));
|
||||||
currAction->setCheckable(true);
|
currAction->setCheckable(true);
|
||||||
currAction->setChecked(keepBottomSpaceOption());
|
currAction->setChecked(keepBottomSpace());
|
||||||
|
|
||||||
currAction = menu.addAction(tr("Print if empty"));
|
currAction = menu.addAction(tr("Print if empty"));
|
||||||
currAction->setCheckable(true);
|
currAction->setCheckable(true);
|
||||||
@ -595,17 +605,26 @@ void BandDesignIntf::preparePopUpMenu(QMenu &menu)
|
|||||||
void BandDesignIntf::processPopUpAction(QAction *action)
|
void BandDesignIntf::processPopUpAction(QAction *action)
|
||||||
{
|
{
|
||||||
if (action->text().compare(tr("Auto height")) == 0){
|
if (action->text().compare(tr("Auto height")) == 0){
|
||||||
setProperty("autoHeight",action->isChecked());
|
setProperty("autoHeight", action->isChecked());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (action->text().compare(tr("Splittable")) == 0){
|
if (action->text().compare(tr("Splittable")) == 0){
|
||||||
setProperty("splittable",action->isChecked());
|
setProperty("splittable", action->isChecked());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (action->text().compare(tr("Keep top space")) == 0){
|
||||||
|
setProperty("keepTopSpace", action->isChecked());
|
||||||
|
}
|
||||||
|
|
||||||
if (action->text().compare(tr("Keep bottom space")) == 0){
|
if (action->text().compare(tr("Keep bottom space")) == 0){
|
||||||
setProperty("keepBottomSpace",action->isChecked());
|
setProperty("keepBottomSpace", action->isChecked());
|
||||||
|
}
|
||||||
|
if (action->text().compare(tr("Keep top space")) == 0){
|
||||||
|
setProperty("keepTopSpace",action->isChecked());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (action->text().compare(tr("Print if empty")) == 0){
|
if (action->text().compare(tr("Print if empty")) == 0){
|
||||||
setProperty("printIfEmpty",action->isChecked());
|
setProperty("printIfEmpty", action->isChecked());
|
||||||
}
|
}
|
||||||
ItemsContainerDesignInft::processPopUpAction(action);
|
ItemsContainerDesignInft::processPopUpAction(action);
|
||||||
}
|
}
|
||||||
@ -903,6 +922,16 @@ void BandDesignIntf::slotPropertyObjectNameChanged(const QString &, const QStrin
|
|||||||
m_bandNameLabel->updateLabel(newName);
|
m_bandNameLabel->updateLabel(newName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int BandDesignIntf::shiftItems() const
|
||||||
|
{
|
||||||
|
return m_shiftItems;
|
||||||
|
}
|
||||||
|
|
||||||
|
void BandDesignIntf::setShiftItems(int shiftItems)
|
||||||
|
{
|
||||||
|
m_shiftItems = shiftItems;
|
||||||
|
}
|
||||||
|
|
||||||
bool BandDesignIntf::keepTopSpace() const
|
bool BandDesignIntf::keepTopSpace() const
|
||||||
{
|
{
|
||||||
return m_keepTopSpace;
|
return m_keepTopSpace;
|
||||||
@ -1090,10 +1119,10 @@ void BandDesignIntf::setKeepFooterTogether(bool value)
|
|||||||
|
|
||||||
void BandDesignIntf::updateItemSize(DataSourceManager* dataManager, RenderPass pass, int maxHeight)
|
void BandDesignIntf::updateItemSize(DataSourceManager* dataManager, RenderPass pass, int maxHeight)
|
||||||
{
|
{
|
||||||
qreal spaceBorder=0;
|
qreal spaceBorder = 0;
|
||||||
if (keepBottomSpaceOption()) spaceBorder = bottomSpace();
|
if (keepBottomSpace()) spaceBorder = bottomSpace();
|
||||||
spaceBorder = spaceBorder > 0 ? spaceBorder : 0;
|
spaceBorder = spaceBorder > 0 ? spaceBorder : 0;
|
||||||
if (borderLines()!=0){
|
if (borderLines() != 0){
|
||||||
spaceBorder += borderLineSize();
|
spaceBorder += borderLineSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1105,14 +1134,14 @@ void BandDesignIntf::updateItemSize(DataSourceManager* dataManager, RenderPass p
|
|||||||
arrangeSubItems(pass, dataManager);
|
arrangeSubItems(pass, dataManager);
|
||||||
if (autoHeight()){
|
if (autoHeight()){
|
||||||
if (!keepTopSpace()) {
|
if (!keepTopSpace()) {
|
||||||
qreal minTop = findMinTop();
|
qreal minTop = findMinTop() + m_shiftItems;
|
||||||
foreach (BaseDesignIntf* item, childBaseItems()) {
|
foreach (BaseDesignIntf* item, childBaseItems()) {
|
||||||
item->setY(item->y() - minTop);
|
item->setY(item->y() - minTop);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setHeight(findMaxBottom()+spaceBorder);
|
setHeight(findMaxBottom() + spaceBorder);
|
||||||
}
|
}
|
||||||
if ((maxHeight>0)&&(height()>maxHeight)){
|
if ((maxHeight > 0) && (height() > maxHeight)){
|
||||||
trimToMaxHeight(maxHeight);
|
trimToMaxHeight(maxHeight);
|
||||||
setHeight(maxHeight);
|
setHeight(maxHeight);
|
||||||
}
|
}
|
||||||
|
@ -105,7 +105,7 @@ class BandDesignIntf : public ItemsContainerDesignInft
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(bool autoHeight READ autoHeight WRITE setAutoHeight )
|
Q_PROPERTY(bool autoHeight READ autoHeight WRITE setAutoHeight )
|
||||||
Q_PROPERTY(int bandIndex READ bandIndex WRITE setBandIndex DESIGNABLE false )
|
Q_PROPERTY(int bandIndex READ bandIndex WRITE setBandIndex DESIGNABLE false )
|
||||||
Q_PROPERTY(bool keepBottomSpace READ keepBottomSpaceOption WRITE setKeepBottomSpaceOption )
|
Q_PROPERTY(bool keepBottomSpace READ keepBottomSpace WRITE setKeepBottomSpace )
|
||||||
Q_PROPERTY(bool keepTopSpace READ keepTopSpace WRITE setKeepTopSpace)
|
Q_PROPERTY(bool keepTopSpace READ keepTopSpace WRITE setKeepTopSpace)
|
||||||
Q_PROPERTY(QString parentBand READ parentBandName WRITE setParentBandName DESIGNABLE false )
|
Q_PROPERTY(QString parentBand READ parentBandName WRITE setParentBandName DESIGNABLE false )
|
||||||
Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor)
|
Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor)
|
||||||
@ -113,6 +113,7 @@ class BandDesignIntf : public ItemsContainerDesignInft
|
|||||||
Q_PROPERTY(bool printIfEmpty READ printIfEmpty WRITE setPrintIfEmpty)
|
Q_PROPERTY(bool printIfEmpty READ printIfEmpty WRITE setPrintIfEmpty)
|
||||||
Q_PROPERTY(BGMode backgroundMode READ backgroundMode WRITE setBackgroundModeProperty)
|
Q_PROPERTY(BGMode backgroundMode READ backgroundMode WRITE setBackgroundModeProperty)
|
||||||
Q_PROPERTY(int backgroundOpacity READ opacity WRITE setBackgroundOpacity)
|
Q_PROPERTY(int backgroundOpacity READ opacity WRITE setBackgroundOpacity)
|
||||||
|
Q_PROPERTY(int shiftItems READ shiftItems WRITE setShiftItems)
|
||||||
Q_ENUMS(BandColumnsLayoutType)
|
Q_ENUMS(BandColumnsLayoutType)
|
||||||
friend class BandMarker;
|
friend class BandMarker;
|
||||||
friend class BandNameLabel;
|
friend class BandNameLabel;
|
||||||
@ -142,6 +143,7 @@ public:
|
|||||||
~BandDesignIntf();
|
~BandDesignIntf();
|
||||||
|
|
||||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||||
|
QRectF boundingRect() const;
|
||||||
void translateBandsName();
|
void translateBandsName();
|
||||||
virtual BandsType bandType() const;
|
virtual BandsType bandType() const;
|
||||||
virtual QString bandTitle() const;
|
virtual QString bandTitle() const;
|
||||||
@ -162,8 +164,8 @@ public:
|
|||||||
QString datasourceName();
|
QString datasourceName();
|
||||||
void setDataSourceName(const QString& datasourceName);
|
void setDataSourceName(const QString& datasourceName);
|
||||||
|
|
||||||
void setKeepBottomSpaceOption(bool value);
|
void setKeepBottomSpace(bool value);
|
||||||
bool keepBottomSpaceOption() const {return m_keepBottomSpace;}
|
bool keepBottomSpace() const {return m_keepBottomSpace;}
|
||||||
|
|
||||||
bool keepTopSpace() const;
|
bool keepTopSpace() const;
|
||||||
void setKeepTopSpace(bool value);
|
void setKeepTopSpace(bool value);
|
||||||
@ -260,6 +262,8 @@ public:
|
|||||||
int bootomSpace() const;
|
int bootomSpace() const;
|
||||||
void setBootomSpace(int bootomSpace);
|
void setBootomSpace(int bootomSpace);
|
||||||
void updateBandMarkerGeometry();
|
void updateBandMarkerGeometry();
|
||||||
|
int shiftItems() const;
|
||||||
|
void setShiftItems(int shiftItems);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void bandRendered(BandDesignIntf* band);
|
void bandRendered(BandDesignIntf* band);
|
||||||
@ -323,6 +327,7 @@ private:
|
|||||||
bool m_useAlternateBackgroundColor;
|
bool m_useAlternateBackgroundColor;
|
||||||
int m_bottomSpace;
|
int m_bottomSpace;
|
||||||
QMap<QString,QVariant> m_bookmarks;
|
QMap<QString,QVariant> m_bookmarks;
|
||||||
|
int m_shiftItems;
|
||||||
};
|
};
|
||||||
|
|
||||||
class DataBandDesignIntf : public BandDesignIntf{
|
class DataBandDesignIntf : public BandDesignIntf{
|
||||||
|
@ -97,7 +97,9 @@ BaseDesignIntf::BaseDesignIntf(const QString &storageTypeName, QObject *owner, Q
|
|||||||
|
|
||||||
QRectF BaseDesignIntf::boundingRect() const
|
QRectF BaseDesignIntf::boundingRect() const
|
||||||
{
|
{
|
||||||
return rect();
|
qreal halfpw = pen().widthF() / 2;
|
||||||
|
halfpw += 2;
|
||||||
|
return rect().adjusted(-halfpw, -halfpw, halfpw, halfpw);
|
||||||
}
|
}
|
||||||
|
|
||||||
BaseDesignIntf::~BaseDesignIntf(void) {
|
BaseDesignIntf::~BaseDesignIntf(void) {
|
||||||
@ -500,7 +502,7 @@ void BaseDesignIntf::hoverLeaveEvent(QGraphicsSceneHoverEvent *)
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaseDesignIntf::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
void BaseDesignIntf::hoverEnterEvent(QGraphicsSceneHoverEvent /**event*/)
|
||||||
{
|
{
|
||||||
m_hovered = true;
|
m_hovered = true;
|
||||||
update();
|
update();
|
||||||
|
@ -262,7 +262,7 @@ public:
|
|||||||
|
|
||||||
QString itemTypeName() const;
|
QString itemTypeName() const;
|
||||||
void setItemTypeName(const QString &itemTypeName);
|
void setItemTypeName(const QString &itemTypeName);
|
||||||
void emitObjectNamePropertyChanged(const QString& oldName, const QString& newName);
|
|
||||||
int borderLineSize() const;
|
int borderLineSize() const;
|
||||||
void setBorderLineSize(int value);
|
void setBorderLineSize(int value);
|
||||||
void showEditorDialog();
|
void showEditorDialog();
|
||||||
@ -303,7 +303,9 @@ public:
|
|||||||
|
|
||||||
bool fillTransparentInDesignMode() const;
|
bool fillTransparentInDesignMode() const;
|
||||||
void setFillTransparentInDesignMode(bool fillTransparentInDesignMode);
|
void setFillTransparentInDesignMode(bool fillTransparentInDesignMode);
|
||||||
|
|
||||||
void emitPosChanged(QPointF oldPos, QPointF newPos);
|
void emitPosChanged(QPointF oldPos, QPointF newPos);
|
||||||
|
void emitObjectNamePropertyChanged(const QString& oldName, const QString& newName);
|
||||||
|
|
||||||
bool isGeometryLocked() const;
|
bool isGeometryLocked() const;
|
||||||
void setGeometryLocked(bool itemLocked);
|
void setGeometryLocked(bool itemLocked);
|
||||||
@ -320,7 +322,7 @@ protected:
|
|||||||
void mousePressEvent(QGraphicsSceneMouseEvent* event);
|
void mousePressEvent(QGraphicsSceneMouseEvent* event);
|
||||||
void hoverMoveEvent(QGraphicsSceneHoverEvent* event);
|
void hoverMoveEvent(QGraphicsSceneHoverEvent* event);
|
||||||
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
|
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
|
||||||
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
|
void hoverEnterEvent(QGraphicsSceneHoverEvent);
|
||||||
void mouseMoveEvent(QGraphicsSceneMouseEvent* event);
|
void mouseMoveEvent(QGraphicsSceneMouseEvent* event);
|
||||||
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
|
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
|
||||||
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
|
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
|
||||||
|
@ -176,7 +176,7 @@ public:
|
|||||||
bool isOwned() const {return true;}
|
bool isOwned() const {return true;}
|
||||||
bool isEditable() const {return true;}
|
bool isEditable() const {return true;}
|
||||||
bool isRemovable() const {return true;}
|
bool isRemovable() const {return true;}
|
||||||
void invalidate(IDataSource::DatasourceMode mode, bool dbWillBeClosed){ updateModel();}
|
void invalidate(IDataSource::DatasourceMode /*mode*/, bool /*dbWillBeClosed*/){ updateModel();}
|
||||||
void update(){ updateModel(); }
|
void update(){ updateModel(); }
|
||||||
void clearErrors(){}
|
void clearErrors(){}
|
||||||
private:
|
private:
|
||||||
|
@ -525,6 +525,7 @@ void DataSourceManager::addQuery(const QString &name, const QString &sqlText, co
|
|||||||
putQueryDesc(queryDecs);
|
putQueryDesc(queryDecs);
|
||||||
putHolder(name,new QueryHolder(sqlText, connectionName, this));
|
putHolder(name,new QueryHolder(sqlText, connectionName, this));
|
||||||
m_hasChanges = true;
|
m_hasChanges = true;
|
||||||
|
m_varToDataSource.clear();
|
||||||
emit datasourcesChanged();
|
emit datasourcesChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -534,6 +535,7 @@ void DataSourceManager::addSubQuery(const QString &name, const QString &sqlText,
|
|||||||
putSubQueryDesc(subQueryDesc);
|
putSubQueryDesc(subQueryDesc);
|
||||||
putHolder(name,new SubQueryHolder(sqlText, connectionName, masterDatasource, this));
|
putHolder(name,new SubQueryHolder(sqlText, connectionName, masterDatasource, this));
|
||||||
m_hasChanges = true;
|
m_hasChanges = true;
|
||||||
|
m_varToDataSource.clear();
|
||||||
emit datasourcesChanged();
|
emit datasourcesChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1373,20 +1375,33 @@ void DataSourceManager::slotQueryTextChanged(const QString &queryName, const QSt
|
|||||||
if (holder){
|
if (holder){
|
||||||
holder->setQueryText(queryText);
|
holder->setQueryText(queryText);
|
||||||
}
|
}
|
||||||
|
m_varToDataSource.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DataSourceManager::invalidateQueriesContainsVariable(const QString& variableName)
|
void DataSourceManager::invalidateQueriesContainsVariable(const QString& variableName)
|
||||||
{
|
{
|
||||||
if (!variableIsSystem(variableName)){
|
if (!variableIsSystem(variableName)){
|
||||||
|
|
||||||
|
if (m_varToDataSource.contains(variableName)){
|
||||||
|
foreach(QString datasourceName, m_varToDataSource.value(variableName)){
|
||||||
|
QueryHolder* holder = dynamic_cast<QueryHolder*>(m_datasources.value(datasourceName));
|
||||||
|
if (holder) holder->invalidate(designTime() ? IDataSource::DESIGN_MODE : IDataSource::RENDER_MODE);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
QVector<QString> datasources;
|
||||||
foreach (const QString& datasourceName, dataSourceNames()){
|
foreach (const QString& datasourceName, dataSourceNames()){
|
||||||
QueryHolder* holder = dynamic_cast<QueryHolder*>(m_datasources.value(datasourceName));
|
QueryHolder* holder = dynamic_cast<QueryHolder*>(m_datasources.value(datasourceName));
|
||||||
if (holder){
|
if (holder){
|
||||||
QRegExp rx(QString(Const::NAMED_VARIABLE_RX).arg(variableName));
|
QRegExp rx(QString(Const::NAMED_VARIABLE_RX).arg(variableName));
|
||||||
if (holder->queryText().contains(rx))
|
if (holder->queryText().contains(rx)){
|
||||||
holder->invalidate(designTime()?IDataSource::DESIGN_MODE:IDataSource::RENDER_MODE);
|
holder->invalidate(designTime() ? IDataSource::DESIGN_MODE : IDataSource::RENDER_MODE);
|
||||||
|
datasources.append(datasourceName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m_varToDataSource.insert(variableName, datasources);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DataSourceManager::slotVariableHasBeenAdded(const QString& variableName)
|
void DataSourceManager::slotVariableHasBeenAdded(const QString& variableName)
|
||||||
@ -1413,6 +1428,8 @@ void DataSourceManager::slotCSVTextChanged(const QString &csvName, const QString
|
|||||||
|
|
||||||
void DataSourceManager::clear(ClearMethod method)
|
void DataSourceManager::clear(ClearMethod method)
|
||||||
{
|
{
|
||||||
|
m_varToDataSource.clear();
|
||||||
|
|
||||||
DataSourcesMap::iterator dit;
|
DataSourcesMap::iterator dit;
|
||||||
for( dit = m_datasources.begin(); dit != m_datasources.end(); ){
|
for( dit = m_datasources.begin(); dit != m_datasources.end(); ){
|
||||||
bool owned = (*dit)->isOwned() && (*dit)->isRemovable();
|
bool owned = (*dit)->isOwned() && (*dit)->isRemovable();
|
||||||
|
@ -280,6 +280,9 @@ private:
|
|||||||
QHash<QString,int> m_groupFunctionsExpressionsMap;
|
QHash<QString,int> m_groupFunctionsExpressionsMap;
|
||||||
QVector<QString> m_groupFunctionsExpressions;
|
QVector<QString> m_groupFunctionsExpressions;
|
||||||
IDbCredentialsProvider* m_dbCredentialsProvider;
|
IDbCredentialsProvider* m_dbCredentialsProvider;
|
||||||
|
|
||||||
|
QMap< QString, QVector<QString> > m_varToDataSource;
|
||||||
|
|
||||||
bool m_hasChanges;
|
bool m_hasChanges;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -52,6 +52,7 @@ namespace LimeReport {
|
|||||||
|
|
||||||
|
|
||||||
namespace Const{
|
namespace Const{
|
||||||
|
int const DEFAULT_GRID_STEP = 1;
|
||||||
int const RESIZE_HANDLE_SIZE = 5;
|
int const RESIZE_HANDLE_SIZE = 5;
|
||||||
int const SELECTION_PEN_SIZE = 1;
|
int const SELECTION_PEN_SIZE = 1;
|
||||||
int const MINIMUM_ITEM_WIDTH = 2*RESIZE_HANDLE_SIZE;
|
int const MINIMUM_ITEM_WIDTH = 2*RESIZE_HANDLE_SIZE;
|
||||||
@ -91,6 +92,10 @@ namespace Const{
|
|||||||
const QString EOW("~!@#$%^&*()+{}|:\"<>?,/;'[]\\-=");
|
const QString EOW("~!@#$%^&*()+{}|:\"<>?,/;'[]\\-=");
|
||||||
const int DEFAULT_TAB_INDENTION = 4;
|
const int DEFAULT_TAB_INDENTION = 4;
|
||||||
const int DOCKWIDGET_MARGINS = 4;
|
const int DOCKWIDGET_MARGINS = 4;
|
||||||
|
|
||||||
|
const char SCRIPT_SIGN = 'S';
|
||||||
|
const char FIELD_SIGN = 'D';
|
||||||
|
const char VARIABLE_SIGN = 'V';
|
||||||
}
|
}
|
||||||
QString extractClassName(QString className);
|
QString extractClassName(QString className);
|
||||||
QString escapeSimbols(const QString& value);
|
QString escapeSimbols(const QString& value);
|
||||||
|
@ -83,8 +83,8 @@ PageDesignIntf::PageDesignIntf(QObject *parent):
|
|||||||
m_executingGroupCommand(false),
|
m_executingGroupCommand(false),
|
||||||
m_settings(0),
|
m_settings(0),
|
||||||
m_selectionRect(0),
|
m_selectionRect(0),
|
||||||
m_verticalGridStep(2),
|
m_verticalGridStep(Const::DEFAULT_GRID_STEP),
|
||||||
m_horizontalGridStep(2),
|
m_horizontalGridStep(Const::DEFAULT_GRID_STEP),
|
||||||
m_updating(false),
|
m_updating(false),
|
||||||
m_currentObjectIndex(1),
|
m_currentObjectIndex(1),
|
||||||
m_multiSelectStarted(false),
|
m_multiSelectStarted(false),
|
||||||
@ -278,7 +278,9 @@ void PageDesignIntf::setPageItem(PageItemDesignIntf::Ptr pageItem)
|
|||||||
|
|
||||||
void PageDesignIntf::setPageItems(QList<PageItemDesignIntf::Ptr> pages)
|
void PageDesignIntf::setPageItems(QList<PageItemDesignIntf::Ptr> pages)
|
||||||
{
|
{
|
||||||
|
m_currentPage = 0;
|
||||||
if (!m_pageItem.isNull()) {
|
if (!m_pageItem.isNull()) {
|
||||||
|
if (m_pageItem->scene() == this)
|
||||||
removeItem(m_pageItem.data());
|
removeItem(m_pageItem.data());
|
||||||
m_pageItem.clear();
|
m_pageItem.clear();
|
||||||
}
|
}
|
||||||
@ -302,6 +304,14 @@ void PageDesignIntf::setPageItems(QList<PageItemDesignIntf::Ptr> pages)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PageDesignIntf::removePageItem(PageItemDesignIntf::Ptr pageItem)
|
||||||
|
{
|
||||||
|
if (m_pageItem == pageItem){
|
||||||
|
removeItem(m_pageItem.data());
|
||||||
|
m_pageItem.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void PageDesignIntf::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
void PageDesignIntf::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
||||||
{
|
{
|
||||||
if (m_insertMode) {
|
if (m_insertMode) {
|
||||||
@ -816,6 +826,7 @@ void PageDesignIntf::slotItemPropertyObjectNameChanged(const QString &oldName, c
|
|||||||
if (oldName.compare(newName)!=0 && !m_executingCommand){
|
if (oldName.compare(newName)!=0 && !m_executingCommand){
|
||||||
CommandIf::Ptr command = PropertyObjectNameChangedCommand::create(this, oldName, newName);
|
CommandIf::Ptr command = PropertyObjectNameChangedCommand::create(this, oldName, newName);
|
||||||
saveCommand(command, false);
|
saveCommand(command, false);
|
||||||
|
emit itemPropertyObjectNameChanged(oldName, newName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1458,15 +1469,24 @@ void PageDesignIntf::sendToBack()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool PageDesignIntf::selectionContainsBand(){
|
||||||
|
foreach(QGraphicsItem * item,selectedItems()){
|
||||||
|
BandDesignIntf *band = dynamic_cast<BandDesignIntf *>(item);
|
||||||
|
if (band) return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void PageDesignIntf::alignToLeft()
|
void PageDesignIntf::alignToLeft()
|
||||||
{
|
{
|
||||||
if ((selectedItems().count() > 0) && m_firstSelectedItem) {
|
if ((selectedItems().count() > 0) && m_firstSelectedItem) {
|
||||||
CommandGroup::Ptr cm = CommandGroup::create();
|
CommandGroup::Ptr cm = CommandGroup::create();
|
||||||
|
bool moveInBand = selectionContainsBand();
|
||||||
foreach(QGraphicsItem * item, selectedItems()) {
|
foreach(QGraphicsItem * item, selectedItems()) {
|
||||||
BaseDesignIntf *bdItem = dynamic_cast<BaseDesignIntf *>(item);
|
BaseDesignIntf *bdItem = dynamic_cast<BaseDesignIntf *>(item);
|
||||||
if (bdItem && !bdItem->isGeometryLocked()) {
|
if (bdItem && !bdItem->isGeometryLocked()) {
|
||||||
QRectF oldGeometry = bdItem->geometry();
|
QRectF oldGeometry = bdItem->geometry();
|
||||||
bdItem->setPos(QPoint(m_firstSelectedItem->pos().x(), item->pos().y()));
|
bdItem->setPos(QPointF(moveInBand ? 0 : m_firstSelectedItem->pos().x(), item->pos().y()));
|
||||||
CommandIf::Ptr command = PropertyChangedCommand::create(this, bdItem->objectName(), "geometry", oldGeometry, bdItem->geometry());
|
CommandIf::Ptr command = PropertyChangedCommand::create(this, bdItem->objectName(), "geometry", oldGeometry, bdItem->geometry());
|
||||||
cm->addCommand(command, false);
|
cm->addCommand(command, false);
|
||||||
}
|
}
|
||||||
@ -1479,11 +1499,19 @@ void PageDesignIntf::alignToRigth()
|
|||||||
{
|
{
|
||||||
if ((selectedItems().count() > 0) && m_firstSelectedItem) {
|
if ((selectedItems().count() > 0) && m_firstSelectedItem) {
|
||||||
CommandGroup::Ptr cm = CommandGroup::create();
|
CommandGroup::Ptr cm = CommandGroup::create();
|
||||||
|
bool moveInBand = selectionContainsBand();
|
||||||
foreach(QGraphicsItem * item, selectedItems()) {
|
foreach(QGraphicsItem * item, selectedItems()) {
|
||||||
BaseDesignIntf *bdItem = dynamic_cast<BaseDesignIntf *>(item);
|
BaseDesignIntf *bdItem = dynamic_cast<BaseDesignIntf *>(item);
|
||||||
if (bdItem && !bdItem->isGeometryLocked()) {
|
if (bdItem && !bdItem->isGeometryLocked() && !bdItem->isBand()) {
|
||||||
QRectF oldGeometry = bdItem->geometry();
|
QRectF oldGeometry = bdItem->geometry();
|
||||||
bdItem->setPos(QPoint(m_firstSelectedItem->geometry().right() - bdItem->width(), bdItem->pos().y()));
|
if (moveInBand && dynamic_cast<BandDesignIntf*>(bdItem->parent()))
|
||||||
|
{
|
||||||
|
bdItem->setPos(QPointF(dynamic_cast<BandDesignIntf*>(bdItem->parent())->geometry().width() - bdItem->width(),
|
||||||
|
bdItem->pos().y()));
|
||||||
|
} else {
|
||||||
|
qreal x = m_firstSelectedItem->geometry().right() - bdItem->width();
|
||||||
|
bdItem->setPos(QPointF(x+1, bdItem->pos().y()));
|
||||||
|
}
|
||||||
CommandIf::Ptr command = PropertyChangedCommand::create(this, bdItem->objectName(), "geometry", oldGeometry, bdItem->geometry());
|
CommandIf::Ptr command = PropertyChangedCommand::create(this, bdItem->objectName(), "geometry", oldGeometry, bdItem->geometry());
|
||||||
cm->addCommand(command, false);
|
cm->addCommand(command, false);
|
||||||
}
|
}
|
||||||
@ -1496,11 +1524,18 @@ void PageDesignIntf::alignToVCenter()
|
|||||||
{
|
{
|
||||||
if ((selectedItems().count() > 0) && m_firstSelectedItem) {
|
if ((selectedItems().count() > 0) && m_firstSelectedItem) {
|
||||||
CommandGroup::Ptr cm = CommandGroup::create();
|
CommandGroup::Ptr cm = CommandGroup::create();
|
||||||
|
bool moveInBand = selectionContainsBand();
|
||||||
foreach(QGraphicsItem * item, selectedItems()) {
|
foreach(QGraphicsItem * item, selectedItems()) {
|
||||||
BaseDesignIntf *bdItem = dynamic_cast<BaseDesignIntf *>(item);
|
BaseDesignIntf *bdItem = dynamic_cast<BaseDesignIntf *>(item);
|
||||||
if (bdItem && !bdItem->isGeometryLocked()) {
|
if (bdItem && !bdItem->isGeometryLocked() && !bdItem->isBand()) {
|
||||||
QRectF oldGeometry = bdItem->geometry();
|
QRectF oldGeometry = bdItem->geometry();
|
||||||
bdItem->setPos(QPoint((m_firstSelectedItem->geometry().right() - m_firstSelectedItem->width() / 2) - bdItem->width() / 2, bdItem->pos().y()));
|
if (moveInBand && dynamic_cast<BandDesignIntf*>(bdItem->parent())){
|
||||||
|
bdItem->setPos(QPointF((dynamic_cast<BandDesignIntf*>(bdItem->parent())->geometry().width() / 2) - bdItem->width() / 2,
|
||||||
|
bdItem->pos().y()));
|
||||||
|
} else {
|
||||||
|
qreal x = (m_firstSelectedItem->geometry().right() - m_firstSelectedItem->width() / 2) - bdItem->width() / 2;
|
||||||
|
bdItem->setPos(QPointF(x+1, bdItem->pos().y()));
|
||||||
|
}
|
||||||
CommandIf::Ptr command = PropertyChangedCommand::create(this, bdItem->objectName(), "geometry", oldGeometry, bdItem->geometry());
|
CommandIf::Ptr command = PropertyChangedCommand::create(this, bdItem->objectName(), "geometry", oldGeometry, bdItem->geometry());
|
||||||
cm->addCommand(command, false);
|
cm->addCommand(command, false);
|
||||||
}
|
}
|
||||||
@ -1513,11 +1548,16 @@ void PageDesignIntf::alignToTop()
|
|||||||
{
|
{
|
||||||
if ((selectedItems().count() > 0) && m_firstSelectedItem) {
|
if ((selectedItems().count() > 0) && m_firstSelectedItem) {
|
||||||
CommandGroup::Ptr cm = CommandGroup::create();
|
CommandGroup::Ptr cm = CommandGroup::create();
|
||||||
|
bool moveInBand = selectionContainsBand();
|
||||||
foreach(QGraphicsItem * item, selectedItems()) {
|
foreach(QGraphicsItem * item, selectedItems()) {
|
||||||
BaseDesignIntf *bdItem = dynamic_cast<BaseDesignIntf *>(item);
|
BaseDesignIntf *bdItem = dynamic_cast<BaseDesignIntf *>(item);
|
||||||
if (bdItem && !bdItem->isGeometryLocked()) {
|
if (bdItem && !bdItem->isGeometryLocked() && !bdItem->isBand()) {
|
||||||
QRectF oldGeometry = bdItem->geometry();
|
QRectF oldGeometry = bdItem->geometry();
|
||||||
bdItem->setPos(QPoint(bdItem->pos().x(), m_firstSelectedItem->pos().y()));
|
if (moveInBand){
|
||||||
|
bdItem->setPos(QPointF(0, m_firstSelectedItem->pos().y()));
|
||||||
|
} else {
|
||||||
|
bdItem->setPos(QPointF(bdItem->pos().x(), m_firstSelectedItem->pos().y()));
|
||||||
|
}
|
||||||
CommandIf::Ptr command = PropertyChangedCommand::create(this, bdItem->objectName(), "geometry", oldGeometry, bdItem->geometry());
|
CommandIf::Ptr command = PropertyChangedCommand::create(this, bdItem->objectName(), "geometry", oldGeometry, bdItem->geometry());
|
||||||
cm->addCommand(command, false);
|
cm->addCommand(command, false);
|
||||||
}
|
}
|
||||||
@ -1530,11 +1570,17 @@ void PageDesignIntf::alignToBottom()
|
|||||||
{
|
{
|
||||||
if ((selectedItems().count() > 0) && m_firstSelectedItem) {
|
if ((selectedItems().count() > 0) && m_firstSelectedItem) {
|
||||||
CommandGroup::Ptr cm = CommandGroup::create();
|
CommandGroup::Ptr cm = CommandGroup::create();
|
||||||
|
bool moveInBand = selectionContainsBand();
|
||||||
foreach(QGraphicsItem * item, selectedItems()) {
|
foreach(QGraphicsItem * item, selectedItems()) {
|
||||||
BaseDesignIntf *bdItem = dynamic_cast<BaseDesignIntf *>(item);
|
BaseDesignIntf *bdItem = dynamic_cast<BaseDesignIntf *>(item);
|
||||||
if (bdItem && !bdItem->isGeometryLocked()) {
|
if (bdItem && !bdItem->isGeometryLocked() && !bdItem->isBand()) {
|
||||||
QRectF oldGeometry = bdItem->geometry();
|
QRectF oldGeometry = bdItem->geometry();
|
||||||
bdItem->setPos(QPoint(bdItem->pos().x(), m_firstSelectedItem->geometry().bottom() - bdItem->height()));
|
if (moveInBand && dynamic_cast<BandDesignIntf*>(bdItem->parent())){
|
||||||
|
bdItem->setPos(QPointF(bdItem->pos().x(), dynamic_cast<BandDesignIntf*>(bdItem->parent())->height() - bdItem->height()));
|
||||||
|
} else {
|
||||||
|
qreal y = m_firstSelectedItem->geometry().bottom() - bdItem->height();
|
||||||
|
bdItem->setPos(QPointF(bdItem->pos().x(), y+1));
|
||||||
|
}
|
||||||
CommandIf::Ptr command = PropertyChangedCommand::create(this, bdItem->objectName(), "geometry", oldGeometry, bdItem->geometry());
|
CommandIf::Ptr command = PropertyChangedCommand::create(this, bdItem->objectName(), "geometry", oldGeometry, bdItem->geometry());
|
||||||
cm->addCommand(command, false);
|
cm->addCommand(command, false);
|
||||||
}
|
}
|
||||||
@ -1547,11 +1593,17 @@ void PageDesignIntf::alignToHCenter()
|
|||||||
{
|
{
|
||||||
if ((selectedItems().count() > 0) && m_firstSelectedItem) {
|
if ((selectedItems().count() > 0) && m_firstSelectedItem) {
|
||||||
CommandGroup::Ptr cm = CommandGroup::create();
|
CommandGroup::Ptr cm = CommandGroup::create();
|
||||||
|
bool moveInBand = selectionContainsBand();
|
||||||
foreach(QGraphicsItem * item, selectedItems()) {
|
foreach(QGraphicsItem * item, selectedItems()) {
|
||||||
BaseDesignIntf *bdItem = dynamic_cast<BaseDesignIntf *>(item);
|
BaseDesignIntf *bdItem = dynamic_cast<BaseDesignIntf *>(item);
|
||||||
if (bdItem && !bdItem->isGeometryLocked()) {
|
if (bdItem && !bdItem->isGeometryLocked() && !bdItem->isBand()) {
|
||||||
QRectF oldGeometry = bdItem->geometry();
|
QRectF oldGeometry = bdItem->geometry();
|
||||||
bdItem->setPos(QPoint(bdItem->pos().x(), (m_firstSelectedItem->geometry().bottom() - m_firstSelectedItem->height() / 2) - bdItem->height() / 2));
|
if (moveInBand && dynamic_cast<BandDesignIntf*>(bdItem->parent())){
|
||||||
|
bdItem->setPos(QPointF(bdItem->pos().x(), (dynamic_cast<BandDesignIntf*>(bdItem->parent())->height() / 2) - bdItem->height() / 2));
|
||||||
|
} else {
|
||||||
|
qreal y = (m_firstSelectedItem->geometry().bottom() - m_firstSelectedItem->height() / 2) - bdItem->height() / 2;
|
||||||
|
bdItem->setPos(QPointF(bdItem->pos().x(), y+1));
|
||||||
|
}
|
||||||
CommandIf::Ptr command = PropertyChangedCommand::create(this, bdItem->objectName(), "geometry", oldGeometry, bdItem->geometry());
|
CommandIf::Ptr command = PropertyChangedCommand::create(this, bdItem->objectName(), "geometry", oldGeometry, bdItem->geometry());
|
||||||
cm->addCommand(command, false);
|
cm->addCommand(command, false);
|
||||||
}
|
}
|
||||||
@ -2135,7 +2187,7 @@ bool PosChangedCommand::doIt()
|
|||||||
if (reportItem && (reportItem->pos() != m_newPos[i].pos)){
|
if (reportItem && (reportItem->pos() != m_newPos[i].pos)){
|
||||||
QPointF oldValue = reportItem->pos();
|
QPointF oldValue = reportItem->pos();
|
||||||
reportItem->setPos(m_newPos[i].pos);
|
reportItem->setPos(m_newPos[i].pos);
|
||||||
emit reportItem->posChanged(reportItem, oldValue, reportItem->pos());
|
reportItem->emitPosChanged(oldValue, reportItem->pos());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,6 +113,7 @@ namespace LimeReport {
|
|||||||
PageItemDesignIntf *pageItem();
|
PageItemDesignIntf *pageItem();
|
||||||
void setPageItem(PageItemDesignIntf::Ptr pageItem);
|
void setPageItem(PageItemDesignIntf::Ptr pageItem);
|
||||||
void setPageItems(QList<PageItemDesignIntf::Ptr> pages);
|
void setPageItems(QList<PageItemDesignIntf::Ptr> pages);
|
||||||
|
void removePageItem(PageItemDesignIntf::Ptr pageItem);
|
||||||
QList<PageItemDesignIntf::Ptr> pageItems(){return m_reportPages;}
|
QList<PageItemDesignIntf::Ptr> pageItems(){return m_reportPages;}
|
||||||
|
|
||||||
bool isItemInsertMode();
|
bool isItemInsertMode();
|
||||||
@ -218,6 +219,7 @@ namespace LimeReport {
|
|||||||
const QString& propertyName,
|
const QString& propertyName,
|
||||||
const QVariant& oldValue,
|
const QVariant& oldValue,
|
||||||
const QVariant& newValue);
|
const QVariant& newValue);
|
||||||
|
void itemPropertyObjectNameChanged(const QString& oldName, const QString& newName);
|
||||||
void itemAdded(LimeReport::PageDesignIntf* page, LimeReport::BaseDesignIntf* item);
|
void itemAdded(LimeReport::PageDesignIntf* page, LimeReport::BaseDesignIntf* item);
|
||||||
void itemRemoved(LimeReport::PageDesignIntf* page, LimeReport::BaseDesignIntf* item);
|
void itemRemoved(LimeReport::PageDesignIntf* page, LimeReport::BaseDesignIntf* item);
|
||||||
void bandAdded(LimeReport::PageDesignIntf* page, LimeReport::BandDesignIntf* band);
|
void bandAdded(LimeReport::PageDesignIntf* page, LimeReport::BandDesignIntf* band);
|
||||||
@ -281,6 +283,7 @@ namespace LimeReport {
|
|||||||
void changeSelectedGroupProperty(const QString& name,const QVariant& value);
|
void changeSelectedGroupProperty(const QString& name,const QVariant& value);
|
||||||
void activateItemToJoin(QRectF itemRect, QList<ItemProjections>& items);
|
void activateItemToJoin(QRectF itemRect, QList<ItemProjections>& items);
|
||||||
void selectAllChildren(BaseDesignIntf* item);
|
void selectAllChildren(BaseDesignIntf* item);
|
||||||
|
bool selectionContainsBand();
|
||||||
private:
|
private:
|
||||||
enum JoinType{Width, Height};
|
enum JoinType{Width, Height};
|
||||||
LimeReport::PageItemDesignIntf::Ptr m_pageItem;
|
LimeReport::PageItemDesignIntf::Ptr m_pageItem;
|
||||||
@ -321,6 +324,7 @@ namespace LimeReport {
|
|||||||
bool m_magneticMovement;
|
bool m_magneticMovement;
|
||||||
ReportSettings* m_reportSettings;
|
ReportSettings* m_reportSettings;
|
||||||
PageItemDesignIntf* m_currentPage;
|
PageItemDesignIntf* m_currentPage;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class AbstractPageCommand : public CommandIf{
|
class AbstractPageCommand : public CommandIf{
|
||||||
|
@ -1011,7 +1011,7 @@ void PageItemDesignIntf::setGridStep(int value)
|
|||||||
int PageItemDesignIntf::gridStep()
|
int PageItemDesignIntf::gridStep()
|
||||||
{
|
{
|
||||||
if (page()) return page()->horizontalGridStep();
|
if (page()) return page()->horizontalGridStep();
|
||||||
else return 2;
|
else return Const::DEFAULT_GRID_STEP;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PageItemDesignIntf::objectLoadFinished()
|
void PageItemDesignIntf::objectLoadFinished()
|
||||||
|
@ -222,9 +222,9 @@ void PreviewReportWidget::lastPage()
|
|||||||
void PreviewReportWidget::printPages(QPrinter* printer)
|
void PreviewReportWidget::printPages(QPrinter* printer)
|
||||||
{
|
{
|
||||||
if (!d_ptr->m_reportPages.isEmpty())
|
if (!d_ptr->m_reportPages.isEmpty())
|
||||||
ReportEnginePrivate::printReport(
|
d_ptr->m_report->printPages(
|
||||||
d_ptr->m_reportPages,
|
d_ptr->m_reportPages,
|
||||||
*printer
|
printer
|
||||||
);
|
);
|
||||||
foreach(PageItemDesignIntf::Ptr pageItem, d_ptr->m_reportPages){
|
foreach(PageItemDesignIntf::Ptr pageItem, d_ptr->m_reportPages){
|
||||||
d_ptr->m_previewPage->reactivatePageItem(pageItem);
|
d_ptr->m_previewPage->reactivatePageItem(pageItem);
|
||||||
|
@ -42,6 +42,9 @@
|
|||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QScrollBar>
|
#include <QScrollBar>
|
||||||
#include <QDesktopWidget>
|
#include <QDesktopWidget>
|
||||||
|
#include <QLabel>
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include <QToolButton>
|
||||||
|
|
||||||
namespace LimeReport{
|
namespace LimeReport{
|
||||||
|
|
||||||
@ -51,6 +54,25 @@ PreviewReportWindow::PreviewReportWindow(ReportEngine *report, QWidget *parent,
|
|||||||
m_scalePercentChanging(false)
|
m_scalePercentChanging(false)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
m_progressWidget = new QWidget(ui->statusbar);
|
||||||
|
QHBoxLayout* progressLayout = new QHBoxLayout();
|
||||||
|
progressLayout->setMargin(0);
|
||||||
|
progressLayout->addWidget(new QLabel(tr("Printing")));
|
||||||
|
m_progressBar = new QProgressBar(ui->statusbar);
|
||||||
|
m_progressBar->setMaximumWidth(100);
|
||||||
|
m_progressBar->setMaximumHeight(ui->statusbar->fontMetrics().height());
|
||||||
|
progressLayout->addWidget(m_progressBar);
|
||||||
|
QToolButton* tbCancel = new QToolButton();
|
||||||
|
tbCancel->setIcon(QIcon(":/report/images/closebox"));
|
||||||
|
tbCancel->setAutoRaise(true);
|
||||||
|
connect(tbCancel, SIGNAL(clicked(bool)), this, SLOT(slotCancelPrinting(bool)));
|
||||||
|
progressLayout->addWidget(tbCancel);
|
||||||
|
progressLayout->setSizeConstraint(QLayout::SetFixedSize);
|
||||||
|
m_progressWidget->setLayout(progressLayout);
|
||||||
|
m_progressWidget->setVisible(false);
|
||||||
|
ui->statusbar->addPermanentWidget(m_progressWidget);
|
||||||
|
|
||||||
setWindowTitle("Lime Report Preview");
|
setWindowTitle("Lime Report Preview");
|
||||||
m_pagesNavigator = new QSpinBox(this);
|
m_pagesNavigator = new QSpinBox(this);
|
||||||
m_pagesNavigator->setMaximum(10000000);
|
m_pagesNavigator->setMaximum(10000000);
|
||||||
@ -73,6 +95,10 @@ PreviewReportWindow::PreviewReportWindow(ReportEngine *report, QWidget *parent,
|
|||||||
connect(m_previewReportWidget, SIGNAL(onSave(bool&, LimeReport::IPreparedPages*)),
|
connect(m_previewReportWidget, SIGNAL(onSave(bool&, LimeReport::IPreparedPages*)),
|
||||||
this, SIGNAL(onSave(bool&, LimeReport::IPreparedPages*)));
|
this, SIGNAL(onSave(bool&, LimeReport::IPreparedPages*)));
|
||||||
|
|
||||||
|
connect(m_previewReportWidget->d_ptr->m_report, SIGNAL(printingStarted(int)), this, SLOT(slotPrintingStarted(int)));
|
||||||
|
connect(m_previewReportWidget->d_ptr->m_report, SIGNAL(pagePrintingFinished(int)), this, SLOT(slotPagePrintingFinished(int)));
|
||||||
|
connect(m_previewReportWidget->d_ptr->m_report, SIGNAL(printingFinished()), this, SLOT(slotPrintingFinished()));
|
||||||
|
|
||||||
m_fontEditor = new FontEditorWidgetForPage(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->setObjectName("fontTools");
|
||||||
m_fontEditor->setIconSize(ui->toolBar->iconSize());
|
m_fontEditor->setIconSize(ui->toolBar->iconSize());
|
||||||
@ -189,6 +215,10 @@ void PreviewReportWindow::setMenuVisible(bool value)
|
|||||||
void PreviewReportWindow::setHideResultEditButton(bool value)
|
void PreviewReportWindow::setHideResultEditButton(bool value)
|
||||||
{
|
{
|
||||||
ui->actionEdit_Mode->setVisible(value);
|
ui->actionEdit_Mode->setVisible(value);
|
||||||
|
if (!value && ui->editModeTools) {
|
||||||
|
delete ui->editModeTools;
|
||||||
|
ui->editModeTools = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PreviewReportWindow::setHidePrintButton(bool value)
|
void PreviewReportWindow::setHidePrintButton(bool value)
|
||||||
@ -256,8 +286,12 @@ void PreviewReportWindow::exec()
|
|||||||
if (deleteOnClose) delete this;
|
if (deleteOnClose) delete this;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PreviewReportWindow::closeEvent(QCloseEvent *)
|
void PreviewReportWindow::closeEvent(QCloseEvent* e)
|
||||||
{
|
{
|
||||||
|
if (m_progressBar->isVisible()){
|
||||||
|
QMessageBox::critical(this, tr("Attention"), tr("The printing is in process"));
|
||||||
|
e->setAccepted(false);
|
||||||
|
}
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
writeSetting();
|
writeSetting();
|
||||||
#endif
|
#endif
|
||||||
@ -292,6 +326,7 @@ void PreviewReportWindow::moveEvent(QMoveEvent* e)
|
|||||||
void PreviewReportWindow::showEvent(QShowEvent *)
|
void PreviewReportWindow::showEvent(QShowEvent *)
|
||||||
{
|
{
|
||||||
m_fontEditor->setVisible(ui->actionEdit_Mode->isChecked());
|
m_fontEditor->setVisible(ui->actionEdit_Mode->isChecked());
|
||||||
|
if (ui->editModeTools)
|
||||||
ui->editModeTools->setVisible(false);
|
ui->editModeTools->setVisible(false);
|
||||||
m_textAlignmentEditor->setVisible(ui->actionEdit_Mode->isChecked());
|
m_textAlignmentEditor->setVisible(ui->actionEdit_Mode->isChecked());
|
||||||
switch (m_previewScaleType) {
|
switch (m_previewScaleType) {
|
||||||
@ -500,7 +535,7 @@ void PreviewReportWindow::on_actionShow_Toolbar_triggered()
|
|||||||
writeSetting();
|
writeSetting();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PreviewReportWindow::slotCurrentPageChanged(int page)
|
void PreviewReportWindow::slotCurrentPageChanged(int /*page*/)
|
||||||
{
|
{
|
||||||
slotActivateItemSelectionMode();
|
slotActivateItemSelectionMode();
|
||||||
}
|
}
|
||||||
@ -510,5 +545,27 @@ void PreviewReportWindow::slotItemInserted(PageDesignIntf *, QPointF, const QStr
|
|||||||
slotActivateItemSelectionMode();
|
slotActivateItemSelectionMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PreviewReportWindow::slotPrintingStarted(int pageCount)
|
||||||
|
{
|
||||||
|
m_progressBar->setMinimum(1);
|
||||||
|
m_progressBar->setMaximum(pageCount);
|
||||||
|
m_progressWidget->setVisible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void PreviewReportWindow::slotPagePrintingFinished(int pageIndex)
|
||||||
|
{
|
||||||
|
m_progressBar->setValue(pageIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
void PreviewReportWindow::slotPrintingFinished()
|
||||||
|
{
|
||||||
|
m_progressWidget->setVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void PreviewReportWindow::slotCancelPrinting(bool)
|
||||||
|
{
|
||||||
|
m_previewReportWidget->d_ptr->m_report->cancelPrinting();
|
||||||
|
}
|
||||||
|
|
||||||
}// namespace LimeReport
|
}// namespace LimeReport
|
||||||
|
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QEventLoop>
|
#include <QEventLoop>
|
||||||
#include <QPrinter>
|
#include <QPrinter>
|
||||||
|
#include <QProgressBar>
|
||||||
|
|
||||||
#include "serializators/lrxmlreader.h"
|
#include "serializators/lrxmlreader.h"
|
||||||
#include "lrpreparedpagesintf.h"
|
#include "lrpreparedpagesintf.h"
|
||||||
@ -118,6 +119,10 @@ private slots:
|
|||||||
void on_actionShow_Toolbar_triggered();
|
void on_actionShow_Toolbar_triggered();
|
||||||
void slotCurrentPageChanged(int page);
|
void slotCurrentPageChanged(int page);
|
||||||
void slotItemInserted(LimeReport::PageDesignIntf* report, QPointF pos, const QString& ItemType);
|
void slotItemInserted(LimeReport::PageDesignIntf* report, QPointF pos, const QString& ItemType);
|
||||||
|
void slotPrintingStarted(int pageCount);
|
||||||
|
void slotPagePrintingFinished(int pageIndex);
|
||||||
|
void slotPrintingFinished();
|
||||||
|
void slotCancelPrinting(bool);
|
||||||
signals:
|
signals:
|
||||||
void onSave(bool& saved, LimeReport::IPreparedPages* pages);
|
void onSave(bool& saved, LimeReport::IPreparedPages* pages);
|
||||||
private:
|
private:
|
||||||
@ -139,6 +144,8 @@ private:
|
|||||||
ScaleType m_previewScaleType;
|
ScaleType m_previewScaleType;
|
||||||
int m_previewScalePercent;
|
int m_previewScalePercent;
|
||||||
bool m_scalePercentChanging;
|
bool m_scalePercentChanging;
|
||||||
|
QProgressBar* m_progressBar;
|
||||||
|
QWidget* m_progressWidget;
|
||||||
};
|
};
|
||||||
} //namespace LimeReport
|
} //namespace LimeReport
|
||||||
#endif // LRPREVIEWREPORTWINDOW_H
|
#endif // LRPREVIEWREPORTWINDOW_H
|
||||||
|
@ -60,7 +60,7 @@
|
|||||||
<widget class="QStatusBar" name="statusbar"/>
|
<widget class="QStatusBar" name="statusbar"/>
|
||||||
<widget class="QToolBar" name="toolBar">
|
<widget class="QToolBar" name="toolBar">
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>toolBar</string>
|
<string>MainToolBar</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize">
|
<property name="iconSize">
|
||||||
<size>
|
<size>
|
||||||
@ -98,7 +98,7 @@
|
|||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>toolBar_2</string>
|
<string>EditModeTools</string>
|
||||||
</property>
|
</property>
|
||||||
<attribute name="toolBarArea">
|
<attribute name="toolBarArea">
|
||||||
<enum>LeftToolBarArea</enum>
|
<enum>LeftToolBarArea</enum>
|
||||||
|
@ -287,30 +287,31 @@ void ReportDesignWidget::loadState()
|
|||||||
applySettings();
|
applySettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PageView* ReportDesignWidget::createPageView(PageDesignIntf* page){
|
||||||
|
PageView* view = new PageView(this);
|
||||||
|
view->setBackgroundBrush(QBrush(Qt::gray));
|
||||||
|
view->setFrameShape(QFrame::NoFrame);
|
||||||
|
view->setScene(page);
|
||||||
|
view->setPageItem(page->pageItem());
|
||||||
|
view->scale(0.5, 0.5);
|
||||||
|
view->centerOn(0, 0);
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
void ReportDesignWidget::createTabs(){
|
void ReportDesignWidget::createTabs(){
|
||||||
m_tabWidget->clear();
|
m_tabWidget->clear();
|
||||||
int pageIndex = -1;
|
int pageIndex = -1;
|
||||||
|
|
||||||
for (int i = 0; i < m_report->pageCount(); ++i){
|
for (int i = 0; i < m_report->pageCount(); ++i){
|
||||||
PageView* view = new PageView(qobject_cast<QWidget*>(this));
|
PageDesignIntf* page = m_report->pageAt(i);
|
||||||
view->setBackgroundBrush(QBrush(Qt::gray));
|
page->clearSelection();
|
||||||
view->setFrameShape(QFrame::NoFrame);
|
connectPage(page);
|
||||||
view->setScene(m_report->pageAt(i));
|
PageView* view = createPageView(page);
|
||||||
view->setPageItem(m_report->pageAt(i)->pageItem());
|
int pageIndex = m_tabWidget->addTab(view, QIcon(), page->pageItem()->objectName());
|
||||||
|
|
||||||
m_report->pageAt(i)->clearSelection();
|
|
||||||
|
|
||||||
view->centerOn(0,0);
|
|
||||||
view->scale(0.5,0.5);
|
|
||||||
connectPage(m_report->pageAt(i));
|
|
||||||
pageIndex = m_tabWidget->addTab(view,QIcon(),m_report->pageAt(i)->pageItem()->objectName());
|
|
||||||
m_tabWidget->setTabWhatsThis(pageIndex, "page");
|
m_tabWidget->setTabWhatsThis(pageIndex, "page");
|
||||||
connect(m_report->pageAt(i)->pageItem(), SIGNAL(propertyObjectNameChanged(QString,QString)),
|
|
||||||
this, SLOT(slotPagePropertyObjectNameChanged(QString,QString)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_scriptEditor = new ScriptEditor(this);
|
m_scriptEditor = new ScriptEditor(this);
|
||||||
|
|
||||||
connect(m_scriptEditor, SIGNAL(textChanged()), this, SLOT(slotScriptTextChanged()));
|
connect(m_scriptEditor, SIGNAL(textChanged()), this, SLOT(slotScriptTextChanged()));
|
||||||
m_scriptEditor->setReportEngine(m_report);
|
m_scriptEditor->setReportEngine(m_report);
|
||||||
pageIndex = m_tabWidget->addTab(m_scriptEditor,QIcon(),tr("Script"));
|
pageIndex = m_tabWidget->addTab(m_scriptEditor,QIcon(),tr("Script"));
|
||||||
@ -359,25 +360,29 @@ QGraphicsView* ReportDesignWidget::activeView(){
|
|||||||
|
|
||||||
void ReportDesignWidget::connectPage(PageDesignIntf *page)
|
void ReportDesignWidget::connectPage(PageDesignIntf *page)
|
||||||
{
|
{
|
||||||
connect(page,SIGNAL(itemInserted(LimeReport::PageDesignIntf*,QPointF,QString)),this,SIGNAL(itemInserted(LimeReport::PageDesignIntf*,QPointF,QString)));
|
connect(page, SIGNAL(itemInserted(LimeReport::PageDesignIntf*, QPointF, QString)),
|
||||||
connect(page,SIGNAL(itemInsertCanceled(QString)),this,SIGNAL(itemInsertCanceled(QString)));
|
this, SIGNAL(itemInserted(LimeReport::PageDesignIntf*, QPointF, QString)));
|
||||||
connect(page,SIGNAL(itemPropertyChanged(QString,QString,QVariant,QVariant)),this,SIGNAL(itemPropertyChanged(QString,QString,QVariant,QVariant)));
|
connect(page, SIGNAL(itemInsertCanceled(QString)),this,SIGNAL(itemInsertCanceled(QString)));
|
||||||
connect(page,SIGNAL(selectionChanged()),this,SLOT(slotSelectionChanged()));
|
connect(page, SIGNAL(itemPropertyChanged(QString, QString, QVariant, QVariant)),
|
||||||
connect(page,SIGNAL(insertModeStarted()),this,SIGNAL(insertModeStarted()));
|
this, SIGNAL(itemPropertyChanged(QString, QString, QVariant, QVariant)));
|
||||||
connect(page,SIGNAL(commandHistoryChanged()),this,SIGNAL(commandHistoryChanged()));
|
connect(page, SIGNAL(itemPropertyObjectNameChanged(QString, QString)),
|
||||||
connect(page,SIGNAL(sceneRectChanged(QRectF)),this,SLOT(slotSceneRectChanged(QRectF)));
|
this, SLOT(slotItemPropertyObjectNameChanged(QString, QString)));
|
||||||
|
connect(page, SIGNAL(selectionChanged()), this, SLOT(slotSelectionChanged()));
|
||||||
connect(page,SIGNAL(itemAdded(LimeReport::PageDesignIntf*,LimeReport::BaseDesignIntf*)),
|
connect(page, SIGNAL(insertModeStarted()), this, SIGNAL(insertModeStarted()));
|
||||||
this, SIGNAL(itemAdded(LimeReport::PageDesignIntf*,LimeReport::BaseDesignIntf*)));
|
connect(page, SIGNAL(commandHistoryChanged()), this, SIGNAL(commandHistoryChanged()));
|
||||||
connect(page,SIGNAL(itemRemoved(LimeReport::PageDesignIntf*,LimeReport::BaseDesignIntf*)),
|
connect(page, SIGNAL(sceneRectChanged(QRectF)), this, SLOT(slotSceneRectChanged(QRectF)));
|
||||||
this,SIGNAL(itemDeleted(LimeReport::PageDesignIntf*,LimeReport::BaseDesignIntf*)));
|
connect(page, SIGNAL(itemAdded(LimeReport::PageDesignIntf*, LimeReport::BaseDesignIntf*)),
|
||||||
connect(page,SIGNAL(bandAdded(LimeReport::PageDesignIntf*,LimeReport::BandDesignIntf*)),
|
this, SIGNAL(itemAdded(LimeReport::PageDesignIntf*, LimeReport::BaseDesignIntf*)));
|
||||||
this, SIGNAL(bandAdded(LimeReport::PageDesignIntf*,LimeReport::BandDesignIntf*)));
|
connect(page, SIGNAL(itemRemoved(LimeReport::PageDesignIntf*, LimeReport::BaseDesignIntf*)),
|
||||||
connect(page, SIGNAL(bandRemoved(LimeReport::PageDesignIntf*,LimeReport::BandDesignIntf*)),
|
this, SIGNAL(itemDeleted(LimeReport::PageDesignIntf*, LimeReport::BaseDesignIntf*)));
|
||||||
this, SIGNAL(bandDeleted(LimeReport::PageDesignIntf*,LimeReport::BandDesignIntf*)));
|
connect(page, SIGNAL(bandAdded(LimeReport::PageDesignIntf*, LimeReport::BandDesignIntf*)),
|
||||||
|
this, SIGNAL(bandAdded(LimeReport::PageDesignIntf*, LimeReport::BandDesignIntf*)));
|
||||||
|
connect(page, SIGNAL(bandRemoved(LimeReport::PageDesignIntf*, LimeReport::BandDesignIntf*)),
|
||||||
|
this, SIGNAL(bandDeleted(LimeReport::PageDesignIntf*, LimeReport::BandDesignIntf*)));
|
||||||
connect(page, SIGNAL(pageUpdateFinished(LimeReport::PageDesignIntf*)),
|
connect(page, SIGNAL(pageUpdateFinished(LimeReport::PageDesignIntf*)),
|
||||||
this, SIGNAL(activePageUpdated(LimeReport::PageDesignIntf*)));
|
this, SIGNAL(activePageUpdated(LimeReport::PageDesignIntf*)));
|
||||||
|
connect(page->pageItem(), SIGNAL(propertyObjectNameChanged(QString, QString)),
|
||||||
|
this, SLOT(slotPagePropertyObjectNameChanged(QString, QString)));
|
||||||
emit activePageChanged();
|
emit activePageChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -721,7 +726,10 @@ void ReportDesignWidget::previewReport()
|
|||||||
#ifdef HAVE_QTDESIGNER_INTEGRATION
|
#ifdef HAVE_QTDESIGNER_INTEGRATION
|
||||||
updateDialogs();
|
updateDialogs();
|
||||||
#endif
|
#endif
|
||||||
|
bool showProgressDialog = report()->isShowProgressDialog();
|
||||||
|
report()->setShowProgressDialog(false);
|
||||||
report()->previewReport();
|
report()->previewReport();
|
||||||
|
report()->setShowProgressDialog(showProgressDialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReportDesignWidget::printReport()
|
void ReportDesignWidget::printReport()
|
||||||
@ -737,19 +745,13 @@ void ReportDesignWidget::printReport()
|
|||||||
|
|
||||||
void ReportDesignWidget::addPage()
|
void ReportDesignWidget::addPage()
|
||||||
{
|
{
|
||||||
QGraphicsView* view = new QGraphicsView(qobject_cast<QWidget*>(this));
|
|
||||||
view->setBackgroundBrush(QBrush(Qt::gray));
|
|
||||||
view->setFrameShape(QFrame::NoFrame);
|
|
||||||
PageDesignIntf* page = m_report->appendPage("page"+QString::number(m_report->pageCount()+1));
|
PageDesignIntf* page = m_report->appendPage("page"+QString::number(m_report->pageCount()+1));
|
||||||
view->setScene(page);
|
|
||||||
int index = m_report->pageCount()-1;
|
|
||||||
m_tabWidget->insertTab(index,view,QIcon(),page->pageItem()->objectName());
|
|
||||||
m_tabWidget->setCurrentIndex(index);
|
|
||||||
connect(page->pageItem(), SIGNAL(propertyObjectNameChanged(QString,QString)),
|
|
||||||
this, SLOT(slotPagePropertyObjectNameChanged(QString,QString)));
|
|
||||||
connectPage(page);
|
connectPage(page);
|
||||||
view->scale(0.5,0.5);
|
PageView* view = createPageView(page);
|
||||||
view->centerOn(0,0);
|
int index = m_report->pageCount()-1;
|
||||||
|
m_tabWidget->insertTab(index, view, QIcon(), page->pageItem()->objectName());
|
||||||
|
m_tabWidget->setTabWhatsThis(index, "page");
|
||||||
|
m_tabWidget->setCurrentIndex(index);
|
||||||
applyUseGrid();
|
applyUseGrid();
|
||||||
emit pageAdded(page);
|
emit pageAdded(page);
|
||||||
}
|
}
|
||||||
@ -821,9 +823,9 @@ void ReportDesignWidget::editSetting()
|
|||||||
|
|
||||||
void ReportDesignWidget::applyUseGrid()
|
void ReportDesignWidget::applyUseGrid()
|
||||||
{
|
{
|
||||||
int hGridStep = m_useGrid?m_horizontalGridStep:2;
|
int hGridStep = m_useGrid ? m_horizontalGridStep : Const::DEFAULT_GRID_STEP;
|
||||||
int vGridStep = m_useGrid?m_verticalGridStep:2;
|
int vGridStep = m_useGrid ? m_verticalGridStep : Const::DEFAULT_GRID_STEP;
|
||||||
for(int i=0;i<m_report->pageCount();++i){
|
for(int i = 0; i < m_report->pageCount(); ++i){
|
||||||
m_report->pageAt(i)->setVerticalGridStep(hGridStep);
|
m_report->pageAt(i)->setVerticalGridStep(hGridStep);
|
||||||
m_report->pageAt(i)->setHorizontalGridStep(vGridStep);
|
m_report->pageAt(i)->setHorizontalGridStep(vGridStep);
|
||||||
}
|
}
|
||||||
@ -968,6 +970,18 @@ void ReportDesignWidget::slotScriptTextChanged()
|
|||||||
m_report->scriptContext()->setInitScript(m_scriptEditor->toPlainText());
|
m_report->scriptContext()->setInitScript(m_scriptEditor->toPlainText());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ReportDesignWidget::slotItemPropertyObjectNameChanged(const QString& oldName, const QString& newName)
|
||||||
|
{
|
||||||
|
PageDesignIntf* page = qobject_cast<PageDesignIntf*>(sender());
|
||||||
|
if (page){
|
||||||
|
ITranslationContainer* tc = dynamic_cast<ITranslationContainer*>(report());
|
||||||
|
for (int i = 0; i < tc->translations()->values().count(); ++i){
|
||||||
|
PageTranslation* pt = tc->translations()->values().at(i)->findPageTranslation(page->pageItem()->objectName());
|
||||||
|
if (pt) pt->renameItem(oldName, newName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef HAVE_QTDESIGNER_INTEGRATION
|
#ifdef HAVE_QTDESIGNER_INTEGRATION
|
||||||
|
|
||||||
void ReportDesignWidget::addNewDialog()
|
void ReportDesignWidget::addNewDialog()
|
||||||
@ -999,6 +1013,11 @@ void ReportDesignWidget::slotDialogNameChanged(QString oldName, QString newName)
|
|||||||
|
|
||||||
void ReportDesignWidget::slotPagePropertyObjectNameChanged(const QString &oldValue, const QString &newValue)
|
void ReportDesignWidget::slotPagePropertyObjectNameChanged(const QString &oldValue, const QString &newValue)
|
||||||
{
|
{
|
||||||
|
ITranslationContainer* tc = dynamic_cast<ITranslationContainer*>(report());
|
||||||
|
foreach(ReportTranslation* translation, tc->translations()->values()){
|
||||||
|
translation->renamePage(oldValue, newValue);
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0; i < m_tabWidget->count(); ++i ){
|
for (int i = 0; i < m_tabWidget->count(); ++i ){
|
||||||
if (m_tabWidget->tabText(i).compare(oldValue) == 0){
|
if (m_tabWidget->tabText(i).compare(oldValue) == 0){
|
||||||
QGraphicsView* view = dynamic_cast<QGraphicsView*>(m_tabWidget->widget(i));
|
QGraphicsView* view = dynamic_cast<QGraphicsView*>(m_tabWidget->widget(i));
|
||||||
@ -1071,14 +1090,16 @@ bool PageView::viewportEvent(QEvent *event)
|
|||||||
{
|
{
|
||||||
switch (event->type()) {
|
switch (event->type()) {
|
||||||
case QEvent::MouseMove:
|
case QEvent::MouseMove:
|
||||||
|
if (m_horizontalRuller && m_verticalRuller){
|
||||||
m_horizontalRuller->setMousePos(dynamic_cast<QMouseEvent*>(event)->pos());
|
m_horizontalRuller->setMousePos(dynamic_cast<QMouseEvent*>(event)->pos());
|
||||||
m_verticalRuller->setMousePos(dynamic_cast<QMouseEvent*>(event)->pos());
|
m_verticalRuller->setMousePos(dynamic_cast<QMouseEvent*>(event)->pos());
|
||||||
m_horizontalRuller->update();
|
m_horizontalRuller->update();
|
||||||
m_verticalRuller->update();
|
m_verticalRuller->update();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
//case QEvent::Resize:
|
//case QEvent::Resize:
|
||||||
case QEvent::Paint:
|
case QEvent::Paint:
|
||||||
if (m_horizontalRuller){
|
if (m_horizontalRuller && m_verticalRuller){
|
||||||
int x = mapFromScene(m_pageItem->boundingRect().x(),m_pageItem->boundingRect().y()).x();
|
int x = mapFromScene(m_pageItem->boundingRect().x(),m_pageItem->boundingRect().y()).x();
|
||||||
int y = mapFromScene(m_pageItem->boundingRect().x(),m_pageItem->boundingRect().y()).y();
|
int y = mapFromScene(m_pageItem->boundingRect().x(),m_pageItem->boundingRect().y()).y();
|
||||||
int width = mapFromScene(m_pageItem->boundingRect().bottomRight().x(),m_pageItem->boundingRect().bottomRight().y()).x();
|
int width = mapFromScene(m_pageItem->boundingRect().bottomRight().x(),m_pageItem->boundingRect().bottomRight().y()).x();
|
||||||
|
@ -82,12 +82,12 @@ private:
|
|||||||
|
|
||||||
class PageView: public QGraphicsView{
|
class PageView: public QGraphicsView{
|
||||||
public:
|
public:
|
||||||
PageView(QWidget *parent = nullptr): QGraphicsView(parent),
|
PageView(QWidget *parent = NULL): QGraphicsView(parent),
|
||||||
m_horizontalRuller(0), m_verticalRuller(0)
|
m_horizontalRuller(0), m_verticalRuller(0)
|
||||||
{
|
{
|
||||||
setViewportMargins(20,20,0,0);
|
setViewportMargins(20,20,0,0);
|
||||||
}
|
}
|
||||||
PageView(QGraphicsScene *scene, QWidget *parent = nullptr):
|
PageView(QGraphicsScene *scene, QWidget *parent = NULL):
|
||||||
QGraphicsView(scene, parent),
|
QGraphicsView(scene, parent),
|
||||||
m_horizontalRuller(0), m_verticalRuller(0)
|
m_horizontalRuller(0), m_verticalRuller(0)
|
||||||
{
|
{
|
||||||
@ -216,6 +216,7 @@ private slots:
|
|||||||
void slotCurrentTabChanged(int index);
|
void slotCurrentTabChanged(int index);
|
||||||
void slotReportLoaded();
|
void slotReportLoaded();
|
||||||
void slotScriptTextChanged();
|
void slotScriptTextChanged();
|
||||||
|
void slotItemPropertyObjectNameChanged(const QString& oldName, const QString& newName);
|
||||||
#ifdef HAVE_QTDESIGNER_INTEGRATION
|
#ifdef HAVE_QTDESIGNER_INTEGRATION
|
||||||
void slotDialogChanged(QString);
|
void slotDialogChanged(QString);
|
||||||
void slotDialogNameChanged(QString oldName, QString newName);
|
void slotDialogNameChanged(QString oldName, QString newName);
|
||||||
@ -241,6 +242,7 @@ signals:
|
|||||||
void pageAdded(PageDesignIntf* page);
|
void pageAdded(PageDesignIntf* page);
|
||||||
void pageDeleted();
|
void pageDeleted();
|
||||||
protected:
|
protected:
|
||||||
|
PageView *createPageView(PageDesignIntf *page);
|
||||||
#ifdef HAVE_QTDESIGNER_INTEGRATION
|
#ifdef HAVE_QTDESIGNER_INTEGRATION
|
||||||
void createNewDialogTab(const QString& dialogName,const QByteArray& description);
|
void createNewDialogTab(const QString& dialogName,const QByteArray& description);
|
||||||
#endif
|
#endif
|
||||||
@ -275,6 +277,7 @@ private:
|
|||||||
QMap<QString, QString> m_themes;
|
QMap<QString, QString> m_themes;
|
||||||
QMap<QString, QString> m_localToEng;
|
QMap<QString, QString> m_localToEng;
|
||||||
BaseDesignIntf::UnitType m_defaultUnits;
|
BaseDesignIntf::UnitType m_defaultUnits;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace LimeReport
|
} // namespace LimeReport
|
||||||
|
@ -65,6 +65,38 @@ namespace LimeReport{
|
|||||||
|
|
||||||
ReportDesignWindow* ReportDesignWindow::m_instance=0;
|
ReportDesignWindow* ReportDesignWindow::m_instance=0;
|
||||||
|
|
||||||
|
void ReportDesignWindow::createProgressBar()
|
||||||
|
{
|
||||||
|
m_progressWidget = new QWidget(m_statusBar);
|
||||||
|
QHBoxLayout* progressLayout = new QHBoxLayout();
|
||||||
|
progressLayout->setMargin(0);
|
||||||
|
m_progressLabel = new QLabel(tr("Rendered %1 pages").arg(0));
|
||||||
|
progressLayout->addWidget(m_progressLabel);
|
||||||
|
m_progressBar = new QProgressBar(m_statusBar);
|
||||||
|
m_progressBar->setFormat("%v pages");
|
||||||
|
m_progressBar->setAlignment(Qt::AlignCenter);
|
||||||
|
m_progressBar->setMaximumWidth(100);
|
||||||
|
m_progressBar->setMaximumHeight(m_statusBar->fontMetrics().height());
|
||||||
|
m_progressBar->setMinimum(0);
|
||||||
|
m_progressBar->setMaximum(0);
|
||||||
|
m_progressBar->setTextVisible(true);
|
||||||
|
progressLayout->addWidget(m_progressBar);
|
||||||
|
QToolButton* tbCancel = new QToolButton();
|
||||||
|
tbCancel->setToolTip(tr("Cancel report rendering"));
|
||||||
|
tbCancel->setIcon(QIcon(":/report/images/closebox"));
|
||||||
|
tbCancel->setAutoRaise(true);
|
||||||
|
connect(tbCancel, SIGNAL(clicked(bool)), this, SLOT(slotCancelRendering(bool)));
|
||||||
|
progressLayout->addWidget(tbCancel);
|
||||||
|
progressLayout->setSizeConstraint(QLayout::SetFixedSize);
|
||||||
|
m_progressWidget->setLayout(progressLayout);
|
||||||
|
m_progressWidget->setVisible(false);
|
||||||
|
m_statusBar->addPermanentWidget(m_progressWidget);
|
||||||
|
|
||||||
|
connect(dynamic_cast<QObject*>(m_reportDesignWidget->report()), SIGNAL(renderStarted()), this, SLOT(renderStarted()));
|
||||||
|
connect(dynamic_cast<QObject*>(m_reportDesignWidget->report()), SIGNAL(renderPageFinished(int)), this, SLOT(renderPageFinished(int)));
|
||||||
|
connect(dynamic_cast<QObject*>(m_reportDesignWidget->report()), SIGNAL(renderFinished()), this, SLOT(renderFinished()));
|
||||||
|
}
|
||||||
|
|
||||||
ReportDesignWindow::ReportDesignWindow(ReportEnginePrivateInterface* report, QWidget *parent, QSettings* settings) :
|
ReportDesignWindow::ReportDesignWindow(ReportEnginePrivateInterface* report, QWidget *parent, QSettings* settings) :
|
||||||
ReportDesignWindowInterface(parent), m_textAttibutesIsChanging(false), m_settings(settings), m_ownedSettings(false),
|
ReportDesignWindowInterface(parent), m_textAttibutesIsChanging(false), m_settings(settings), m_ownedSettings(false),
|
||||||
m_progressDialog(0), m_showProgressDialog(true), m_editorTabType(ReportDesignWidget::Page), m_reportItemIsLocked(false)
|
m_progressDialog(0), m_showProgressDialog(true), m_editorTabType(ReportDesignWidget::Page), m_reportItemIsLocked(false)
|
||||||
@ -77,6 +109,7 @@ ReportDesignWindow::ReportDesignWindow(ReportEnginePrivateInterface* report, QWi
|
|||||||
createDataWindow();
|
createDataWindow();
|
||||||
createScriptWindow();
|
createScriptWindow();
|
||||||
createObjectsBrowser();
|
createObjectsBrowser();
|
||||||
|
|
||||||
#ifdef HAVE_QTDESIGNER_INTEGRATION
|
#ifdef HAVE_QTDESIGNER_INTEGRATION
|
||||||
createDialogWidgetBox();
|
createDialogWidgetBox();
|
||||||
createDialogPropertyEditor();
|
createDialogPropertyEditor();
|
||||||
@ -101,6 +134,7 @@ ReportDesignWindow::ReportDesignWindow(ReportEnginePrivateInterface* report, QWi
|
|||||||
restoreSetting();
|
restoreSetting();
|
||||||
m_hideLeftPanel->setChecked(isDockAreaVisible(Qt::LeftDockWidgetArea));
|
m_hideLeftPanel->setChecked(isDockAreaVisible(Qt::LeftDockWidgetArea));
|
||||||
m_hideRightPanel->setChecked(isDockAreaVisible(Qt::RightDockWidgetArea));
|
m_hideRightPanel->setChecked(isDockAreaVisible(Qt::RightDockWidgetArea));
|
||||||
|
createProgressBar();
|
||||||
}
|
}
|
||||||
|
|
||||||
ReportDesignWindow::~ReportDesignWindow()
|
ReportDesignWindow::~ReportDesignWindow()
|
||||||
@ -515,9 +549,6 @@ void ReportDesignWindow::initReportEditor(ReportEnginePrivateInterface* report)
|
|||||||
this, SLOT(slotBandAdded(LimeReport::PageDesignIntf*,LimeReport::BandDesignIntf*)));
|
this, SLOT(slotBandAdded(LimeReport::PageDesignIntf*,LimeReport::BandDesignIntf*)));
|
||||||
connect(m_reportDesignWidget, SIGNAL(bandDeleted(LimeReport::PageDesignIntf*,LimeReport::BandDesignIntf*)),
|
connect(m_reportDesignWidget, SIGNAL(bandDeleted(LimeReport::PageDesignIntf*,LimeReport::BandDesignIntf*)),
|
||||||
this, SLOT(slotBandDeleted(LimeReport::PageDesignIntf*,LimeReport::BandDesignIntf*)));
|
this, SLOT(slotBandDeleted(LimeReport::PageDesignIntf*,LimeReport::BandDesignIntf*)));
|
||||||
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(pageAdded(PageDesignIntf*)), this, SLOT(slotPageAdded(PageDesignIntf*)));
|
||||||
connect(m_reportDesignWidget, SIGNAL(pageDeleted()), this, SLOT(slotPageDeleted()));
|
connect(m_reportDesignWidget, SIGNAL(pageDeleted()), this, SLOT(slotPageDeleted()));
|
||||||
}
|
}
|
||||||
@ -1377,26 +1408,17 @@ void ReportDesignWindow::slotActivePageChanged()
|
|||||||
|
|
||||||
void ReportDesignWindow::renderStarted()
|
void ReportDesignWindow::renderStarted()
|
||||||
{
|
{
|
||||||
if (m_showProgressDialog){
|
m_progressWidget->setVisible(true);
|
||||||
m_progressDialog = new QProgressDialog(tr("Rendering report"),tr("Abort"),0,0,this);
|
|
||||||
m_progressDialog->open(dynamic_cast<QObject*>(m_reportDesignWidget->report()), SLOT(cancelRender()));
|
|
||||||
QApplication::processEvents();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReportDesignWindow::renderPageFinished(int renderedPageCount)
|
void ReportDesignWindow::renderPageFinished(int renderedPageCount)
|
||||||
{
|
{
|
||||||
if (m_progressDialog)
|
m_progressLabel->setText(tr("Rendered %1 pages").arg(renderedPageCount));
|
||||||
m_progressDialog->setLabelText(QString::number(renderedPageCount)+tr(" page rendered"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReportDesignWindow::renderFinished()
|
void ReportDesignWindow::renderFinished()
|
||||||
{
|
{
|
||||||
if (m_progressDialog){
|
m_progressWidget->setVisible(false);
|
||||||
m_progressDialog->close();
|
|
||||||
delete m_progressDialog;
|
|
||||||
}
|
|
||||||
m_progressDialog = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReportDesignWindow::slotShowAbout()
|
void ReportDesignWindow::slotShowAbout()
|
||||||
@ -1536,8 +1558,18 @@ void ReportDesignWindow::slotSelectOneLevelItems()
|
|||||||
m_reportDesignWidget->selectOneLevelItems();
|
m_reportDesignWidget->selectOneLevelItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ReportDesignWindow::slotCancelRendering(bool)
|
||||||
|
{
|
||||||
|
m_reportDesignWidget->report()->cancelRender();
|
||||||
|
}
|
||||||
|
|
||||||
void ReportDesignWindow::closeEvent(QCloseEvent * event)
|
void ReportDesignWindow::closeEvent(QCloseEvent * event)
|
||||||
{
|
{
|
||||||
|
if (m_progressWidget->isVisible()){
|
||||||
|
QMessageBox::critical(this, tr("Attention"), tr("The rendering is in process"));
|
||||||
|
event->ignore();
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (checkNeedToSave()){
|
if (checkNeedToSave()){
|
||||||
m_dataBrowser->closeAllDataWindows();
|
m_dataBrowser->closeAllDataWindows();
|
||||||
writeState();
|
writeState();
|
||||||
|
@ -128,6 +128,8 @@ private slots:
|
|||||||
void slotLockSelectedItems();
|
void slotLockSelectedItems();
|
||||||
void slotUnlockSelectedItems();
|
void slotUnlockSelectedItems();
|
||||||
void slotSelectOneLevelItems();
|
void slotSelectOneLevelItems();
|
||||||
|
void slotCancelRendering(bool);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void closeEvent(QCloseEvent *event);
|
void closeEvent(QCloseEvent *event);
|
||||||
void resizeEvent(QResizeEvent *);
|
void resizeEvent(QResizeEvent *);
|
||||||
@ -281,6 +283,12 @@ private:
|
|||||||
QMap<QDockWidget*, bool> m_leftDocVisibleState;
|
QMap<QDockWidget*, bool> m_leftDocVisibleState;
|
||||||
QMap<QDockWidget*, bool> m_rightDocVisibleState;
|
QMap<QDockWidget*, bool> m_rightDocVisibleState;
|
||||||
QSortFilterProxyModel* m_filterModel;
|
QSortFilterProxyModel* m_filterModel;
|
||||||
|
|
||||||
|
QWidget* m_progressWidget;
|
||||||
|
QProgressBar* m_progressBar;
|
||||||
|
QLabel* m_progressLabel;
|
||||||
|
|
||||||
|
void createProgressBar();
|
||||||
};
|
};
|
||||||
|
|
||||||
class ObjectNameValidator : public ValidatorIntf{
|
class ObjectNameValidator : public ValidatorIntf{
|
||||||
|
@ -224,9 +224,11 @@ void ReportEnginePrivate::showError(QString message)
|
|||||||
void ReportEnginePrivate::updateTranslations()
|
void ReportEnginePrivate::updateTranslations()
|
||||||
{
|
{
|
||||||
foreach(ReportTranslation* translation, m_translations.values()){
|
foreach(ReportTranslation* translation, m_translations.values()){
|
||||||
|
translation->invalidatePages();
|
||||||
foreach(PageDesignIntf* page, m_pages){
|
foreach(PageDesignIntf* page, m_pages){
|
||||||
translation->updatePageTranslation(page);
|
translation->updatePageTranslation(page);
|
||||||
}
|
}
|
||||||
|
translation->clearInvalidPages();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -262,63 +264,80 @@ void ReportEnginePrivate::clearReport()
|
|||||||
emit cleared();
|
emit cleared();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReportEnginePrivate::printReport(ItemsReaderIntf::Ptr reader, QPrinter& printer)
|
bool ReportEnginePrivate::printPages(ReportPages pages, QPrinter *printer)
|
||||||
{
|
{
|
||||||
LimeReport::PageDesignIntf renderPage;
|
if (!printer&&!m_printerSelected){
|
||||||
renderPage.setItemMode(PrintMode);
|
QPrinterInfo pi;
|
||||||
if (reader->first()){
|
if (!pi.defaultPrinter().isNull())
|
||||||
reader->readItem(renderPage.pageItem());
|
#ifdef HAVE_QT4
|
||||||
printer.setFullPage(renderPage.pageItem()->fullPage());
|
m_printer.data()->setPrinterName(pi.defaultPrinter().printerName());
|
||||||
printer.setOrientation((QPrinter::Orientation)renderPage.pageItem()->pageOrientation());
|
#endif
|
||||||
renderPage.setSceneRect(renderPage.pageItem()->mapToScene(renderPage.pageItem()->rect()).boundingRect());
|
#ifdef HAVE_QT5
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 3, 0))
|
||||||
if (renderPage.pageItem()->pageSize()==PageItemDesignIntf::Custom){
|
m_printer.data()->setPrinterName(pi.defaultPrinterName());
|
||||||
QSizeF pageSize = (renderPage.pageItem()->pageOrientation()==PageItemDesignIntf::Landscape)?
|
#else
|
||||||
QSizeF(renderPage.pageItem()->sizeMM().height(),renderPage.pageItem()->sizeMM().width()):
|
m_printer.data()->setPrinterName(pi.defaultPrinter().printerName());
|
||||||
renderPage.pageItem()->sizeMM();
|
#endif
|
||||||
printer.setPaperSize(pageSize,QPrinter::Millimeter);
|
#endif
|
||||||
} else {
|
QPrintDialog dialog(m_printer.data(),QApplication::activeWindow());
|
||||||
printer.setPaperSize((QPrinter::PageSize)renderPage.pageItem()->pageSize());
|
m_printerSelected = dialog.exec()!=QDialog::Rejected;
|
||||||
}
|
}
|
||||||
|
if (!printer&&!m_printerSelected) return false;
|
||||||
|
|
||||||
QPainter painter(&printer);
|
printer =(printer)?printer:m_printer.data();
|
||||||
renderPage.render(&painter);
|
if (printer&&printer->isValid()){
|
||||||
|
try{
|
||||||
while (reader->next()){
|
if (pages.count()>0){
|
||||||
printer.newPage();
|
internalPrintPages(
|
||||||
renderPage.removeAllItems();
|
pages,
|
||||||
reader->readItem(renderPage.pageItem());
|
*printer
|
||||||
renderPage.setSceneRect(renderPage.pageItem()->mapToScene(renderPage.pageItem()->rect()).boundingRect());
|
);
|
||||||
renderPage.render(&painter);
|
|
||||||
}
|
}
|
||||||
|
} catch(ReportError &exception){
|
||||||
|
saveError(exception.what());
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
|
} else return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReportEnginePrivate::printReport(ReportPages pages, QPrinter &printer)
|
void ReportEnginePrivate::internalPrintPages(ReportPages pages, QPrinter &printer)
|
||||||
{
|
{
|
||||||
int currenPage = 1;
|
int currenPage = 1;
|
||||||
QMap<QString, QSharedPointer<PrintProcessor>> printProcessors;
|
m_cancelPrinting = false;
|
||||||
|
QMap<QString, QSharedPointer<PrintProcessor> > printProcessors;
|
||||||
printProcessors.insert("default",QSharedPointer<PrintProcessor>(new PrintProcessor(&printer)));
|
printProcessors.insert("default",QSharedPointer<PrintProcessor>(new PrintProcessor(&printer)));
|
||||||
|
|
||||||
|
int pageCount = (printer.printRange() == QPrinter::AllPages) ?
|
||||||
|
pages.size() :
|
||||||
|
printer.toPage() - printer.fromPage();
|
||||||
|
|
||||||
|
emit printingStarted(pageCount);
|
||||||
foreach(PageItemDesignIntf::Ptr page, pages){
|
foreach(PageItemDesignIntf::Ptr page, pages){
|
||||||
if (
|
if ( !m_cancelPrinting &&
|
||||||
(printer.printRange() == QPrinter::AllPages) ||
|
((printer.printRange() == QPrinter::AllPages) ||
|
||||||
( (printer.printRange()==QPrinter::PageRange) &&
|
( (printer.printRange()==QPrinter::PageRange) &&
|
||||||
(currenPage>=printer.fromPage()) &&
|
(currenPage>=printer.fromPage()) &&
|
||||||
(currenPage<=printer.toPage())
|
(currenPage<=printer.toPage())
|
||||||
)
|
))
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
printProcessors["default"]->printPage(page);
|
printProcessors["default"]->printPage(page);
|
||||||
}
|
|
||||||
currenPage++;
|
currenPage++;
|
||||||
|
emit pagePrintingFinished(currenPage);
|
||||||
|
QApplication::processEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
emit printingFinished();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReportEnginePrivate::printReport(ReportPages pages, QMap<QString, QPrinter*> printers, bool printToAllPrinters)
|
void ReportEnginePrivate::printPages(ReportPages pages, QMap<QString, QPrinter*> printers, bool printToAllPrinters)
|
||||||
{
|
{
|
||||||
if (printers.values().isEmpty()) return;
|
if (printers.values().isEmpty()) return;
|
||||||
int currenPage = 1;
|
m_cancelPrinting = false;
|
||||||
QMap<QString, QSharedPointer<PrintProcessor>> printProcessors;
|
|
||||||
|
QMap<QString, QSharedPointer<PrintProcessor> > printProcessors;
|
||||||
for (int i = 0; i < printers.keys().count(); ++i) {
|
for (int i = 0; i < printers.keys().count(); ++i) {
|
||||||
printProcessors.insert(printers.keys()[i],QSharedPointer<PrintProcessor>(new PrintProcessor(printers[printers.keys()[i]])));
|
printProcessors.insert(printers.keys()[i],QSharedPointer<PrintProcessor>(new PrintProcessor(printers[printers.keys()[i]])));
|
||||||
}
|
}
|
||||||
@ -327,7 +346,12 @@ void ReportEnginePrivate::printReport(ReportPages pages, QMap<QString, QPrinter*
|
|||||||
int currentPrinter = 0;
|
int currentPrinter = 0;
|
||||||
if (printProcessors.contains("default")) defaultProcessor = printProcessors["default"].data();
|
if (printProcessors.contains("default")) defaultProcessor = printProcessors["default"].data();
|
||||||
else defaultProcessor = printProcessors.values().at(0).data();
|
else defaultProcessor = printProcessors.values().at(0).data();
|
||||||
foreach(PageItemDesignIntf::Ptr page, pages){
|
|
||||||
|
emit printingStarted(pages.size());
|
||||||
|
|
||||||
|
for(int i = 0; i < pages.size(); ++i){
|
||||||
|
if (m_cancelPrinting) break;
|
||||||
|
PageItemDesignIntf::Ptr page = pages.at(i);
|
||||||
if (!printToAllPrinters){
|
if (!printToAllPrinters){
|
||||||
if (printProcessors.contains(page->printerName()))
|
if (printProcessors.contains(page->printerName()))
|
||||||
printProcessors[page->printerName()]->printPage(page);
|
printProcessors[page->printerName()]->printPage(page);
|
||||||
@ -338,9 +362,11 @@ void ReportEnginePrivate::printReport(ReportPages pages, QMap<QString, QPrinter*
|
|||||||
currentPrinter++;
|
currentPrinter++;
|
||||||
else currentPrinter = 0;
|
else currentPrinter = 0;
|
||||||
}
|
}
|
||||||
|
emit pagePrintingFinished(i+1);
|
||||||
currenPage++;
|
QApplication::processEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
emit printingFinished();
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList ReportEnginePrivate::aviableReportTranslations()
|
QStringList ReportEnginePrivate::aviableReportTranslations()
|
||||||
@ -389,7 +415,7 @@ bool ReportEnginePrivate::printReport(QPrinter* printer)
|
|||||||
ReportPages pages = renderToPages();
|
ReportPages pages = renderToPages();
|
||||||
dataManager()->setDesignTime(designTime);
|
dataManager()->setDesignTime(designTime);
|
||||||
if (pages.count()>0){
|
if (pages.count()>0){
|
||||||
printReport(pages,*printer);
|
internalPrintPages(pages, *printer);
|
||||||
}
|
}
|
||||||
} catch(ReportError &exception){
|
} catch(ReportError &exception){
|
||||||
saveError(exception.what());
|
saveError(exception.what());
|
||||||
@ -406,7 +432,7 @@ bool ReportEnginePrivate::printReport(QMap<QString, QPrinter*> printers, bool pr
|
|||||||
ReportPages pages = renderToPages();
|
ReportPages pages = renderToPages();
|
||||||
dataManager()->setDesignTime(designTime);
|
dataManager()->setDesignTime(designTime);
|
||||||
if (pages.count()>0){
|
if (pages.count()>0){
|
||||||
printReport(pages, printers, printToAllPrinters);
|
printPages(pages, printers, printToAllPrinters);
|
||||||
}
|
}
|
||||||
} catch(ReportError &exception){
|
} catch(ReportError &exception){
|
||||||
saveError(exception.what());
|
saveError(exception.what());
|
||||||
@ -415,42 +441,6 @@ bool ReportEnginePrivate::printReport(QMap<QString, QPrinter*> printers, bool pr
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ReportEnginePrivate::printPages(ReportPages pages, QPrinter *printer)
|
|
||||||
{
|
|
||||||
if (!printer&&!m_printerSelected){
|
|
||||||
QPrinterInfo pi;
|
|
||||||
if (!pi.defaultPrinter().isNull())
|
|
||||||
#ifdef HAVE_QT4
|
|
||||||
m_printer.data()->setPrinterName(pi.defaultPrinter().printerName());
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_QT5
|
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 3, 0))
|
|
||||||
m_printer.data()->setPrinterName(pi.defaultPrinterName());
|
|
||||||
#else
|
|
||||||
m_printer.data()->setPrinterName(pi.defaultPrinter().printerName());
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
QPrintDialog dialog(m_printer.data(),QApplication::activeWindow());
|
|
||||||
m_printerSelected = dialog.exec()!=QDialog::Rejected;
|
|
||||||
}
|
|
||||||
if (!printer&&!m_printerSelected) return false;
|
|
||||||
|
|
||||||
printer =(printer)?printer:m_printer.data();
|
|
||||||
if (printer&&printer->isValid()){
|
|
||||||
try{
|
|
||||||
if (pages.count()>0){
|
|
||||||
printReport(
|
|
||||||
pages,
|
|
||||||
*printer
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} catch(ReportError &exception){
|
|
||||||
saveError(exception.what());
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
} else return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ReportEnginePrivate::printToFile(const QString &fileName)
|
void ReportEnginePrivate::printToFile(const QString &fileName)
|
||||||
{
|
{
|
||||||
if (!fileName.isEmpty()){
|
if (!fileName.isEmpty()){
|
||||||
@ -500,7 +490,7 @@ bool ReportEnginePrivate::exportReport(QString exporterName, const QString &file
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ReportEnginePrivate::showPreviewWindow(ReportPages pages, PreviewHints hints)
|
bool ReportEnginePrivate::showPreviewWindow(ReportPages pages, PreviewHints hints, QPrinter* printer)
|
||||||
{
|
{
|
||||||
if (pages.count()>0){
|
if (pages.count()>0){
|
||||||
Q_Q(ReportEngine);
|
Q_Q(ReportEngine);
|
||||||
@ -515,6 +505,7 @@ bool ReportEnginePrivate::showPreviewWindow(ReportPages pages, PreviewHints hint
|
|||||||
w->setPages(pages);
|
w->setPages(pages);
|
||||||
w->setLayoutDirection(m_previewLayoutDirection);
|
w->setLayoutDirection(m_previewLayoutDirection);
|
||||||
w->setStyleSheet(styleSheet());
|
w->setStyleSheet(styleSheet());
|
||||||
|
// w->setDefaultPrinter()
|
||||||
|
|
||||||
if (!dataManager()->errorsList().isEmpty()){
|
if (!dataManager()->errorsList().isEmpty()){
|
||||||
w->setErrorMessages(dataManager()->errorsList());
|
w->setErrorMessages(dataManager()->errorsList());
|
||||||
@ -550,14 +541,13 @@ void ReportEnginePrivate::previewReport(PreviewHints hints)
|
|||||||
previewReport(0, hints);
|
previewReport(0, hints);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReportEnginePrivate::previewReport(QPrinter *printer, PreviewHints hints)
|
void ReportEnginePrivate::previewReport(QPrinter* printer, PreviewHints hints)
|
||||||
{
|
{
|
||||||
// QTime start = QTime::currentTime();
|
|
||||||
try{
|
try{
|
||||||
dataManager()->setDesignTime(false);
|
dataManager()->setDesignTime(false);
|
||||||
ReportPages pages = renderToPages();
|
ReportPages pages = renderToPages();
|
||||||
dataManager()->setDesignTime(true);
|
dataManager()->setDesignTime(true);
|
||||||
showPreviewWindow(pages, hints);
|
showPreviewWindow(pages, hints, printer);
|
||||||
} catch (ReportError &exception){
|
} catch (ReportError &exception){
|
||||||
saveError(exception.what());
|
saveError(exception.what());
|
||||||
showError(exception.what());
|
showError(exception.what());
|
||||||
@ -723,7 +713,7 @@ bool ReportEnginePrivate::slotLoadFromFile(const QString &fileName)
|
|||||||
}
|
}
|
||||||
EASY_END_BLOCK;
|
EASY_END_BLOCK;
|
||||||
return true;
|
return true;
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
m_lastError = reader->lastError();
|
m_lastError = reader->lastError();
|
||||||
EASY_END_BLOCK;
|
EASY_END_BLOCK;
|
||||||
@ -737,6 +727,11 @@ void ReportEnginePrivate::cancelRender()
|
|||||||
m_reportRendering = false;
|
m_reportRendering = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ReportEnginePrivate::cancelPrinting()
|
||||||
|
{
|
||||||
|
m_cancelPrinting = true;
|
||||||
|
}
|
||||||
|
|
||||||
QGraphicsScene* ReportEngine::createPreviewScene(QObject* parent){
|
QGraphicsScene* ReportEngine::createPreviewScene(QObject* parent){
|
||||||
Q_D(ReportEngine);
|
Q_D(ReportEngine);
|
||||||
return d->createPreviewScene(parent);
|
return d->createPreviewScene(parent);
|
||||||
@ -980,7 +975,12 @@ IPreparedPages *ReportEnginePrivate::preparedPages(){
|
|||||||
|
|
||||||
bool ReportEnginePrivate::showPreparedPages(PreviewHints hints)
|
bool ReportEnginePrivate::showPreparedPages(PreviewHints hints)
|
||||||
{
|
{
|
||||||
return showPreviewWindow(m_preparedPages, hints);
|
return showPreparedPages(0, hints);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ReportEnginePrivate::showPreparedPages(QPrinter* defaultPrinter, PreviewHints hints)
|
||||||
|
{
|
||||||
|
return showPreviewWindow(m_preparedPages, hints, defaultPrinter);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ReportEnginePrivate::prepareReportPages()
|
bool ReportEnginePrivate::prepareReportPages()
|
||||||
@ -1380,6 +1380,12 @@ ReportEngine::ReportEngine(QObject *parent)
|
|||||||
connect(d, SIGNAL(renderPageFinished(int)),
|
connect(d, SIGNAL(renderPageFinished(int)),
|
||||||
this, SIGNAL(renderPageFinished(int)));
|
this, SIGNAL(renderPageFinished(int)));
|
||||||
connect(d, SIGNAL(renderFinished()), this, SIGNAL(renderFinished()));
|
connect(d, SIGNAL(renderFinished()), this, SIGNAL(renderFinished()));
|
||||||
|
|
||||||
|
connect(d, SIGNAL(printingStarted(int)), this, SIGNAL(printingStarted(int)));
|
||||||
|
connect(d, SIGNAL(pagePrintingFinished(int)),
|
||||||
|
this, SIGNAL(pagePrintingFinished(int)));
|
||||||
|
connect(d, SIGNAL(printingFinished()), this, SIGNAL(printingFinished()));
|
||||||
|
|
||||||
connect(d, SIGNAL(onSave(bool&)), this, SIGNAL(onSave(bool&)));
|
connect(d, SIGNAL(onSave(bool&)), this, SIGNAL(onSave(bool&)));
|
||||||
connect(d, SIGNAL(onSaveAs(bool&)), this, SIGNAL(onSaveAs(bool&)));
|
connect(d, SIGNAL(onSaveAs(bool&)), this, SIGNAL(onSaveAs(bool&)));
|
||||||
connect(d, SIGNAL(onLoad(bool&)), this, SIGNAL(onLoad(bool&)));
|
connect(d, SIGNAL(onLoad(bool&)), this, SIGNAL(onLoad(bool&)));
|
||||||
@ -1651,6 +1657,12 @@ void ReportEngine::setShowProgressDialog(bool value)
|
|||||||
d->setShowProgressDialog(value);
|
d->setShowProgressDialog(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ReportEngine::isShowProgressDialog()
|
||||||
|
{
|
||||||
|
Q_D(ReportEngine);
|
||||||
|
return d->isShowProgressDialog();
|
||||||
|
}
|
||||||
|
|
||||||
IDataSourceManager *ReportEngine::dataManager()
|
IDataSourceManager *ReportEngine::dataManager()
|
||||||
{
|
{
|
||||||
Q_D(ReportEngine);
|
Q_D(ReportEngine);
|
||||||
@ -1740,6 +1752,12 @@ void ReportEngine::cancelRender()
|
|||||||
d->cancelRender();
|
d->cancelRender();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ReportEngine::cancelPrinting()
|
||||||
|
{
|
||||||
|
Q_D(ReportEngine);
|
||||||
|
d->cancelPrinting();
|
||||||
|
}
|
||||||
|
|
||||||
ReportEngine::ReportEngine(ReportEnginePrivate &dd, QObject *parent)
|
ReportEngine::ReportEngine(ReportEnginePrivate &dd, QObject *parent)
|
||||||
:QObject(parent),d_ptr(&dd)
|
:QObject(parent),d_ptr(&dd)
|
||||||
{
|
{
|
||||||
@ -1759,21 +1777,22 @@ ScriptEngineManager*LimeReport::ReportEnginePrivate::scriptManager(){
|
|||||||
|
|
||||||
PrintProcessor::PrintProcessor(QPrinter* printer)
|
PrintProcessor::PrintProcessor(QPrinter* printer)
|
||||||
: m_printer(printer), m_painter(0), m_firstPage(true)
|
: m_printer(printer), m_painter(0), m_firstPage(true)
|
||||||
{}
|
{m_renderPage.setItemMode(PrintMode);}
|
||||||
|
|
||||||
|
|
||||||
bool PrintProcessor::printPage(PageItemDesignIntf::Ptr page)
|
bool PrintProcessor::printPage(PageItemDesignIntf::Ptr page)
|
||||||
{
|
{
|
||||||
if (!m_firstPage && !m_painter->isActive()) return false;
|
if (!m_firstPage && !m_painter->isActive()) return false;
|
||||||
|
PageDesignIntf* backupPage = dynamic_cast<PageDesignIntf*>(page->scene());
|
||||||
|
|
||||||
LimeReport::PageDesignIntf renderPage;
|
//LimeReport::PageDesignIntf m_renderPage;
|
||||||
renderPage.setItemMode(PrintMode);
|
//m_renderPage.setItemMode(PrintMode);
|
||||||
|
|
||||||
QPointF backupPagePos = page->pos();
|
QPointF backupPagePos = page->pos();
|
||||||
page->setPos(0,0);
|
page->setPos(0,0);
|
||||||
renderPage.setPageItem(page);
|
m_renderPage.setPageItem(page);
|
||||||
renderPage.setSceneRect(renderPage.pageItem()->mapToScene(renderPage.pageItem()->rect()).boundingRect());
|
m_renderPage.setSceneRect(m_renderPage.pageItem()->mapToScene(m_renderPage.pageItem()->rect()).boundingRect());
|
||||||
initPrinter(renderPage.pageItem());
|
initPrinter(m_renderPage.pageItem());
|
||||||
|
|
||||||
if (!m_firstPage){
|
if (!m_firstPage){
|
||||||
m_printer->newPage();
|
m_printer->newPage();
|
||||||
@ -1802,7 +1821,7 @@ bool PrintProcessor::printPage(PageItemDesignIntf::Ptr page)
|
|||||||
while (pageHeight > 0){
|
while (pageHeight > 0){
|
||||||
while (curWidth < pageWidth){
|
while (curWidth < pageWidth){
|
||||||
if (!first) m_printer->newPage(); else first = false;
|
if (!first) m_printer->newPage(); else first = false;
|
||||||
renderPage.render(m_painter, m_printer->pageRect(), currentPrintingRect);
|
m_renderPage.render(m_painter, m_printer->pageRect(), currentPrintingRect);
|
||||||
currentPrintingRect.adjust(printerPageRect.size().width(), 0, printerPageRect.size().width(), 0);
|
currentPrintingRect.adjust(printerPageRect.size().width(), 0, printerPageRect.size().width(), 0);
|
||||||
curWidth += printerPageRect.size().width();
|
curWidth += printerPageRect.size().width();
|
||||||
|
|
||||||
@ -1815,9 +1834,11 @@ bool PrintProcessor::printPage(PageItemDesignIntf::Ptr page)
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
renderPage.render(m_painter);
|
m_renderPage.render(m_painter);
|
||||||
}
|
}
|
||||||
page->setPos(backupPagePos);
|
page->setPos(backupPagePos);
|
||||||
|
m_renderPage.removePageItem(page);
|
||||||
|
if (backupPage) backupPage->reactivatePageItem(page);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,6 +164,7 @@ public:
|
|||||||
void designReport();
|
void designReport();
|
||||||
ReportDesignWindowInterface* getDesignerWindow();
|
ReportDesignWindowInterface* getDesignerWindow();
|
||||||
void setShowProgressDialog(bool value);
|
void setShowProgressDialog(bool value);
|
||||||
|
bool isShowProgressDialog();
|
||||||
IDataSourceManager* dataManager();
|
IDataSourceManager* dataManager();
|
||||||
IScriptEngineManager* scriptManager();
|
IScriptEngineManager* scriptManager();
|
||||||
bool loadFromFile(const QString& fileName, bool autoLoadPreviewOnChange = false);
|
bool loadFromFile(const QString& fileName, bool autoLoadPreviewOnChange = false);
|
||||||
@ -212,6 +213,11 @@ signals:
|
|||||||
void renderStarted();
|
void renderStarted();
|
||||||
void renderFinished();
|
void renderFinished();
|
||||||
void renderPageFinished(int renderedPageCount);
|
void renderPageFinished(int renderedPageCount);
|
||||||
|
|
||||||
|
void printingStarted(int pageCount);
|
||||||
|
void printingFinished();
|
||||||
|
void pagePrintingFinished(int index);
|
||||||
|
|
||||||
void onSave(bool& saved);
|
void onSave(bool& saved);
|
||||||
void onSaveAs(bool& saved);
|
void onSaveAs(bool& saved);
|
||||||
void onLoad(bool& loaded);
|
void onLoad(bool& loaded);
|
||||||
@ -228,6 +234,7 @@ signals:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void cancelRender();
|
void cancelRender();
|
||||||
|
void cancelPrinting();
|
||||||
protected:
|
protected:
|
||||||
ReportEnginePrivate * const d_ptr;
|
ReportEnginePrivate * const d_ptr;
|
||||||
ReportEngine(ReportEnginePrivate &dd, QObject * parent=0);
|
ReportEngine(ReportEnginePrivate &dd, QObject * parent=0);
|
||||||
|
@ -110,6 +110,9 @@ public:
|
|||||||
virtual QList<QLocale::Language> designerLanguages() = 0;
|
virtual QList<QLocale::Language> designerLanguages() = 0;
|
||||||
virtual QLocale::Language currentDesignerLanguage() = 0;
|
virtual QLocale::Language currentDesignerLanguage() = 0;
|
||||||
virtual void setCurrentDesignerLanguage(QLocale::Language language) = 0;
|
virtual void setCurrentDesignerLanguage(QLocale::Language language) = 0;
|
||||||
|
virtual void cancelRender() = 0;
|
||||||
|
virtual void setShowProgressDialog(bool value) = 0;
|
||||||
|
virtual bool isShowProgressDialog() const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class PrintProcessor{
|
class PrintProcessor{
|
||||||
@ -122,6 +125,7 @@ private:
|
|||||||
private:
|
private:
|
||||||
QPrinter* m_printer;
|
QPrinter* m_printer;
|
||||||
QPainter* m_painter;
|
QPainter* m_painter;
|
||||||
|
LimeReport::PageDesignIntf m_renderPage;
|
||||||
bool m_firstPage;
|
bool m_firstPage;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -141,9 +145,8 @@ class ReportEnginePrivate : public QObject,
|
|||||||
|
|
||||||
friend class PreviewReportWidget;
|
friend class PreviewReportWidget;
|
||||||
public:
|
public:
|
||||||
static void printReport(ItemsReaderIntf::Ptr reader, QPrinter &printer);
|
bool printPages(ReportPages pages, QPrinter *printer);
|
||||||
static void printReport(ReportPages pages, QPrinter &printer);
|
void printPages(ReportPages pages, QMap<QString,QPrinter*>printers, bool printToAllPrinters = false);
|
||||||
static void printReport(ReportPages pages, QMap<QString,QPrinter*>printers, bool printToAllPrinters = false);
|
|
||||||
Q_INVOKABLE QStringList aviableReportTranslations();
|
Q_INVOKABLE QStringList aviableReportTranslations();
|
||||||
Q_INVOKABLE void setReportTranslation(const QString& languageName);
|
Q_INVOKABLE void setReportTranslation(const QString& languageName);
|
||||||
public:
|
public:
|
||||||
@ -168,7 +171,7 @@ public:
|
|||||||
void clearReport();
|
void clearReport();
|
||||||
bool printReport(QPrinter* printer=0);
|
bool printReport(QPrinter* printer=0);
|
||||||
bool printReport(QMap<QString, QPrinter*>printers, bool printToAllPrinters);
|
bool printReport(QMap<QString, QPrinter*>printers, bool printToAllPrinters);
|
||||||
bool printPages(ReportPages pages, QPrinter *printer);
|
|
||||||
void printToFile(const QString& fileName);
|
void printToFile(const QString& fileName);
|
||||||
bool printToPDF(const QString& fileName);
|
bool printToPDF(const QString& fileName);
|
||||||
bool exportReport(QString exporterName, const QString &fileName = "", const QMap<QString, QVariant>& params = QMap<QString, QVariant>());
|
bool exportReport(QString exporterName, const QString &fileName = "", const QMap<QString, QVariant>& params = QMap<QString, QVariant>());
|
||||||
@ -179,6 +182,7 @@ public:
|
|||||||
void designReport();
|
void designReport();
|
||||||
void setSettings(QSettings* value);
|
void setSettings(QSettings* value);
|
||||||
void setShowProgressDialog(bool value){m_showProgressDialog = value;}
|
void setShowProgressDialog(bool value){m_showProgressDialog = value;}
|
||||||
|
bool isShowProgressDialog() const {return m_showProgressDialog;}
|
||||||
QSettings* settings();
|
QSettings* settings();
|
||||||
bool loadFromFile(const QString& fileName, bool autoLoadPreviewOnChange);
|
bool loadFromFile(const QString& fileName, bool autoLoadPreviewOnChange);
|
||||||
bool loadFromByteArray(QByteArray *data, const QString& name = "");
|
bool loadFromByteArray(QByteArray *data, const QString& name = "");
|
||||||
@ -246,6 +250,7 @@ public:
|
|||||||
void clearWatermarks();
|
void clearWatermarks();
|
||||||
IPreparedPages* preparedPages();
|
IPreparedPages* preparedPages();
|
||||||
bool showPreparedPages(PreviewHints hints);
|
bool showPreparedPages(PreviewHints hints);
|
||||||
|
bool showPreparedPages(QPrinter *defaultPrinter, PreviewHints hints);
|
||||||
bool prepareReportPages();
|
bool prepareReportPages();
|
||||||
bool printPreparedPages();
|
bool printPreparedPages();
|
||||||
signals:
|
signals:
|
||||||
@ -267,13 +272,18 @@ signals:
|
|||||||
void currentDefaultDesignerLanguageChanged(QLocale::Language);
|
void currentDefaultDesignerLanguageChanged(QLocale::Language);
|
||||||
QLocale::Language getCurrentDefaultDesignerLanguage();
|
QLocale::Language getCurrentDefaultDesignerLanguage();
|
||||||
void externalPaint(const QString& objectName, QPainter* painter, const QStyleOptionGraphicsItem*);
|
void externalPaint(const QString& objectName, QPainter* painter, const QStyleOptionGraphicsItem*);
|
||||||
|
void printingStarted(int pageCount);
|
||||||
|
void printingFinished();
|
||||||
|
void pagePrintingFinished(int index);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
bool slotLoadFromFile(const QString& fileName);
|
bool slotLoadFromFile(const QString& fileName);
|
||||||
void cancelRender();
|
void cancelRender();
|
||||||
|
void cancelPrinting();
|
||||||
protected:
|
protected:
|
||||||
PageDesignIntf* createPage(const QString& pageName="", bool preview = false);
|
PageDesignIntf* createPage(const QString& pageName="", bool preview = false);
|
||||||
bool showPreviewWindow(ReportPages pages, PreviewHints hints);
|
bool showPreviewWindow(ReportPages pages, PreviewHints hints, QPrinter *printer);
|
||||||
|
void internalPrintPages(ReportPages pages, QPrinter &printer);
|
||||||
protected slots:
|
protected slots:
|
||||||
void slotDataSourceCollectionLoaded(const QString& collectionName);
|
void slotDataSourceCollectionLoaded(const QString& collectionName);
|
||||||
private slots:
|
private slots:
|
||||||
@ -343,6 +353,7 @@ private:
|
|||||||
bool m_saveToFileVisible;
|
bool m_saveToFileVisible;
|
||||||
bool m_printToPdfVisible;
|
bool m_printToPdfVisible;
|
||||||
bool m_printVisible;
|
bool m_printVisible;
|
||||||
|
bool m_cancelPrinting;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -189,11 +189,46 @@ void ReportRender::initDatasource(const QString& name){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReportRender::renderPage(PageItemDesignIntf* patternPage, bool isTOC, bool isFirst, bool resetPageNumbers)
|
void ReportRender::analizeItem(ContentItemDesignIntf* contentItem, BandDesignIntf* band){
|
||||||
|
if (contentItem){
|
||||||
|
QString content = contentItem->content();
|
||||||
|
QVector<QString> functions;
|
||||||
|
foreach(const QString &functionName, m_datasources->groupFunctionNames()){
|
||||||
|
QRegExp rx(QString(Const::GROUP_FUNCTION_RX).arg(functionName));
|
||||||
|
rx.setMinimal(true);
|
||||||
|
if (rx.indexIn(content)>=0){
|
||||||
|
functions.append(functionName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (functions.size()>0)
|
||||||
|
m_groupfunctionItems.insert(contentItem->patternName(), functions);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ReportRender::analizeContainer(BaseDesignIntf* item, BandDesignIntf* band){
|
||||||
|
foreach(BaseDesignIntf* child, item->childBaseItems()){
|
||||||
|
ContentItemDesignIntf* contentItem = dynamic_cast<ContentItemDesignIntf*>(child);
|
||||||
|
if (contentItem) analizeItem(contentItem, band);
|
||||||
|
else analizeContainer(child, band);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ReportRender::analizePage(PageItemDesignIntf* patternPage){
|
||||||
|
m_groupfunctionItems.clear();
|
||||||
|
foreach(BandDesignIntf* band, patternPage->bands()){
|
||||||
|
if (band->isFooter() || band->isHeader()){
|
||||||
|
analizeContainer(band,band);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ReportRender::renderPage(PageItemDesignIntf* patternPage, bool isTOC, bool /*isFirst*/, bool /*resetPageNumbers*/)
|
||||||
{
|
{
|
||||||
m_currentNameIndex = 0;
|
m_currentNameIndex = 0;
|
||||||
m_patternPageItem = patternPage;
|
m_patternPageItem = patternPage;
|
||||||
|
|
||||||
|
analizePage(patternPage);
|
||||||
|
|
||||||
if (m_patternPageItem->resetPageNumber() && m_pageCount>0 && !isTOC) {
|
if (m_patternPageItem->resetPageNumber() && m_pageCount>0 && !isTOC) {
|
||||||
resetPageNumber(PageReset);
|
resetPageNumber(PageReset);
|
||||||
}
|
}
|
||||||
@ -380,11 +415,11 @@ void ReportRender::extractGroupFunctions(BandDesignIntf *band)
|
|||||||
extractGroupFunctionsFromContainer(band, band);
|
extractGroupFunctionsFromContainer(band, band);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ReportRender::replaceGroupFunctionsInItem(ContentItemDesignIntf* contentItem, BandDesignIntf* band){
|
void ReportRender::replaceGroupFunctionsInItem(ContentItemDesignIntf* contentItem, BandDesignIntf* band){
|
||||||
if (contentItem){
|
if (contentItem){
|
||||||
|
if (m_groupfunctionItems.contains(contentItem->patternName())){
|
||||||
QString content = contentItem->content();
|
QString content = contentItem->content();
|
||||||
foreach(const QString &functionName, m_datasources->groupFunctionNames()){
|
foreach(QString functionName, m_groupfunctionItems.value(contentItem->patternName())){
|
||||||
QRegExp rx(QString(Const::GROUP_FUNCTION_RX).arg(functionName));
|
QRegExp rx(QString(Const::GROUP_FUNCTION_RX).arg(functionName));
|
||||||
rx.setMinimal(true);
|
rx.setMinimal(true);
|
||||||
if (rx.indexIn(content)>=0){
|
if (rx.indexIn(content)>=0){
|
||||||
@ -405,9 +440,10 @@ void ReportRender::replaceGroupFunctionsInItem(ContentItemDesignIntf* contentIte
|
|||||||
}
|
}
|
||||||
pos += rx.matchedLength();
|
pos += rx.matchedLength();
|
||||||
}
|
}
|
||||||
contentItem->setContent(content);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
contentItem->setContent(content);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,6 +82,7 @@ private:
|
|||||||
int m_TOCRangeIndex;
|
int m_TOCRangeIndex;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class ReportRender: public QObject
|
class ReportRender: public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -109,6 +110,10 @@ signals:
|
|||||||
public slots:
|
public slots:
|
||||||
void cancelRender();
|
void cancelRender();
|
||||||
private:
|
private:
|
||||||
|
void analizeContainer(BaseDesignIntf *item, BandDesignIntf *band);
|
||||||
|
void analizeItem(ContentItemDesignIntf *item, BandDesignIntf *band);
|
||||||
|
void analizePage(PageItemDesignIntf *patternPage);
|
||||||
|
|
||||||
void initDatasources();
|
void initDatasources();
|
||||||
void initDatasource(const QString &name);
|
void initDatasource(const QString &name);
|
||||||
void initRenderPage();
|
void initRenderPage();
|
||||||
@ -116,7 +121,7 @@ private:
|
|||||||
void initGroups();
|
void initGroups();
|
||||||
void clearPageMap();
|
void clearPageMap();
|
||||||
|
|
||||||
void renderPage(PageItemDesignIntf *patternPage, bool isTOC = false, bool isFirst = false, bool resetPageNumbers = false);
|
void renderPage(PageItemDesignIntf *patternPage, bool isTOC = false, bool isFirst = false, bool = false);
|
||||||
BandDesignIntf* renderBand(BandDesignIntf *patternBand, BandDesignIntf *bandData, DataRenderMode mode = NotStartNewPage, bool isLast = false);
|
BandDesignIntf* renderBand(BandDesignIntf *patternBand, BandDesignIntf *bandData, DataRenderMode mode = NotStartNewPage, bool isLast = false);
|
||||||
void renderDataBand(BandDesignIntf* dataBand);
|
void renderDataBand(BandDesignIntf* dataBand);
|
||||||
void renderPageHeader(PageItemDesignIntf* patternPage);
|
void renderPageHeader(PageItemDesignIntf* patternPage);
|
||||||
@ -193,7 +198,7 @@ private:
|
|||||||
QMultiMap< BandDesignIntf*, GroupBandsHolder* > m_childBands;
|
QMultiMap< BandDesignIntf*, GroupBandsHolder* > m_childBands;
|
||||||
QList<BandDesignIntf*> m_reprintableBands;
|
QList<BandDesignIntf*> m_reprintableBands;
|
||||||
QList<BandDesignIntf*> m_recalcBands;
|
QList<BandDesignIntf*> m_recalcBands;
|
||||||
|
QMap<QString, QVector<QString> > m_groupfunctionItems;
|
||||||
int m_currentIndex;
|
int m_currentIndex;
|
||||||
int m_pageCount;
|
int m_pageCount;
|
||||||
|
|
||||||
@ -217,6 +222,7 @@ private:
|
|||||||
bool m_newPageStarted;
|
bool m_newPageStarted;
|
||||||
bool m_lostHeadersMoved;
|
bool m_lostHeadersMoved;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
} // namespace LimeReport
|
} // namespace LimeReport
|
||||||
#endif // LRREPORTRENDER_H
|
#endif // LRREPORTRENDER_H
|
||||||
|
@ -32,6 +32,7 @@ ReportTranslation::~ReportTranslation()
|
|||||||
PageTranslation* ReportTranslation::createPageTranslation(PageDesignIntf* page)
|
PageTranslation* ReportTranslation::createPageTranslation(PageDesignIntf* page)
|
||||||
{
|
{
|
||||||
PageTranslation* pageTranslation = new PageTranslation;
|
PageTranslation* pageTranslation = new PageTranslation;
|
||||||
|
pageTranslation->checked = true;
|
||||||
pageTranslation->pageName = page->pageItem()->objectName();
|
pageTranslation->pageName = page->pageItem()->objectName();
|
||||||
foreach(BaseDesignIntf* item, page->pageItem()->allChildBaseItems()){
|
foreach(BaseDesignIntf* item, page->pageItem()->allChildBaseItems()){
|
||||||
createItemTranslation(item, pageTranslation);
|
createItemTranslation(item, pageTranslation);
|
||||||
@ -43,6 +44,7 @@ void ReportTranslation::createItemTranslation(BaseDesignIntf* item, PageTranslat
|
|||||||
QMap<QString,QString> stringsForTranslation = item->getStringForTranslation();
|
QMap<QString,QString> stringsForTranslation = item->getStringForTranslation();
|
||||||
if (!stringsForTranslation.isEmpty()){
|
if (!stringsForTranslation.isEmpty()){
|
||||||
ItemTranslation* itemTranslation = new ItemTranslation;
|
ItemTranslation* itemTranslation = new ItemTranslation;
|
||||||
|
itemTranslation->checked = true;
|
||||||
itemTranslation->itemName = item->objectName();
|
itemTranslation->itemName = item->objectName();
|
||||||
foreach(QString propertyName, stringsForTranslation.keys()){
|
foreach(QString propertyName, stringsForTranslation.keys()){
|
||||||
PropertyTranslation* propertyTranslation = new PropertyTranslation;
|
PropertyTranslation* propertyTranslation = new PropertyTranslation;
|
||||||
@ -57,16 +59,42 @@ void ReportTranslation::createItemTranslation(BaseDesignIntf* item, PageTranslat
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PageTranslation* ReportTranslation::findPageTranslation(const QString& page_name)
|
PageTranslation* ReportTranslation::findPageTranslation(const QString& pageName)
|
||||||
{
|
{
|
||||||
foreach(PageTranslation* page, m_pagesTranslation){
|
foreach(PageTranslation* page, m_pagesTranslation){
|
||||||
if (page->pageName.compare(page_name) == 0){
|
if (page->pageName.compare(pageName) == 0){
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ReportTranslation::renamePage(const QString &oldName, const QString &newName)
|
||||||
|
{
|
||||||
|
PageTranslation* page = findPageTranslation(oldName);
|
||||||
|
if (page){
|
||||||
|
page->pageName = newName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ReportTranslation::invalidatePages()
|
||||||
|
{
|
||||||
|
foreach(PageTranslation* page, m_pagesTranslation){
|
||||||
|
page->checked = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ReportTranslation::clearInvalidPages()
|
||||||
|
{
|
||||||
|
QList<PageTranslation*>::Iterator it = m_pagesTranslation.begin();
|
||||||
|
while (it != m_pagesTranslation.end()){
|
||||||
|
if (!(*it)->checked){
|
||||||
|
delete *it;
|
||||||
|
it = m_pagesTranslation.erase(it);
|
||||||
|
} else ++it;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ReportTranslation::updatePageTranslation(PageDesignIntf* page)
|
void ReportTranslation::updatePageTranslation(PageDesignIntf* page)
|
||||||
{
|
{
|
||||||
PageTranslation* pageTranslation = findPageTranslation(page->pageItem()->objectName());
|
PageTranslation* pageTranslation = findPageTranslation(page->pageItem()->objectName());
|
||||||
@ -75,6 +103,10 @@ void ReportTranslation::updatePageTranslation(PageDesignIntf* page)
|
|||||||
m_pagesTranslation.append(pageTranslation);
|
m_pagesTranslation.append(pageTranslation);
|
||||||
}
|
}
|
||||||
if (pageTranslation){
|
if (pageTranslation){
|
||||||
|
pageTranslation->checked = true;
|
||||||
|
foreach(ItemTranslation* item, pageTranslation->itemsTranslation){
|
||||||
|
item->checked = false;
|
||||||
|
}
|
||||||
foreach(BaseDesignIntf* item, page->pageItem()->allChildBaseItems()){
|
foreach(BaseDesignIntf* item, page->pageItem()->allChildBaseItems()){
|
||||||
QMap<QString,QString> stringsForTranslation = item->getStringForTranslation();
|
QMap<QString,QString> stringsForTranslation = item->getStringForTranslation();
|
||||||
if (!stringsForTranslation.isEmpty()){
|
if (!stringsForTranslation.isEmpty()){
|
||||||
@ -90,15 +122,23 @@ void ReportTranslation::updatePageTranslation(PageDesignIntf* page)
|
|||||||
propertyTranslation->sourceValue = stringsForTranslation.value(propertyName);
|
propertyTranslation->sourceValue = stringsForTranslation.value(propertyName);
|
||||||
if (!translated) propertyTranslation->value = propertyTranslation->sourceValue;
|
if (!translated) propertyTranslation->value = propertyTranslation->sourceValue;
|
||||||
}
|
}
|
||||||
|
itemTranslation->checked = true;
|
||||||
} else {
|
} else {
|
||||||
createItemTranslation(item, pageTranslation);
|
createItemTranslation(item, pageTranslation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
QHash<QString, ItemTranslation*>::Iterator it = pageTranslation->itemsTranslation.begin();
|
||||||
|
while( it != pageTranslation->itemsTranslation.end()){
|
||||||
|
if (!it.value()->checked) {
|
||||||
|
delete it.value();
|
||||||
|
it = pageTranslation->itemsTranslation.erase(it);
|
||||||
|
} else ++it;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<PageTranslation*> ReportTranslation::pagesTranslation() const
|
QList<PageTranslation*>& ReportTranslation::pagesTranslation()
|
||||||
{
|
{
|
||||||
return m_pagesTranslation;
|
return m_pagesTranslation;
|
||||||
}
|
}
|
||||||
@ -139,4 +179,14 @@ PageTranslation::~PageTranslation()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PageTranslation::renameItem(const QString &oldName, const QString &newName)
|
||||||
|
{
|
||||||
|
ItemTranslation* item = itemsTranslation.value(oldName);
|
||||||
|
if (item){
|
||||||
|
itemsTranslation.remove(oldName);
|
||||||
|
item->itemName = newName;
|
||||||
|
itemsTranslation[newName] = item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} //namespace LimeReport
|
} //namespace LimeReport
|
||||||
|
@ -31,6 +31,7 @@ struct PropertyTranslation{
|
|||||||
|
|
||||||
struct ItemTranslation{
|
struct ItemTranslation{
|
||||||
QString itemName;
|
QString itemName;
|
||||||
|
bool checked;
|
||||||
PropertyTranslation* findProperty(const QString& propertyName);
|
PropertyTranslation* findProperty(const QString& propertyName);
|
||||||
~ItemTranslation();
|
~ItemTranslation();
|
||||||
QList<PropertyTranslation*> propertyesTranslation;
|
QList<PropertyTranslation*> propertyesTranslation;
|
||||||
@ -38,8 +39,10 @@ struct ItemTranslation{
|
|||||||
|
|
||||||
struct PageTranslation{
|
struct PageTranslation{
|
||||||
QString pageName;
|
QString pageName;
|
||||||
|
bool checked;
|
||||||
~PageTranslation();
|
~PageTranslation();
|
||||||
QHash<QString,ItemTranslation*> itemsTranslation;
|
void renameItem(const QString& oldName, const QString& newName);
|
||||||
|
QHash<QString, ItemTranslation*> itemsTranslation;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ReportTranslation{
|
class ReportTranslation{
|
||||||
@ -49,12 +52,15 @@ public:
|
|||||||
ReportTranslation(const ReportTranslation& reportTranslation);
|
ReportTranslation(const ReportTranslation& reportTranslation);
|
||||||
~ReportTranslation();
|
~ReportTranslation();
|
||||||
QLocale::Language language() const;
|
QLocale::Language language() const;
|
||||||
QList<PageTranslation*> pagesTranslation() const;
|
QList<PageTranslation *> &pagesTranslation();
|
||||||
PageTranslation* createEmptyPageTranslation();
|
PageTranslation* createEmptyPageTranslation();
|
||||||
void updatePageTranslation(PageDesignIntf* page);
|
void updatePageTranslation(PageDesignIntf* page);
|
||||||
PageTranslation* findPageTranslation(const QString& page_name);
|
PageTranslation* findPageTranslation(const QString& pageName);
|
||||||
void createItemTranslation(BaseDesignIntf* item, PageTranslation* pageTranslation);
|
void renamePage(const QString& oldName, const QString& newName);
|
||||||
|
void invalidatePages();
|
||||||
|
void clearInvalidPages();
|
||||||
private:
|
private:
|
||||||
|
void createItemTranslation(BaseDesignIntf* item, PageTranslation* pageTranslation);
|
||||||
PageTranslation* createPageTranslation(PageDesignIntf* page);
|
PageTranslation* createPageTranslation(PageDesignIntf* page);
|
||||||
private:
|
private:
|
||||||
QLocale::Language m_language;
|
QLocale::Language m_language;
|
||||||
|
@ -465,15 +465,13 @@ QString ScriptEngineManager::expandScripts(QString context, QVariant& varValue,
|
|||||||
|
|
||||||
if (context.contains(rx)){
|
if (context.contains(rx)){
|
||||||
|
|
||||||
if (ScriptEngineManager::instance().dataManager()!=dataManager())
|
if (ScriptEngineManager::instance().dataManager() != dataManager())
|
||||||
ScriptEngineManager::instance().setDataManager(dataManager());
|
ScriptEngineManager::instance().setDataManager(dataManager());
|
||||||
|
|
||||||
ScriptEngineType* se = ScriptEngineManager::instance().scriptEngine();
|
ScriptEngineType* se = ScriptEngineManager::instance().scriptEngine();
|
||||||
|
|
||||||
if (reportItem){
|
if (reportItem){
|
||||||
|
|
||||||
ScriptValueType svThis;
|
ScriptValueType svThis;
|
||||||
|
|
||||||
#ifdef USE_QJSENGINE
|
#ifdef USE_QJSENGINE
|
||||||
svThis = getJSValue(*se, reportItem);
|
svThis = getJSValue(*se, reportItem);
|
||||||
se->globalObject().setProperty("THIS",svThis);
|
se->globalObject().setProperty("THIS",svThis);
|
||||||
@ -490,29 +488,37 @@ QString ScriptEngineManager::expandScripts(QString context, QVariant& varValue,
|
|||||||
|
|
||||||
ScriptExtractor scriptExtractor(context);
|
ScriptExtractor scriptExtractor(context);
|
||||||
if (scriptExtractor.parse()){
|
if (scriptExtractor.parse()){
|
||||||
for(int i=0; i<scriptExtractor.count();++i){
|
context = replaceScripts(context, varValue, reportItem, se, scriptExtractor.scriptTree());
|
||||||
QString scriptBody = expandDataFields(scriptExtractor.bodyAt(i),EscapeSymbols, varValue, reportItem);
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return context;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString ScriptEngineManager::replaceScripts(QString context, QVariant &varValue, QObject *reportItem, ScriptEngineType* se, ScriptNode *scriptTree)
|
||||||
|
{
|
||||||
|
foreach(ScriptNode* item, scriptTree->children()){
|
||||||
|
QString scriptBody = expandDataFields(item->body(), EscapeSymbols, varValue, reportItem);
|
||||||
|
if (item->children().size() > 0)
|
||||||
|
scriptBody = replaceScripts(scriptBody, varValue, reportItem, se, item);
|
||||||
scriptBody = expandUserVariables(scriptBody, FirstPass, EscapeSymbols, varValue);
|
scriptBody = expandUserVariables(scriptBody, FirstPass, EscapeSymbols, varValue);
|
||||||
ScriptValueType value = se->evaluate(scriptBody);
|
ScriptValueType value = se->evaluate(scriptBody);
|
||||||
#ifdef USE_QJSENGINE
|
#ifdef USE_QJSENGINE
|
||||||
if (!value.isError()){
|
if (!value.isError()){
|
||||||
varValue = value.toVariant();
|
varValue = value.toVariant();
|
||||||
context.replace(scriptExtractor.scriptAt(i),value.toString());
|
context.replace(item->script(), value.toString());
|
||||||
} else {
|
} else {
|
||||||
context.replace(scriptExtractor.scriptAt(i),value.toString());
|
context.replace(item->script(), value.toString());
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (!se->hasUncaughtException()) {
|
if (!se->hasUncaughtException()) {
|
||||||
varValue = value.toVariant();
|
varValue = value.toVariant();
|
||||||
context.replace(scriptExtractor.scriptAt(i),value.toString());
|
context.replace(item->script(), value.toString());
|
||||||
} else {
|
} else {
|
||||||
context.replace(scriptExtractor.scriptAt(i),se->uncaughtException().toString());
|
context.replace(item->script(), se->uncaughtException().toString());
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -530,7 +536,7 @@ QVariant ScriptEngineManager::evaluateScript(const QString& script){
|
|||||||
|
|
||||||
ScriptExtractor scriptExtractor(script);
|
ScriptExtractor scriptExtractor(script);
|
||||||
if (scriptExtractor.parse()){
|
if (scriptExtractor.parse()){
|
||||||
QString scriptBody = expandDataFields(scriptExtractor.bodyAt(0),EscapeSymbols, varValue, 0);
|
QString scriptBody = expandDataFields(scriptExtractor.scriptTree()[0].body(), EscapeSymbols, varValue, 0);
|
||||||
scriptBody = expandUserVariables(scriptBody, FirstPass, EscapeSymbols, varValue);
|
scriptBody = expandUserVariables(scriptBody, FirstPass, EscapeSymbols, varValue);
|
||||||
ScriptValueType value = se->evaluate(scriptBody);
|
ScriptValueType value = se->evaluate(scriptBody);
|
||||||
#ifdef USE_QJSENGINE
|
#ifdef USE_QJSENGINE
|
||||||
@ -976,12 +982,11 @@ ScriptEngineManager::ScriptEngineManager()
|
|||||||
bool ScriptExtractor::parse()
|
bool ScriptExtractor::parse()
|
||||||
{
|
{
|
||||||
int currentPos = 0;
|
int currentPos = 0;
|
||||||
parse(currentPos,None);
|
parse(currentPos, None, m_scriptTree);
|
||||||
return m_scriptsBody.count()>0;
|
return m_scriptTree->children().count() > 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ScriptExtractor::parse(int &curPos,const State& state)
|
bool ScriptExtractor::parse(int &curPos, const State& state, ScriptNode* scriptNode)
|
||||||
{
|
{
|
||||||
while (curPos<m_context.length()){
|
while (curPos<m_context.length()){
|
||||||
switch (state) {
|
switch (state) {
|
||||||
@ -990,13 +995,13 @@ bool ScriptExtractor::parse(int &curPos,const State& state)
|
|||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
if (m_context[curPos]=='{')
|
if (m_context[curPos]=='{')
|
||||||
extractBracket(curPos);
|
extractBracket(curPos, scriptNode);
|
||||||
}
|
}
|
||||||
case None:
|
case None:
|
||||||
if (m_context[curPos]=='$'){
|
if (m_context[curPos]=='$'){
|
||||||
int startPos = curPos;
|
int startPos = curPos;
|
||||||
if (isStartScriptLexem(curPos))
|
if (isStartScriptLexem(curPos))
|
||||||
extractScript(curPos,substring(m_context,startPos,curPos));
|
extractScript(curPos, substring(m_context,startPos,curPos), scriptNode->createChildNode());
|
||||||
if (isStartFieldLexem(curPos) || isStartVariableLexem(curPos))
|
if (isStartFieldLexem(curPos) || isStartVariableLexem(curPos))
|
||||||
skipField(curPos);
|
skipField(curPos);
|
||||||
}
|
}
|
||||||
@ -1008,13 +1013,13 @@ bool ScriptExtractor::parse(int &curPos,const State& state)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScriptExtractor::extractScript(int &curPos, const QString& startStr)
|
void ScriptExtractor::extractScript(int &curPos, const QString& startStr, ScriptNode* scriptNode)
|
||||||
{
|
{
|
||||||
int startPos = curPos;
|
int startPos = curPos;
|
||||||
if (extractBracket(curPos)){
|
if (extractBracket(curPos, scriptNode)){
|
||||||
QString scriptBody = substring(m_context,startPos+1,curPos);
|
QString scriptBody = substring(m_context,startPos+1,curPos);
|
||||||
m_scriptsBody.push_back(scriptBody);
|
scriptNode->setBody(scriptBody);
|
||||||
m_scriptsStartLex.push_back(startStr+'{');
|
scriptNode->setStartLex(startStr+'{');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1028,10 +1033,10 @@ void ScriptExtractor::skipField(int &curPos){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ScriptExtractor::extractBracket(int &curPos)
|
bool ScriptExtractor::extractBracket(int &curPos, ScriptNode* scriptNode)
|
||||||
{
|
{
|
||||||
curPos++;
|
curPos++;
|
||||||
return parse(curPos,OpenBracketFound);
|
return parse(curPos,OpenBracketFound, scriptNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ScriptExtractor::isStartLexem(int& curPos, QChar value){
|
bool ScriptExtractor::isStartLexem(int& curPos, QChar value){
|
||||||
@ -1064,16 +1069,16 @@ bool ScriptExtractor::isStartLexem(int& curPos, QChar value){
|
|||||||
|
|
||||||
bool ScriptExtractor::isStartScriptLexem(int& curPos)
|
bool ScriptExtractor::isStartScriptLexem(int& curPos)
|
||||||
{
|
{
|
||||||
return isStartLexem(curPos, SCRIPT_SIGN);
|
return isStartLexem(curPos, Const::SCRIPT_SIGN);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ScriptExtractor::isStartFieldLexem(int& curPos){
|
bool ScriptExtractor::isStartFieldLexem(int& curPos){
|
||||||
return isStartLexem(curPos, FIELD_SIGN);
|
return isStartLexem(curPos, Const::FIELD_SIGN);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ScriptExtractor::isStartVariableLexem(int &curPos)
|
bool ScriptExtractor::isStartVariableLexem(int &curPos)
|
||||||
{
|
{
|
||||||
return isStartLexem(curPos, VARIABLE_SIGN);
|
return isStartLexem(curPos, Const::VARIABLE_SIGN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1930,7 +1935,7 @@ bool DatasourceFunctions::isEOF(const QString &datasourceName)
|
|||||||
bool DatasourceFunctions::invalidate(const QString& datasourceName)
|
bool DatasourceFunctions::invalidate(const QString& datasourceName)
|
||||||
{
|
{
|
||||||
if (m_dataManager && m_dataManager->dataSource(datasourceName)){
|
if (m_dataManager && m_dataManager->dataSource(datasourceName)){
|
||||||
m_dataManager->dataSourceHolder(datasourceName)->invalidate(IDataSource::DatasourceMode::RENDER_MODE);
|
m_dataManager->dataSourceHolder(datasourceName)->invalidate(IDataSource::RENDER_MODE);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -396,6 +396,47 @@ private:
|
|||||||
QMap<QString, IWrapperCreator*> m_wrappersFactory;
|
QMap<QString, IWrapperCreator*> m_wrappersFactory;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class ScriptNode{
|
||||||
|
public:
|
||||||
|
QString body(){return m_body;}
|
||||||
|
void setBody(const QString& body){ m_body = body;}
|
||||||
|
void setStartLex(const QString startLex){ m_startLex = startLex;}
|
||||||
|
QString script(){return m_startLex + m_body + '}';}
|
||||||
|
ScriptNode* createChildNode(){
|
||||||
|
ScriptNode* result = new ScriptNode();
|
||||||
|
m_children.append(result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
QVector<ScriptNode*> children() const {return m_children;}
|
||||||
|
private:
|
||||||
|
QVector<ScriptNode*> m_children;
|
||||||
|
QString m_body;
|
||||||
|
QString m_startLex;
|
||||||
|
};
|
||||||
|
|
||||||
|
class ScriptExtractor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
enum State{None,BuksFound,SFound,StartScriptFound,OpenBracketFound,CloseBracketFound,DFound,VFound, SignFound};
|
||||||
|
explicit ScriptExtractor(const QString& value):
|
||||||
|
m_context(value), m_scriptTree(new ScriptNode()){}
|
||||||
|
bool parse();
|
||||||
|
ScriptNode* scriptTree(){return m_scriptTree;}
|
||||||
|
private:
|
||||||
|
bool isStartLexem(int &curPos, QChar value);
|
||||||
|
bool parse(int& curPos, const State &state, ScriptNode *scriptNode);
|
||||||
|
void skipField(int &curPos);
|
||||||
|
void extractScript(int& curPos, const QString &startStr, ScriptNode *scriptNode);
|
||||||
|
bool extractBracket(int& curPos, ScriptNode *scriptNode);
|
||||||
|
bool isStartScriptLexem(int &curPos);
|
||||||
|
bool isStartFieldLexem(int &curPos);
|
||||||
|
bool isStartVariableLexem(int &curPos);
|
||||||
|
QString substring(const QString& value, int start, int end);
|
||||||
|
private:
|
||||||
|
QString m_context;
|
||||||
|
ScriptNode* m_scriptTree;
|
||||||
|
};
|
||||||
|
|
||||||
class ScriptEngineManager : public QObject, public Singleton<ScriptEngineManager>, public IScriptEngineManager
|
class ScriptEngineManager : public QObject, public Singleton<ScriptEngineManager>, public IScriptEngineManager
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -423,6 +464,9 @@ public:
|
|||||||
QString expandUserVariables(QString context, RenderPass pass, ExpandType expandType, QVariant &varValue);
|
QString expandUserVariables(QString context, RenderPass pass, ExpandType expandType, QVariant &varValue);
|
||||||
QString expandDataFields(QString context, ExpandType expandType, QVariant &varValue, QObject* reportItem);
|
QString expandDataFields(QString context, ExpandType expandType, QVariant &varValue, QObject* reportItem);
|
||||||
QString expandScripts(QString context, QVariant &varValue, QObject* reportItem);
|
QString expandScripts(QString context, QVariant &varValue, QObject* reportItem);
|
||||||
|
|
||||||
|
QString replaceScripts(QString context, QVariant& varValue, QObject *reportItem, ScriptEngineType *se, ScriptNode* scriptTree);
|
||||||
|
|
||||||
QVariant evaluateScript(const QString &script);
|
QVariant evaluateScript(const QString &script);
|
||||||
void addBookMark(const QString &uniqKey, const QString &content);
|
void addBookMark(const QString &uniqKey, const QString &content);
|
||||||
int findPageIndexByBookmark(const QString& uniqKey);
|
int findPageIndexByBookmark(const QString& uniqKey);
|
||||||
@ -466,36 +510,6 @@ private:
|
|||||||
ScriptFunctionsManager* m_functionManager;
|
ScriptFunctionsManager* m_functionManager;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ScriptExtractor
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
enum State{None,BuksFound,SFound,StartScriptFound,OpenBracketFound,CloseBracketFound,DFound,VFound, SignFound};
|
|
||||||
explicit ScriptExtractor(const QString& value):m_context(value){}
|
|
||||||
bool parse();
|
|
||||||
int count(){return m_scriptsBody.count();}
|
|
||||||
QString bodyAt(int index){return m_scriptsBody[index];}
|
|
||||||
QString scriptAt(int index){return m_scriptsStartLex[index]+m_scriptsBody[index]+'}';}
|
|
||||||
|
|
||||||
private:
|
|
||||||
static const char SCRIPT_SIGN = 'S';
|
|
||||||
static const char FIELD_SIGN = 'D';
|
|
||||||
static const char VARIABLE_SIGN = 'V';
|
|
||||||
|
|
||||||
bool isStartLexem(int &curPos, QChar value);
|
|
||||||
bool parse(int& curPos, const State &state);
|
|
||||||
void skipField(int &curPos);
|
|
||||||
void extractScript(int& curPos, const QString &startStr);
|
|
||||||
bool extractBracket(int& curPos);
|
|
||||||
bool isStartScriptLexem(int &curPos);
|
|
||||||
bool isStartFieldLexem(int &curPos);
|
|
||||||
bool isStartVariableLexem(int &curPos);
|
|
||||||
QString substring(const QString& value, int start, int end);
|
|
||||||
private:
|
|
||||||
QString m_context;
|
|
||||||
QVector<QString> m_scriptsBody;
|
|
||||||
QVector<QString> m_scriptsStartLex;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef USE_QTSCRIPTENGINE
|
#ifdef USE_QTSCRIPTENGINE
|
||||||
class QFontPrototype : public QObject, public QScriptable {
|
class QFontPrototype : public QObject, public QScriptable {
|
||||||
|
@ -163,6 +163,7 @@ void QObjectPropertyModel::translatePropertyName()
|
|||||||
tr("units");
|
tr("units");
|
||||||
tr("geometryLocked");
|
tr("geometryLocked");
|
||||||
tr("printBehavior");
|
tr("printBehavior");
|
||||||
|
tr("shiftItems");
|
||||||
}
|
}
|
||||||
|
|
||||||
void QObjectPropertyModel::clearObjectsList()
|
void QObjectPropertyModel::clearObjectsList()
|
||||||
|
@ -99,7 +99,7 @@ namespace LimeReport{
|
|||||||
#endif
|
#endif
|
||||||
private:
|
private:
|
||||||
bool m_valid;
|
bool m_valid;
|
||||||
void invalidate(){m_object=0; m_objects=0; m_valid = false; m_name = ""; m_value=QVariant(), m_isClass=false;}
|
void invalidate(){m_object=0; m_objects=0; m_valid = false; m_name = ""; m_value=QVariant(); m_isClass=false;}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void beginChangeValue(){ m_changingValue = true; }
|
void beginChangeValue(){ m_changingValue = true; }
|
||||||
@ -140,4 +140,7 @@ namespace LimeReport{
|
|||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Q_DECLARE_METATYPE(LimeReport::ObjectPropItem*)
|
||||||
|
|
||||||
#endif // LROBJECTPROPITEM_H
|
#endif // LROBJECTPROPITEM_H
|
||||||
|
@ -11,7 +11,8 @@ namespace LimeReport {
|
|||||||
TranslationEditor::TranslationEditor(QWidget *parent) :
|
TranslationEditor::TranslationEditor(QWidget *parent) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
ui(new Ui::TranslationEditor), m_translationContainer(0),
|
ui(new Ui::TranslationEditor), m_translationContainer(0),
|
||||||
m_currentReportTranslation(0), m_currentPageTranslation(0), m_currentPropertyTranslation(0)
|
m_currentReportTranslation(0), m_currentPageTranslation(0),
|
||||||
|
m_currentPropertyTranslation(0), m_translationChanging(false)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
ui->splitter_3->setStretchFactor(1,10);
|
ui->splitter_3->setStretchFactor(1,10);
|
||||||
@ -78,11 +79,10 @@ void TranslationEditor::updateUi()
|
|||||||
ui->lvLanguages->addItem(QLocale::languageToString(language));
|
ui->lvLanguages->addItem(QLocale::languageToString(language));
|
||||||
}
|
}
|
||||||
if (!translations->keys().isEmpty()){
|
if (!translations->keys().isEmpty()){
|
||||||
if (ui->lvLanguages->count()!=0){
|
if (ui->lvLanguages->count() != 0){
|
||||||
ui->lvLanguages->item(0)->setSelected(true);
|
ui->lvLanguages->item(0)->setSelected(true);
|
||||||
activateLanguage(getLanguageByName(ui->lvLanguages->item(0)->text()));
|
activateLanguage(getLanguageByName(ui->lvLanguages->item(0)->text()));
|
||||||
} else {
|
} else {
|
||||||
//activateLanguage(QLocale::AnyLanguage);
|
|
||||||
ui->twPages->clear();
|
ui->twPages->clear();
|
||||||
ui->tbStrings->setRowCount(0);
|
ui->tbStrings->setRowCount(0);
|
||||||
}
|
}
|
||||||
@ -93,7 +93,9 @@ void TranslationEditor::updateUi()
|
|||||||
|
|
||||||
void TranslationEditor::activateLanguage(QLocale::Language language)
|
void TranslationEditor::activateLanguage(QLocale::Language language)
|
||||||
{
|
{
|
||||||
|
m_translationChanging = true;
|
||||||
ui->teTranslation->setEnabled(false);
|
ui->teTranslation->setEnabled(false);
|
||||||
|
ui->teTranslation->setPlainText("");
|
||||||
ui->cbChecked->setEnabled(false);
|
ui->cbChecked->setEnabled(false);
|
||||||
ui->twPages->clear();
|
ui->twPages->clear();
|
||||||
Translations* translations = m_translationContainer->translations();
|
Translations* translations = m_translationContainer->translations();
|
||||||
@ -113,6 +115,7 @@ void TranslationEditor::activateLanguage(QLocale::Language language)
|
|||||||
activatePage(m_currentReportTranslation->findPageTranslation(ui->twPages->topLevelItem(0)->text(0)));
|
activatePage(m_currentReportTranslation->findPageTranslation(ui->twPages->topLevelItem(0)->text(0)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m_translationChanging = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TranslationEditor::activatePage(PageTranslation* pageTranslation)
|
void TranslationEditor::activatePage(PageTranslation* pageTranslation)
|
||||||
@ -171,13 +174,13 @@ void TranslationEditor::activateTranslation(const QString& itemName, const QStri
|
|||||||
|
|
||||||
void TranslationEditor::on_tbStrings_itemSelectionChanged()
|
void TranslationEditor::on_tbStrings_itemSelectionChanged()
|
||||||
{
|
{
|
||||||
if (m_currentPageTranslation)
|
if (m_currentPageTranslation && !m_translationChanging)
|
||||||
activateTranslation(ui->tbStrings->item(ui->tbStrings->currentRow(),1)->text(), ui->tbStrings->item(ui->tbStrings->currentRow(),2)->text());
|
activateTranslation(ui->tbStrings->item(ui->tbStrings->currentRow(),1)->text(), ui->tbStrings->item(ui->tbStrings->currentRow(),2)->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
void TranslationEditor::on_teTranslation_textChanged()
|
void TranslationEditor::on_teTranslation_textChanged()
|
||||||
{
|
{
|
||||||
if (m_currentPropertyTranslation)
|
if (m_currentPropertyTranslation && !m_translationChanging)
|
||||||
m_currentPropertyTranslation->value = ui->teTranslation->toPlainText();
|
m_currentPropertyTranslation->value = ui->teTranslation->toPlainText();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -200,16 +203,23 @@ void TranslationEditor::on_tbAddLanguage_clicked()
|
|||||||
{
|
{
|
||||||
LanguageSelectDialog dialog;
|
LanguageSelectDialog dialog;
|
||||||
if (dialog.exec()){
|
if (dialog.exec()){
|
||||||
|
m_translationChanging = true;
|
||||||
m_translationContainer->addTranslationLanguage(dialog.getSelectedLanguage());
|
m_translationContainer->addTranslationLanguage(dialog.getSelectedLanguage());
|
||||||
updateUi();
|
updateUi();
|
||||||
activateLanguage(dialog.getSelectedLanguage());
|
activateLanguage(dialog.getSelectedLanguage());
|
||||||
|
foreach (QListWidgetItem* item, ui->lvLanguages->findItems(QLocale::languageToString(dialog.getSelectedLanguage()), Qt::MatchExactly)){
|
||||||
|
item->setSelected(true);
|
||||||
|
}
|
||||||
|
m_translationChanging = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TranslationEditor::on_tbDeleteLanguage_clicked()
|
void TranslationEditor::on_tbDeleteLanguage_clicked()
|
||||||
{
|
{
|
||||||
|
m_translationChanging = true;
|
||||||
m_translationContainer->removeTranslationLanguage(m_currentReportTranslation->language());
|
m_translationContainer->removeTranslationLanguage(m_currentReportTranslation->language());
|
||||||
updateUi();
|
updateUi();
|
||||||
|
m_translationChanging = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TranslationEditor::slotItemChecked()
|
void TranslationEditor::slotItemChecked()
|
||||||
|
@ -45,6 +45,7 @@ private:
|
|||||||
ReportTranslation* m_currentReportTranslation;
|
ReportTranslation* m_currentReportTranslation;
|
||||||
PageTranslation* m_currentPageTranslation;
|
PageTranslation* m_currentPageTranslation;
|
||||||
PropertyTranslation* m_currentPropertyTranslation;
|
PropertyTranslation* m_currentPropertyTranslation;
|
||||||
|
bool m_translationChanging;
|
||||||
};
|
};
|
||||||
|
|
||||||
} //namespace LimeReport
|
} //namespace LimeReport
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@ -55,6 +55,29 @@
|
|||||||
<translation>Название ряда</translation>
|
<translation>Название ряда</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>ImageItemEditor</name>
|
||||||
|
<message>
|
||||||
|
<source>Image Item Editor</source>
|
||||||
|
<translation>Редакор изображения</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Image</source>
|
||||||
|
<translation>Изображение</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>...</source>
|
||||||
|
<translation>...</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Resource path</source>
|
||||||
|
<translation>Путь к русурсам</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Select image file</source>
|
||||||
|
<translation>Выбрать файл изображения</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>LRVariableDialog</name>
|
<name>LRVariableDialog</name>
|
||||||
<message>
|
<message>
|
||||||
@ -392,6 +415,10 @@ p, li { white-space: pre-wrap; }
|
|||||||
<source>Copy</source>
|
<source>Copy</source>
|
||||||
<translation>Копировать</translation>
|
<translation>Копировать</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Keep top space</source>
|
||||||
|
<translation>Сохранять отступ сверху</translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>LimeReport::BaseDesignIntf</name>
|
<name>LimeReport::BaseDesignIntf</name>
|
||||||
@ -433,7 +460,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>Lock item geometry</source>
|
<source>Lock item geometry</source>
|
||||||
<translation>Блокировать изменения геометрии</translation>
|
<translation>Заблокировать геометрию элемента</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
@ -1003,11 +1030,11 @@ p, li { white-space: pre-wrap; }
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>Scale</source>
|
<source>Scale</source>
|
||||||
<translation>Масштабировать</translation>
|
<translation>Масштаб</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>Split</source>
|
<source>Split</source>
|
||||||
<translation>Разделять на части</translation>
|
<translation>Разделить</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
@ -1130,6 +1157,10 @@ p, li { white-space: pre-wrap; }
|
|||||||
<source>Watermark</source>
|
<source>Watermark</source>
|
||||||
<translation>Водный знак</translation>
|
<translation>Водный знак</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Edit</source>
|
||||||
|
<translation>Правка</translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>LimeReport::ItemLocationPropItem</name>
|
<name>LimeReport::ItemLocationPropItem</name>
|
||||||
@ -1249,7 +1280,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>Translate properties</source>
|
<source>Translate properties</source>
|
||||||
<translation>Переводить имена свойств</translation>
|
<translation>Свойства перевода</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
@ -1329,10 +1360,6 @@ p, li { white-space: pre-wrap; }
|
|||||||
<source>Report</source>
|
<source>Report</source>
|
||||||
<translation>Отчет</translation>
|
<translation>Отчет</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>toolBar</source>
|
|
||||||
<translation>Панель инструментов</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Print</source>
|
<source>Print</source>
|
||||||
<translation>Печать</translation>
|
<translation>Печать</translation>
|
||||||
@ -1433,10 +1460,6 @@ p, li { white-space: pre-wrap; }
|
|||||||
<source>Show toolbar</source>
|
<source>Show toolbar</source>
|
||||||
<translation>Показать панель инструментов</translation>
|
<translation>Показать панель инструментов</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>toolBar_2</source>
|
|
||||||
<translation>Редактирование</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>InsertTextItem</source>
|
<source>InsertTextItem</source>
|
||||||
<translation>Вставить текстовый элемент</translation>
|
<translation>Вставить текстовый элемент</translation>
|
||||||
@ -1457,6 +1480,26 @@ p, li { white-space: pre-wrap; }
|
|||||||
<source>Del</source>
|
<source>Del</source>
|
||||||
<translation>Удалить</translation>
|
<translation>Удалить</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>MainToolBar</source>
|
||||||
|
<translation>Основная панель инструментов</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>EditModeTools</source>
|
||||||
|
<translation>Панель инструментов редактирования</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Printing</source>
|
||||||
|
<translation>Печатается</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Attention</source>
|
||||||
|
<translation>Внимание</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>The printing is in process</source>
|
||||||
|
<translation>Отчет находится в процессе печати</translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>LimeReport::ProxyHolder</name>
|
<name>LimeReport::ProxyHolder</name>
|
||||||
@ -1881,7 +1924,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>setPageSizeToPrinter</source>
|
<source>setPageSizeToPrinter</source>
|
||||||
<translation>Отправить параметры страницы в принтер</translation>
|
<translation>Оправитьпараметры страницы в принтер</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>fillInSecondPass</source>
|
<source>fillInSecondPass</source>
|
||||||
@ -1961,11 +2004,11 @@ p, li { white-space: pre-wrap; }
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>option3</source>
|
<source>option3</source>
|
||||||
<translation></translation>
|
<translation>Опция 3</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>units</source>
|
<source>units</source>
|
||||||
<translation>Единицы измерения</translation>
|
<translation>Еденицы измерения</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>geometryLocked</source>
|
<source>geometryLocked</source>
|
||||||
@ -1973,7 +2016,11 @@ p, li { white-space: pre-wrap; }
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>printBehavior</source>
|
<source>printBehavior</source>
|
||||||
<translation>Режим печати</translation>
|
<translation>Поведение при печати</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>shiftItems</source>
|
||||||
|
<translation>Смещение элементов</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
@ -2227,18 +2274,6 @@ p, li { white-space: pre-wrap; }
|
|||||||
<source>Report file name</source>
|
<source>Report file name</source>
|
||||||
<translation>Файл отчета</translation>
|
<translation>Файл отчета</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>Rendering report</source>
|
|
||||||
<translation>Создается отчет</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Abort</source>
|
|
||||||
<translation>Прервать</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source> page rendered</source>
|
|
||||||
<translation> создается страница</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Warning</source>
|
<source>Warning</source>
|
||||||
<translation>Предупреждение</translation>
|
<translation>Предупреждение</translation>
|
||||||
@ -2301,15 +2336,31 @@ p, li { white-space: pre-wrap; }
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>Lock selected items</source>
|
<source>Lock selected items</source>
|
||||||
<translation>Заблокировать выбранные элементы</translation>
|
<translation>Заблокировать выделенные элементы</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>Unlock selected items</source>
|
<source>Unlock selected items</source>
|
||||||
<translation>Разблокировать выбранные элементы</translation>
|
<translation>Разблокировать выделенные элементы</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>Select one level items</source>
|
<source>Select one level items</source>
|
||||||
<translation>Выбрать все элементы одного уровня</translation>
|
<translation>Выделить элементы одного уровня</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Rendered %1 pages</source>
|
||||||
|
<translation>Сформировано %1 страниц</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Cancel report rendering</source>
|
||||||
|
<translation>Отменить построение отчета</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Attention</source>
|
||||||
|
<translation>Внимание</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>The rendering is in process</source>
|
||||||
|
<translation>Отчет находится в процессе создания</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
@ -2482,7 +2533,7 @@ This preview is no longer valid.</source>
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>CSV</source>
|
<source>CSV</source>
|
||||||
<translation></translation>
|
<translation>CSV</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>Separator</source>
|
<source>Separator</source>
|
||||||
@ -2494,7 +2545,7 @@ This preview is no longer valid.</source>
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>Use first row as header</source>
|
<source>Use first row as header</source>
|
||||||
<translation>Первая строка как заголовок</translation>
|
<translation>Использовать первую строку в качестве заголовка</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
@ -2729,7 +2780,7 @@ This preview is no longer valid.</source>
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>Report units</source>
|
<source>Report units</source>
|
||||||
<translation>Единицы измерения</translation>
|
<translation>Еденицы измерения</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
@ -3146,18 +3197,18 @@ This preview is no longer valid.</source>
|
|||||||
<source>Export to PDF</source>
|
<source>Export to PDF</source>
|
||||||
<translation>Экспортировать в PDF</translation>
|
<translation>Экспортировать в PDF</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Dark</source>
|
||||||
|
<translation>Темная</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Light</source>
|
||||||
|
<translation>Светаля</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>Default</source>
|
<source>Default</source>
|
||||||
<translation>По умолчанию</translation>
|
<translation>По умолчанию</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>margin</source>
|
|
||||||
<translation>Поля</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>''</source>
|
|
||||||
<translation></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Millimeters</source>
|
<source>Millimeters</source>
|
||||||
<translation>Миллиметры</translation>
|
<translation>Миллиметры</translation>
|
||||||
@ -3167,12 +3218,12 @@ This preview is no longer valid.</source>
|
|||||||
<translation>Дюймы</translation>
|
<translation>Дюймы</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>Dark</source>
|
<source>margin</source>
|
||||||
<translation>Темная</translation>
|
<translation>Поля</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>Light</source>
|
<source>''</source>
|
||||||
<translation>Светлая</translation>
|
<translation>''</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
</TS>
|
</TS>
|
||||||
|
Loading…
Reference in New Issue
Block a user