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

Merge branch 'master' into 1.4

This commit is contained in:
Arin Alexander 2016-10-19 01:26:52 +03:00
commit 503329bca2
5 changed files with 14 additions and 9 deletions

View File

@ -791,6 +791,7 @@ void ReportDesignWindow::slotItemSelected(LimeReport::BaseDesignIntf *item)
m_objectInspector->commitActiveEditorData();
m_propertyModel->setObject(item);
if (m_propertyModel->subclassesAsLevel())
m_objectInspector->expandToDepth(0);
@ -825,7 +826,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;