0
0
mirror of https://github.com/fralx/LimeReport.git synced 2025-10-04 20:07:54 +03:00

Fixed defined objectname changed after pasting items

This commit is contained in:
yanis60
2023-02-03 15:55:36 +01:00
parent 98ac5ce37f
commit 5e91fb0c33
62 changed files with 2760 additions and 2271 deletions

View File

@@ -30,6 +30,7 @@
#ifndef LRSTORAGEINTF_H
#define LRSTORAGEINTF_H
#include "lrglobal.h"
#include <QSharedPointer>
class QString;
@@ -37,14 +38,14 @@ class QObject;
namespace LimeReport{
class ObjectLoadingStateIntf{
class LIMEREPORT_EXPORT ObjectLoadingStateIntf{
public:
virtual bool isLoading() = 0;
virtual void objectLoadStarted() = 0;
virtual void objectLoadFinished() = 0;
};
class ItemsWriterIntf
class LIMEREPORT_EXPORT ItemsWriterIntf
{
public:
virtual void putItem(QObject* item) = 0;
@@ -55,7 +56,7 @@ public:
virtual ~ItemsWriterIntf(){}
};
class ItemsReaderIntf
class LIMEREPORT_EXPORT ItemsReaderIntf
{
public:
typedef QSharedPointer<ItemsReaderIntf> Ptr;

View File

@@ -193,13 +193,23 @@ bool XMLWriter::enumOrFlag(QString name, QObject *item)
bool XMLWriter::isCollection(QString propertyName, QObject* item)
{
QMetaProperty prop=item->metaObject()->property(item->metaObject()->indexOfProperty(propertyName.toLatin1()));
return QMetaType::type(prop.typeName())==COLLECTION_TYPE_ID;
//TODO: Migrate to QMetaType
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
return QMetaType::fromName(prop.typeName()).id() == COLLECTION_TYPE_ID;
#else
return QMetaType::type(prop.typeName()) == COLLECTION_TYPE_ID;
#endif
}
bool XMLWriter::isTranslation(QString propertyName, QObject* item)
{
QMetaProperty prop=item->metaObject()->property(item->metaObject()->indexOfProperty(propertyName.toLatin1()));
return QMetaType::type(prop.typeName())==TRANSLATION_TYPE_ID;
//TODO: Migrate to QMetaType
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
return QMetaType::fromName(prop.typeName()).id() == TRANSLATION_TYPE_ID;
#else
return QMetaType::type(prop.typeName()) == TRANSLATION_TYPE_ID;
#endif
}
void XMLWriter::saveCollection(QString propertyName, QObject *item, QDomElement *node)
@@ -254,7 +264,13 @@ void XMLWriter::saveTranslation(QString propertyName, QObject* item, QDomElement
bool XMLWriter::isQObject(QString propertyName, QObject *item)
{
QMetaProperty prop=item->metaObject()->property(item->metaObject()->indexOfProperty(propertyName.toLatin1()));
return QMetaType::type(prop.typeName())==QMetaType::QObjectStar;
//TODO: Migrate to QMetaType
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
return QMetaType::fromName(prop.typeName()).id() == QMetaType::QObjectStar;
#else
return QMetaType::type(prop.typeName()) == QMetaType::QObjectStar;
#endif
}
bool XMLWriter::replaceNode(QDomElement node, QObject* item)