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:
parent
ebde2c1c20
commit
2768d13301
@ -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 )
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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:
|
||||
|
@ -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){
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user