0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-23 16:22:58 +03:00

Property editing of multi selected objects has been fixed

This commit is contained in:
Arin Alexander 2016-10-19 01:26:40 +03:00
parent ebde2c1c20
commit 2768d13301
5 changed files with 14 additions and 9 deletions

View File

@ -743,6 +743,7 @@ void ReportDesignWindow::slotItemSelected(LimeReport::BaseDesignIntf *item)
m_objectInspector->commitActiveEditorData();
m_propertyModel->setObject(item);
if (m_propertyModel->subclassesAsLevel())
m_objectInspector->expandToDepth(0);
@ -777,7 +778,7 @@ void ReportDesignWindow::slotItemSelected(LimeReport::BaseDesignIntf *item)
m_fontEditorBar->setItem(item);
m_textAlignmentEditorBar->setItem(item);
m_itemsBordersEditorBar->setItem(item);
}
} else {m_propertyModel->clearObjectsList();}
}
void ReportDesignWindow::slotItemPropertyChanged(const QString &objectName, const QString &propertyName, const QVariant& oldValue, const QVariant& newValue )

View File

@ -85,6 +85,11 @@ void QObjectPropertyModel::translatePropertyName()
tr("shapeBrushColor");
}
void QObjectPropertyModel::clearObjectsList()
{
m_objects.clear();
}
QObjectPropertyModel::QObjectPropertyModel(QObject *parent/*=0*/)
:QAbstractItemModel(parent),m_rootNode(0),m_object(0),m_dataChanging(false), m_subclassesAsLevel(true), m_validator(0)
{}
@ -354,13 +359,9 @@ void QObjectPropertyModel::addObjectProperties(const QMetaObject *metaObject, QO
objectNode = m_rootNode;
}
//m_rootNode->appendItem(objectNode);
for (int i=metaObject->propertyOffset();i<metaObject->propertyCount();i++){
if (metaObject->property(i).isDesignable()){
ObjectPropItem* prop=createPropertyItem(metaObject->property(i),object,objects,objectNode);
//ObjectPropItem* prop=createPropertyItem(metaObject->property(i),object,objects,m_rootNode);
//m_rootNode->appendItem(prop);
objectNode->appendItem(prop);
}
}

View File

@ -71,6 +71,7 @@ public:
ValidatorIntf* validator() const;
void setValidator(ValidatorIntf* validator);
void translatePropertyName();
void clearObjectsList();
signals:
void objectPropetyChanged(const QString& , const QVariant&, const QVariant&);
private slots:

View File

@ -46,7 +46,8 @@ ObjectPropItem::ObjectPropItem(QObject *object, ObjectsList* objects, const QStr
{
if (parent) setModel(parent->model());
m_index=QModelIndex();
if (objects) foreach(QObject* item, *objects) m_objects.append(item);
//if (objects) foreach(QObject* item, *objects) m_objects.append(item);
m_objects = objects;
#ifdef INSPECT_BASEDESIGN
BaseDesignIntf * item = dynamic_cast<BaseDesignIntf*>(object);
if (item){
@ -63,7 +64,8 @@ ObjectPropItem::ObjectPropItem(QObject *object, ObjectsList* objects, const QStr
{
if (parent) setModel(parent->model());
m_index=QModelIndex();
if (objects) foreach(QObject* item, *objects) m_objects.append(item);
//if (objects) foreach(QObject* item, *objects) m_objects.append(item);
m_objects = objects;
#ifdef INSPECT_BASEDESIGN
BaseDesignIntf * item = dynamic_cast<BaseDesignIntf*>(object);
if (item){

View File

@ -73,7 +73,7 @@ namespace LimeReport{
ObjectPropItem* parent() const{ return m_parent;}
QObject* object() const{return m_object;}
ObjectsList* objects() {return &m_objects;}
ObjectsList* objects() {return m_objects;}
ObjectPropItem* child(int row);
QList<ObjectPropItem*> children(){return m_childItems;}
ObjectPropItem* findChild(const QString& propertyName);
@ -106,7 +106,7 @@ namespace LimeReport{
void setValueToObject(const QString& propertyName, QVariant propertyValue);
private:
QObject* m_object;
ObjectsList m_objects;
ObjectsList* m_objects;
QString m_name;
QString m_displayName;
QVariant m_value;