mirror of
https://github.com/fralx/LimeReport.git
synced 2024-12-25 00:54:39 +03:00
Merge branch 'develop' into feature/Interface_lang
This commit is contained in:
commit
a67231c538
@ -11,13 +11,20 @@ DEPENDPATH += $$PWD/3rdparty/easyprofiler/easy_profiler_core/include
|
|||||||
contains(CONFIG, easy_profiler){
|
contains(CONFIG, easy_profiler){
|
||||||
message(EasyProfiler)
|
message(EasyProfiler)
|
||||||
unix|win32: LIBS += -L$$PWD/3rdparty/easyprofiler/build/bin/ -leasy_profiler
|
unix|win32: LIBS += -L$$PWD/3rdparty/easyprofiler/build/bin/ -leasy_profiler
|
||||||
|
greaterThan(QT_MAJOR_VERSION, 4){
|
||||||
DEFINES += BUILD_WITH_EASY_PROFILER
|
DEFINES += BUILD_WITH_EASY_PROFILER
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
!contains(CONFIG, qtscriptengine){
|
!contains(CONFIG, qtscriptengine){
|
||||||
greaterThan(QT_MAJOR_VERSION, 4){
|
greaterThan(QT_MAJOR_VERSION, 4){
|
||||||
|
greaterThan(QT_MINOR_VERSION, 5){
|
||||||
CONFIG *= qjsengine
|
CONFIG *= qjsengine
|
||||||
}
|
}
|
||||||
|
lessThan(QT_MINOR_VERSION, 6){
|
||||||
|
CONFIG *= qtscriptengine
|
||||||
|
}
|
||||||
|
}
|
||||||
lessThan(QT_MAJOR_VERSION, 5){
|
lessThan(QT_MAJOR_VERSION, 5){
|
||||||
CONFIG *= qtscriptengine
|
CONFIG *= qtscriptengine
|
||||||
}
|
}
|
||||||
@ -97,7 +104,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc
|
|||||||
|
|
||||||
LIMEREPORT_VERSION_MAJOR = 1
|
LIMEREPORT_VERSION_MAJOR = 1
|
||||||
LIMEREPORT_VERSION_MINOR = 4
|
LIMEREPORT_VERSION_MINOR = 4
|
||||||
LIMEREPORT_VERSION_RELEASE = 76
|
LIMEREPORT_VERSION_RELEASE = 78
|
||||||
|
|
||||||
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}\\\"
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QStringListModel>
|
#include <QStringListModel>
|
||||||
|
|
||||||
#ifndef HAVE_QT4
|
#ifdef BUILD_WITH_EASY_PROFILER
|
||||||
#include "easy/profiler.h"
|
#include "easy/profiler.h"
|
||||||
#else
|
#else
|
||||||
# define EASY_BLOCK(...)
|
# define EASY_BLOCK(...)
|
||||||
@ -127,7 +127,7 @@ void MainWindow::on_pushButton_clicked()
|
|||||||
report->setShowProgressDialog(false);
|
report->setShowProgressDialog(false);
|
||||||
report->designReport();
|
report->designReport();
|
||||||
EASY_END_BLOCK;
|
EASY_END_BLOCK;
|
||||||
#ifndef HAVE_QT4
|
#ifdef BUILD_WITH_EASY_PROFILER
|
||||||
profiler::dumpBlocksToFile("test.prof");
|
profiler::dumpBlocksToFile("test.prof");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -145,7 +145,7 @@ void MainWindow::on_pushButton_2_clicked()
|
|||||||
report->dataManager()->setReportVariable(ui->leVariableName->text(), ui->leVariableValue->text());
|
report->dataManager()->setReportVariable(ui->leVariableName->text(), ui->leVariableValue->text());
|
||||||
}
|
}
|
||||||
EASY_END_BLOCK;
|
EASY_END_BLOCK;
|
||||||
#ifndef HAVE_QT4
|
#ifdef BUILD_WITH_EASY_PROFILER
|
||||||
profiler::dumpBlocksToFile("test.prof");
|
profiler::dumpBlocksToFile("test.prof");
|
||||||
#endif
|
#endif
|
||||||
report->previewReport();
|
report->previewReport();
|
||||||
|
@ -77,8 +77,8 @@ void LimeReport::ItemLocationPropItem::setPropertyEditorData(QWidget *propertyEd
|
|||||||
}
|
}
|
||||||
|
|
||||||
void LimeReport::ItemLocationPropItem::setModelData(QWidget *propertyEditor, QAbstractItemModel *model, const QModelIndex &index){
|
void LimeReport::ItemLocationPropItem::setModelData(QWidget *propertyEditor, QAbstractItemModel *model, const QModelIndex &index){
|
||||||
object()->setProperty(propertyName().toLatin1(),stringToLocation(qobject_cast<ComboBoxEditor*>(propertyEditor)->text()));
|
|
||||||
model->setData(index,object()->property(propertyName().toLatin1()));
|
model->setData(index,object()->property(propertyName().toLatin1()));
|
||||||
|
setValueToObject(propertyName(), propertyValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
QString LimeReport::ItemLocationPropItem::locationToString(LimeReport::ItemDesignIntf::LocationType location) const{
|
QString LimeReport::ItemLocationPropItem::locationToString(LimeReport::ItemDesignIntf::LocationType location) const{
|
||||||
@ -92,6 +92,5 @@ LimeReport::ItemDesignIntf::LocationType LimeReport::ItemLocationPropItem::strin
|
|||||||
void LimeReport::ItemLocationPropItem::slotLocationChanged(const QString &text){
|
void LimeReport::ItemLocationPropItem::slotLocationChanged(const QString &text){
|
||||||
if ( locationToString(object()->property(propertyName().toLatin1()).toInt())!=text){
|
if ( locationToString(object()->property(propertyName().toLatin1()).toInt())!=text){
|
||||||
object()->setProperty(propertyName().toLatin1(),stringToLocation(text));
|
object()->setProperty(propertyName().toLatin1(),stringToLocation(text));
|
||||||
dynamic_cast<ComboBoxEditor*>(sender())->setTextValue(locationToString(object()->property(propertyName().toLatin1()).toInt()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -191,14 +191,27 @@ void BandDesignIntf::copyBookmarks(BandDesignIntf* sourceBand)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BandDesignIntf::setBackgroundModeProperty(BaseDesignIntf::BGMode value)
|
||||||
|
{
|
||||||
|
if (value!=backgroundMode()){
|
||||||
|
BaseDesignIntf::BGMode oldValue = backgroundMode();
|
||||||
|
setBackgroundMode(value);
|
||||||
|
notify("backgroundMode",oldValue,value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void BandDesignIntf::setBackgroundOpacity(int value)
|
||||||
|
{
|
||||||
|
if (opacity()!=value){
|
||||||
|
int oldValue = opacity();
|
||||||
|
setOpacity(value);
|
||||||
|
notify("backgroundOpacity",oldValue,value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void BandDesignIntf::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
void BandDesignIntf::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
||||||
{
|
{
|
||||||
|
prepareRect(painter, option, widget);
|
||||||
if ( !(backgroundColor() == Qt::white && backgroundBrushStyle() == SolidPattern) ) {
|
|
||||||
QBrush brush(backgroundColor(), static_cast<Qt::BrushStyle>(backgroundBrushStyle()));
|
|
||||||
brush.setTransform(painter->worldTransform().inverted());
|
|
||||||
painter->fillRect(rect(), brush);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (itemMode() & DesignMode){
|
if (itemMode() & DesignMode){
|
||||||
painter->save();
|
painter->save();
|
||||||
|
@ -106,6 +106,8 @@ class BandDesignIntf : public ItemsContainerDesignInft
|
|||||||
Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor)
|
Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor)
|
||||||
Q_PROPERTY(BrushStyle backgroundBrushStyle READ backgroundBrushStyle WRITE setBackgroundBrushStyle)
|
Q_PROPERTY(BrushStyle backgroundBrushStyle READ backgroundBrushStyle WRITE setBackgroundBrushStyle)
|
||||||
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(int backgroundOpacity READ opacity WRITE setBackgroundOpacity)
|
||||||
Q_ENUMS(BandColumnsLayoutType)
|
Q_ENUMS(BandColumnsLayoutType)
|
||||||
friend class BandMarker;
|
friend class BandMarker;
|
||||||
friend class BandNameLabel;
|
friend class BandNameLabel;
|
||||||
@ -243,6 +245,8 @@ public:
|
|||||||
void setUseAlternateBackgroundColor(bool useAlternateBackgroundColor);
|
void setUseAlternateBackgroundColor(bool useAlternateBackgroundColor);
|
||||||
void replaceGroupsFunction(BandDesignIntf *band);
|
void replaceGroupsFunction(BandDesignIntf *band);
|
||||||
qreal bottomSpace() const;
|
qreal bottomSpace() const;
|
||||||
|
void setBackgroundModeProperty(BGMode value);
|
||||||
|
void setBackgroundOpacity(int value);
|
||||||
|
|
||||||
void addBookmark(const QString& key, const QVariant& value){ m_bookmarks.insert(key, value);}
|
void addBookmark(const QString& key, const QVariant& value){ m_bookmarks.insert(key, value);}
|
||||||
QList<QString> bookmarks(){ return m_bookmarks.keys();}
|
QList<QString> bookmarks(){ return m_bookmarks.keys();}
|
||||||
|
@ -400,19 +400,21 @@ void BaseDesignIntf::prepareRect(QPainter *painter, const QStyleOptionGraphicsIt
|
|||||||
{
|
{
|
||||||
painter->save();
|
painter->save();
|
||||||
|
|
||||||
|
QRectF r = rect().adjusted(0, 0, borderLineSize(), borderLineSize());
|
||||||
QBrush brush(m_backgroundColor,static_cast<Qt::BrushStyle>(m_backgroundBrushStyle));
|
QBrush brush(m_backgroundColor,static_cast<Qt::BrushStyle>(m_backgroundBrushStyle));
|
||||||
brush.setTransform(painter->worldTransform().inverted());
|
brush.setTransform(painter->worldTransform().inverted());
|
||||||
|
|
||||||
if (isSelected() && (opacity() == 100) && (m_BGMode!=TransparentMode)) {
|
if (isSelected() && (opacity() == 100) && (m_BGMode!=TransparentMode)) {
|
||||||
painter->fillRect(rect(), brush);
|
painter->fillRect(r, brush);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (m_BGMode == OpaqueMode) {
|
if (m_BGMode == OpaqueMode) {
|
||||||
painter->setOpacity(qreal(m_opacity) / 100);
|
qreal o = (itemMode() & DesignMode) ? 0.5 : qreal(m_opacity) / 100;
|
||||||
painter->fillRect(rect(), brush);
|
painter->setOpacity(o);
|
||||||
|
painter->fillRect(r, brush);
|
||||||
} else if (itemMode() & DesignMode){
|
} else if (itemMode() & DesignMode){
|
||||||
painter->setOpacity(0.1);
|
painter->setOpacity(0.1);
|
||||||
painter->fillRect(rect(), QBrush(QPixmap(":/report/images/empty")));
|
painter->fillRect(r, QBrush(QPixmap(":/report/images/empty")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
painter->restore();
|
painter->restore();
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
#ifndef HAVE_QT4
|
#ifdef BUILD_WITH_EASY_PROFILER
|
||||||
#include "easy/profiler.h"
|
#include "easy/profiler.h"
|
||||||
#else
|
#else
|
||||||
# define EASY_BLOCK(...)
|
# define EASY_BLOCK(...)
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
#include "lrpreviewreportwidget.h"
|
#include "lrpreviewreportwidget.h"
|
||||||
#include "lrpreviewreportwidget_p.h"
|
#include "lrpreviewreportwidget_p.h"
|
||||||
|
|
||||||
#ifndef HAVE_QT4
|
#ifdef BUILD_WITH_EASY_PROFILER
|
||||||
#include "easy/profiler.h"
|
#include "easy/profiler.h"
|
||||||
#else
|
#else
|
||||||
# define EASY_BLOCK(...)
|
# define EASY_BLOCK(...)
|
||||||
|
@ -346,8 +346,8 @@ void ScriptEngineManager::setDataManager(DataSourceManager *dataManager){
|
|||||||
LimeReport::Const::FUNCTION_MANAGER_NAME,
|
LimeReport::Const::FUNCTION_MANAGER_NAME,
|
||||||
m_functionManager,
|
m_functionManager,
|
||||||
QString("function %1(fieldName, bandName, pageitem){\
|
QString("function %1(fieldName, bandName, pageitem){\
|
||||||
pageitem = typeof pageitem !== 'undefined' ? pageitem : 0; \
|
if (typeof pageitem == 'undefined') return %2.calcGroupFunction(\"%1\", fieldName, bandName); \
|
||||||
return %2.calcGroupFunction(\"%1\",fieldName, bandName, pageitem);}"
|
else return %2.calcGroupFunction(\"%1\", fieldName, bandName, pageitem);}"
|
||||||
).arg(func)
|
).arg(func)
|
||||||
.arg(LimeReport::Const::FUNCTION_MANAGER_NAME)
|
.arg(LimeReport::Const::FUNCTION_MANAGER_NAME)
|
||||||
);
|
);
|
||||||
@ -1471,6 +1471,11 @@ QVariant ScriptFunctionsManager::calcGroupFunction(const QString &name, const QS
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QVariant ScriptFunctionsManager::calcGroupFunction(const QString& name, const QString& expressionID, const QString& bandName)
|
||||||
|
{
|
||||||
|
return calcGroupFunction(name, expressionID, bandName, 0);
|
||||||
|
}
|
||||||
|
|
||||||
QVariant ScriptFunctionsManager::line(const QString &bandName)
|
QVariant ScriptFunctionsManager::line(const QString &bandName)
|
||||||
{
|
{
|
||||||
QString varName = QLatin1String("line_")+bandName.toLower();
|
QString varName = QLatin1String("line_")+bandName.toLower();
|
||||||
|
@ -307,6 +307,7 @@ public:
|
|||||||
foreach(IWrapperCreator* wrapper, m_wrappersFactory.values()){ delete wrapper;} m_wrappersFactory.clear();
|
foreach(IWrapperCreator* wrapper, m_wrappersFactory.values()){ delete wrapper;} m_wrappersFactory.clear();
|
||||||
}
|
}
|
||||||
Q_INVOKABLE QVariant calcGroupFunction(const QString& name, const QString& expressionID, const QString& bandName, QObject* currentPage);
|
Q_INVOKABLE QVariant calcGroupFunction(const QString& name, const QString& expressionID, const QString& bandName, QObject* currentPage);
|
||||||
|
Q_INVOKABLE QVariant calcGroupFunction(const QString& name, const QString& expressionID, const QString& bandName);
|
||||||
Q_INVOKABLE QVariant line(const QString& bandName);
|
Q_INVOKABLE QVariant line(const QString& bandName);
|
||||||
Q_INVOKABLE QVariant numberFormat(QVariant value, const char &format, int precision, const QString &locale);
|
Q_INVOKABLE QVariant numberFormat(QVariant value, const char &format, int precision, const QString &locale);
|
||||||
Q_INVOKABLE QVariant dateFormat(QVariant value, const QString& format);
|
Q_INVOKABLE QVariant dateFormat(QVariant value, const QString& format);
|
||||||
|
@ -35,7 +35,8 @@
|
|||||||
namespace LimeReport{
|
namespace LimeReport{
|
||||||
|
|
||||||
ObjectBrowser::ObjectBrowser(QWidget *parent)
|
ObjectBrowser::ObjectBrowser(QWidget *parent)
|
||||||
:QWidget(parent), m_report(NULL), m_mainWindow(NULL), m_changingItemSelection(false)
|
:QWidget(parent), m_report(NULL), m_mainWindow(NULL),
|
||||||
|
m_changingItemSelection(false), m_movingItem(false)
|
||||||
{
|
{
|
||||||
QVBoxLayout *layout = new QVBoxLayout(this);
|
QVBoxLayout *layout = new QVBoxLayout(this);
|
||||||
setLayout(layout);
|
setLayout(layout);
|
||||||
@ -86,6 +87,7 @@ void ObjectBrowser::slotClear()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ObjectBrowser::fillNode(QTreeWidgetItem* parentNode, BaseDesignIntf* reportItem, BaseDesignIntf *ignoredItem){
|
void ObjectBrowser::fillNode(QTreeWidgetItem* parentNode, BaseDesignIntf* reportItem, BaseDesignIntf *ignoredItem){
|
||||||
|
|
||||||
foreach (BaseDesignIntf* item, reportItem->childBaseItems()) {
|
foreach (BaseDesignIntf* item, reportItem->childBaseItems()) {
|
||||||
if (item != ignoredItem){
|
if (item != ignoredItem){
|
||||||
ObjectBrowserNode* treeItem = new ObjectBrowserNode(parentNode);
|
ObjectBrowserNode* treeItem = new ObjectBrowserNode(parentNode);
|
||||||
@ -93,11 +95,11 @@ void ObjectBrowser::fillNode(QTreeWidgetItem* parentNode, BaseDesignIntf* report
|
|||||||
treeItem->setObject(item);
|
treeItem->setObject(item);
|
||||||
treeItem->setIcon(0,QIcon(":/items/"+extractClassName(item->metaObject()->className())));
|
treeItem->setIcon(0,QIcon(":/items/"+extractClassName(item->metaObject()->className())));
|
||||||
connect(item, SIGNAL(propertyObjectNameChanged(QString,QString)),
|
connect(item, SIGNAL(propertyObjectNameChanged(QString,QString)),
|
||||||
this, SLOT(slotPropertyObjectNameChanged(QString,QString)));
|
this, SLOT(slotPropertyObjectNameChanged(QString,QString)), Qt::UniqueConnection);
|
||||||
ItemDesignIntf* i = dynamic_cast<ItemDesignIntf*>(item);
|
ItemDesignIntf* i = dynamic_cast<ItemDesignIntf*>(item);
|
||||||
if (i){
|
if (i){
|
||||||
connect(i, SIGNAL(itemLocationChanged(BaseDesignIntf*,BaseDesignIntf*)),
|
connect(i, SIGNAL(itemLocationChanged(BaseDesignIntf*,BaseDesignIntf*)),
|
||||||
this, SLOT(slotItemParentChanged(BaseDesignIntf*,BaseDesignIntf*)));
|
this, SLOT(slotItemParentChanged(BaseDesignIntf*,BaseDesignIntf*)), Qt::UniqueConnection);
|
||||||
}
|
}
|
||||||
m_itemsMap.insert(item,treeItem);
|
m_itemsMap.insert(item,treeItem);
|
||||||
parentNode->addChild(treeItem);
|
parentNode->addChild(treeItem);
|
||||||
@ -283,7 +285,9 @@ void ObjectBrowser::slotActivePageUpdated(LimeReport::PageDesignIntf *)
|
|||||||
buildTree();
|
buildTree();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectBrowser::slotItemParentChanged(BaseDesignIntf* item, BaseDesignIntf* parent)
|
|
||||||
|
|
||||||
|
void ObjectBrowser::moveItemNode(BaseDesignIntf* item, BaseDesignIntf* parent)
|
||||||
{
|
{
|
||||||
if (m_itemsMap.contains(item) && m_itemsMap.contains(parent)){
|
if (m_itemsMap.contains(item) && m_itemsMap.contains(parent)){
|
||||||
m_itemsMap.value(item)->parent()->removeChild(m_itemsMap.value(item));
|
m_itemsMap.value(item)->parent()->removeChild(m_itemsMap.value(item));
|
||||||
@ -293,7 +297,24 @@ void ObjectBrowser::slotItemParentChanged(BaseDesignIntf* item, BaseDesignIntf*
|
|||||||
item->setSelected(true);
|
item->setSelected(true);
|
||||||
m_changingItemSelection = false;
|
m_changingItemSelection = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ObjectBrowser::slotItemParentChanged(BaseDesignIntf* item, BaseDesignIntf* parent)
|
||||||
|
{
|
||||||
|
if (!m_movingItem){
|
||||||
|
m_movingItem = true;
|
||||||
|
moveItemNode(item, parent);
|
||||||
|
m_movingItem = false;
|
||||||
|
foreach(QObject* di, m_defferedItems){
|
||||||
|
BaseDesignIntf* b = dynamic_cast<BaseDesignIntf*>(di);
|
||||||
|
if (b)
|
||||||
|
moveItemNode(b, parent);
|
||||||
|
}
|
||||||
|
m_defferedItems.clear();
|
||||||
|
} else {
|
||||||
|
if (!m_defferedItems.contains(item))
|
||||||
|
m_defferedItems.append(item);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectBrowserNode::setObject(QObject *value)
|
void ObjectBrowserNode::setObject(QObject *value)
|
||||||
|
@ -60,6 +60,7 @@ protected:
|
|||||||
void buildTree(BaseDesignIntf *ignoredItem = 0);
|
void buildTree(BaseDesignIntf *ignoredItem = 0);
|
||||||
void removeItem(BaseDesignIntf* item);
|
void removeItem(BaseDesignIntf* item);
|
||||||
void findAndRemove(QTreeWidgetItem *node, BaseDesignIntf *item);
|
void findAndRemove(QTreeWidgetItem *node, BaseDesignIntf *item);
|
||||||
|
void moveItemNode(BaseDesignIntf* item, BaseDesignIntf* parent);
|
||||||
private slots:
|
private slots:
|
||||||
// void slotObjectNameChanged(const QString& objectName);
|
// void slotObjectNameChanged(const QString& objectName);
|
||||||
void slotPropertyObjectNameChanged(const QString& oldName, const QString& newName);
|
void slotPropertyObjectNameChanged(const QString& oldName, const QString& newName);
|
||||||
@ -82,6 +83,8 @@ private:
|
|||||||
QTreeWidget* m_treeView;
|
QTreeWidget* m_treeView;
|
||||||
QMap<QObject*, ObjectBrowserNode*> m_itemsMap;
|
QMap<QObject*, ObjectBrowserNode*> m_itemsMap;
|
||||||
bool m_changingItemSelection;
|
bool m_changingItemSelection;
|
||||||
|
bool m_movingItem;
|
||||||
|
QList<QObject*> m_defferedItems;
|
||||||
};
|
};
|
||||||
|
|
||||||
} //namespace LimeReport
|
} //namespace LimeReport
|
||||||
|
@ -272,7 +272,8 @@ void ReportStructureCompleater::updateCompleaterModel(ReportEnginePrivateInterfa
|
|||||||
{
|
{
|
||||||
if (report){
|
if (report){
|
||||||
m_model.clear();
|
m_model.clear();
|
||||||
|
QIcon signalIcon(":/report/images/signal");
|
||||||
|
QIcon propertyIcon(":/report/images/property");
|
||||||
addAdditionalDatawords(report->dataManager());
|
addAdditionalDatawords(report->dataManager());
|
||||||
|
|
||||||
for ( int i = 0; i < report->pageCount(); ++i){
|
for ( int i = 0; i < report->pageCount(); ++i){
|
||||||
@ -283,18 +284,18 @@ void ReportStructureCompleater::updateCompleaterModel(ReportEnginePrivateInterfa
|
|||||||
itemNode->setIcon(QIcon(":/report/images/object"));
|
itemNode->setIcon(QIcon(":/report/images/object"));
|
||||||
m_model.invisibleRootItem()->appendRow(itemNode);
|
m_model.invisibleRootItem()->appendRow(itemNode);
|
||||||
|
|
||||||
QStringList items = extractSlotNames(page->pageItem());
|
QStringList items = extractSignalNames(page->pageItem());
|
||||||
foreach(QString slotName, items){
|
foreach(QString slotName, items){
|
||||||
QStandardItem* slotItem = new QStandardItem;
|
QStandardItem* slotItem = new QStandardItem;
|
||||||
slotItem->setText(slotName);
|
slotItem->setText(slotName);
|
||||||
slotItem->setIcon(QIcon(":/report/images/signal"));
|
slotItem->setIcon(signalIcon);
|
||||||
itemNode->appendRow(slotItem);
|
itemNode->appendRow(slotItem);
|
||||||
}
|
}
|
||||||
items = extractPropertyes(page->pageItem());
|
items = extractProperties(page->pageItem());
|
||||||
foreach(QString propertyName, items){
|
foreach(QString propertyName, items){
|
||||||
QStandardItem* properyItem = new QStandardItem;
|
QStandardItem* properyItem = new QStandardItem;
|
||||||
properyItem->setText(propertyName);
|
properyItem->setText(propertyName);
|
||||||
properyItem->setIcon(QIcon(":/report/images/property"));
|
properyItem->setIcon(propertyIcon);
|
||||||
itemNode->appendRow(properyItem);
|
itemNode->appendRow(properyItem);
|
||||||
}
|
}
|
||||||
foreach (BaseDesignIntf* item, page->pageItem()->childBaseItems()){
|
foreach (BaseDesignIntf* item, page->pageItem()->childBaseItems()){
|
||||||
@ -311,7 +312,7 @@ void ReportStructureCompleater::updateCompleaterModel(DataSourceManager *dataMan
|
|||||||
addAdditionalDatawords(dataManager);
|
addAdditionalDatawords(dataManager);
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList ReportStructureCompleater::extractSlotNames(BaseDesignIntf *item)
|
QStringList ReportStructureCompleater::extractSignalNames(BaseDesignIntf *item)
|
||||||
{
|
{
|
||||||
QStringList result;
|
QStringList result;
|
||||||
if (!item) return result;
|
if (!item) return result;
|
||||||
@ -333,7 +334,7 @@ QStringList ReportStructureCompleater::extractSlotNames(BaseDesignIntf *item)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList ReportStructureCompleater::extractPropertyes(BaseDesignIntf *item)
|
QStringList ReportStructureCompleater::extractProperties(BaseDesignIntf *item)
|
||||||
{
|
{
|
||||||
QStringList result;
|
QStringList result;
|
||||||
if (!item) return result;
|
if (!item) return result;
|
||||||
@ -353,24 +354,43 @@ void ReportStructureCompleater::addChildItem(BaseDesignIntf *item, const QString
|
|||||||
{
|
{
|
||||||
if (!item) return;
|
if (!item) return;
|
||||||
|
|
||||||
|
QIcon signalIcon(":/report/images/signal");
|
||||||
|
QIcon propertyIcon(":/report/images/property");
|
||||||
|
|
||||||
QStandardItem* itemNode = new QStandardItem;
|
QStandardItem* itemNode = new QStandardItem;
|
||||||
itemNode->setText(pageName+"_"+item->objectName());
|
itemNode->setText(pageName+"_"+item->objectName());
|
||||||
itemNode->setIcon(QIcon(":/report/images/object"));
|
itemNode->setIcon(QIcon(":/report/images/object"));
|
||||||
parent->appendRow(itemNode);
|
parent->appendRow(itemNode);
|
||||||
QStringList items = extractSlotNames(item);
|
QStringList items;
|
||||||
|
|
||||||
|
if (!m_signals.contains(item->metaObject()->className())){
|
||||||
|
items = extractSignalNames(item);
|
||||||
|
m_signals.insert(item->metaObject()->className(),items);
|
||||||
|
} else {
|
||||||
|
items = m_signals.value(item->metaObject()->className());
|
||||||
|
}
|
||||||
|
|
||||||
foreach(QString slotName, items){
|
foreach(QString slotName, items){
|
||||||
QStandardItem* slotItem = new QStandardItem;
|
QStandardItem* slotItem = new QStandardItem;
|
||||||
slotItem->setText(slotName);
|
slotItem->setText(slotName);
|
||||||
slotItem->setIcon(QIcon(":/report/images/signal"));
|
slotItem->setIcon(signalIcon);
|
||||||
itemNode->appendRow(slotItem);
|
itemNode->appendRow(slotItem);
|
||||||
}
|
}
|
||||||
items = extractPropertyes(item);
|
|
||||||
|
if (!m_properties.contains(item->metaObject()->className())){
|
||||||
|
items = extractProperties(item);
|
||||||
|
m_properties.insert(item->metaObject()->className(),items);
|
||||||
|
} else {
|
||||||
|
items = m_properties.value(item->metaObject()->className());
|
||||||
|
}
|
||||||
|
|
||||||
foreach(QString propertyName, items){
|
foreach(QString propertyName, items){
|
||||||
QStandardItem* properyItem = new QStandardItem;
|
QStandardItem* properyItem = new QStandardItem;
|
||||||
properyItem->setText(propertyName);
|
properyItem->setText(propertyName);
|
||||||
properyItem->setIcon(QIcon(":/report/images/property"));
|
properyItem->setIcon(propertyIcon);
|
||||||
itemNode->appendRow(properyItem);
|
itemNode->appendRow(properyItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (BaseDesignIntf* child, item->childBaseItems()){
|
foreach (BaseDesignIntf* child, item->childBaseItems()){
|
||||||
addChildItem(child, pageName, parent);
|
addChildItem(child, pageName, parent);
|
||||||
}
|
}
|
||||||
|
@ -33,12 +33,14 @@ public:
|
|||||||
void updateCompleaterModel(ReportEnginePrivateInterface* report);
|
void updateCompleaterModel(ReportEnginePrivateInterface* report);
|
||||||
void updateCompleaterModel(DataSourceManager* dataManager);
|
void updateCompleaterModel(DataSourceManager* dataManager);
|
||||||
protected:
|
protected:
|
||||||
QStringList extractSlotNames(BaseDesignIntf* item);
|
QStringList extractSignalNames(BaseDesignIntf* item);
|
||||||
QStringList extractPropertyes(BaseDesignIntf* item);
|
QStringList extractProperties(BaseDesignIntf* item);
|
||||||
void addChildItem(BaseDesignIntf *item, const QString &pageName, QStandardItem *parent);
|
void addChildItem(BaseDesignIntf *item, const QString &pageName, QStandardItem *parent);
|
||||||
void addAdditionalDatawords(DataSourceManager *dataManager);
|
void addAdditionalDatawords(DataSourceManager *dataManager);
|
||||||
private:
|
private:
|
||||||
QStandardItemModel m_model;
|
QStandardItemModel m_model;
|
||||||
|
QMap<QString, QStringList> m_properties;
|
||||||
|
QMap<QString, QStringList> m_signals;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ScriptEditor : public QWidget
|
class ScriptEditor : public QWidget
|
||||||
|
@ -36,7 +36,8 @@
|
|||||||
#include "lrreporttranslation.h"
|
#include "lrreporttranslation.h"
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#ifndef HAVE_QT4
|
|
||||||
|
#ifdef BUILD_WITH_EASY_PROFILER
|
||||||
#include "easy/profiler.h"
|
#include "easy/profiler.h"
|
||||||
#else
|
#else
|
||||||
# define EASY_BLOCK(...)
|
# define EASY_BLOCK(...)
|
||||||
|
Loading…
Reference in New Issue
Block a user