Commit b6ed8e92 authored by Jan Möbius's avatar Jan Möbius

Merge branch 'feature-slotClear' into 'master'

implement slotClear to clear a single prop visualisation

See merge request !18
parents 179a4cac 0ea3c4e5
......@@ -139,6 +139,28 @@ void PropertyVisPlugin::slotVisualizeProperty( int _id, const QString& _propname
}
}
void PropertyVisPlugin::slotClear(int _id, const QString &_propname)
{
PropertyModel* model = PropertyModelFactory::Instance().getModel(_id);
if (model != 0)
{
model->gatherProperties();
QModelIndex idx = model->indexFromPlainPropName(_propname);
if (idx.isValid())
{
QModelIndexList list;
list.append(idx);
model->clear(list);
emit updateView();
emit updatedObject( _id, UPDATE_COLOR );
}
}
}
QScriptValue PropertyVisPlugin::getPropertyVisualizer(int _id, const QString &_propname)
{
PropertyModel* model = PropertyModelFactory::Instance().getModel(_id);
......
......@@ -149,7 +149,16 @@ private slots:
public slots:
/// Visualise a property on object _id with the given name.
/// Note that for multiple properties with the same name (i.e., different
/// data types or entity types), there is no guarantee which one is used.
void slotVisualizeProperty( int _id, const QString& _propname );
/// Remove visualisation of a property on object _id with the given name.
/// Note that for multiple properties with the same name (i.e., different
/// data types or entity types), there is no guarantee which one is used.
void slotClear( int _id, const QString& _propname );
QScriptValue getPropertyVisualizer( int _id, const QString& _propname );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment