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:
@@ -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;
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user