24 #ifndef PARAMETERFILEMODEL_H_
25 #define PARAMETERFILEMODEL_H_
27 #include <QAbstractTableModel>
28 #include <QStringList>
53 QString
fileName = "", QObject* parent = 0, QString metaFile = "");
65 virtual
int rowCount(const QModelIndex& parent = QModelIndex()) const;
71 virtual
int columnCount(const QModelIndex& parent = QModelIndex()) const;
79 virtual QVariant
data(
80 const QModelIndex& index,
int role = Qt::DisplayRole) const;
91 const QModelIndex& index, const QVariant& value,
92 int role = Qt::EditRole);
98 virtual Qt::ItemFlags
flags (const QModelIndex& index) const;
107 int section, Qt::Orientation orientation,
108 int role = Qt::DisplayRole) const;
119 const QModelIndex& parent = QModelIndex());
130 const QModelIndex& parent = QModelIndex());
132 virtual Qt::DropActions supportedDropActions() const;
134 virtual QStringList mimeTypes() const;
136 virtual
bool dropMimeData(const QMimeData *
data, Qt::DropAction action,
137 int row,
int column, const QModelIndex &parent);
154 QString fileName() const;
187 QString
getClass(QString objName,
bool fixCase = false) const;
195 QString
getType(QString parName,
bool applyTmplType = true) const;
201 QString
getDoc(QString parName) const;
207 QStringList
getInputs(QString objName) const;
219 QStringList
getOutputs(QString objName) const;
264 QString
getValue(QString parName) const;
270 void setValue(QString parName, QString value);
273 bool isSet(QString parName) const;
278 void erase(QString parName);
282 bool rename(QString oldPrefix, QString newPrefix);
326 virtual
void setFileName(const QString& fileName);
332 virtual QString
setPrefix(const QString& prefix);
358 virtual
bool load(const QString& fName = "");
361 virtual
void clear();
368 virtual
void save(const QString& fileName = "");
373 virtual
bool _load();
380 const QModelIndex &bottomRight);
bool _handleDynamics
handle dynamics by calling update-dynamics process
void setOnlyParams(bool value)
Set property _onlyparams.
void reactivate()
Reactivate all following plugins.
void commentChanged(QString comment)
inform about editor comment change
void statusMessage(const QString &msg)
send status message
void erase(QString parName)
Delete a parameter from the the underlying parameter file.
virtual void save(const QString &fileName="")
Save model content to a text file.
void setMinPriority(int value)
Set property _minPriority.
virtual void _update()
Update content (e.g. when prefix has changed)
QParameterFile * _parameterFile
Pointer to the ParameterFile instance storing the model content.
virtual QString setPrefix(const QString &prefix)
Change prefix.
void setHandleDynamics(bool)
set _handleDynamics
bool rename(QString oldPrefix, QString newPrefix)
rename prefix
bool _useMetaInfo
toggle usage of metadata
void dynamicUpdate()
inform about dynamic plugin update
QStringList getClasses() const
get classes contained in metadata file
bool metaInfoValid() const
check for available metaInfos
QString getValue(QString parName) const
Get a parameter from the underlying parameter file.
void fileNameChanged(QString fileName)
Property _fileName has changed.
QString _fileName
Store filename of the model data file.
const QParameterFile & parameterFile() const
Get const pointer of ParameterFile.
QMutex * _resetMutex
avoid multiple reset model calls
QString getDefault(QString parName) const
pass to metaInfo, use dynamic metadata if needed
int _minPriority
minimum priority to be listed
void _updateDynamics()
update dynamic objects
QStringList getInputs(QString objName) const
Get input slots of object.
QString prefix() const
Get property _prefix.
QMap< QString, QString > _classCaseMap
map to fix class name cases
QStringList getOutputs(QString objName) const
Get output slots of object.
QStringList getOutputDisplayNames(QString objName) const
Get output slots of object.
virtual void loadMetaInfo(const QString &fileName)
load metaFile
QStringList _keys
Cache stored parameter names.
virtual void _updatePriority(const QModelIndex &topLeft, const QModelIndex &bottomRight)
Update filter if priority changed.
QString getClass(QString objName, bool fixCase=false) const
get class of some given object
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const
Return number of table rows.
virtual bool insertRows(int row, int count, const QModelIndex &parent=QModelIndex())
Add data to the model.
bool isMultiSlot(QString name) const
Check if some slot is a multi slot.
const MetaData * _metaInfos
ParameterFile describing classes and in-/output slots.
QStringList getInputDisplayNames(QString objName) const
Get input slots of object.
bool isParameter(QString name) const
Check if some parameter/slot is a parameter.
Qt implementation for ParameterFile class.
This model serves to provide a model frontend to access a ParameterFile instance. ...
virtual QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Access to item content.
virtual QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Data for the table headers.
bool isSet(QString parName) const
pass to QParameterFile::isSet
bool _onlyParams
only show configurable parameters
bool prefixValid() const
Check prefix.
void deactivate()
Deactivate all following plugins.
void useMetaInfoChanged(bool value)
Property _useMetadata changed.
virtual void setFileName(const QString &fileName)
Set new value for Property _fileName.
QStringList _prefixFilter(QStringList list) const
filter keys starting with the given prefix
void prefixChanged(const QString &prefix)
Property _prefix has changed.
virtual bool load(const QString &fName="")
Load model content from parameterFile.
QString fileName() const
Get property _fileName.
QString getDoc(QString parName) const
pass to metaInfo, use dynamic metadata if needed
bool active() const
Returns the bool value of the Active Parameter.
QStringList _collectObjects(QStringList list) const
Return set of objects contained in given parameter list.
virtual Qt::ItemFlags flags(const QModelIndex &index) const
Item flags (editable etc).
bool isOutputSlot(QString name) const
Check if some parameter/slot is an output slot.
void minPriorityChanged(int value)
Property _minPriority changed.
void reactivatePreviousPlugins()
Reactivates all previous plugins.
void setValue(QString parName, QString value)
Set a parameter in the underlying parameter file.
Validator for prefix edit widgets.
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const
Return number of table columns.
bool useMetaInfo() const
Get property _useMetadata;.
void metaInfoChanged(bool valid)
New metadata have been loaded.
void modified(bool val)
inform about modifications
virtual bool _load()
Load data without showing OpenFile Dialog.
bool onlyParams() const
Get property _onlyparams.
void setUseMetaInfo(bool value)
Set property _useMetadata.
void onlyParamsChanged(bool value)
Property _onlyParams changed.
virtual void clear()
Clear ParameterFile content.
QString _getDynamicMetaFile(QString objName) const
creates path to dynamic meta info file for object
QStringList _paramFilter(QStringList list) const
filter keys listed in the classes parameter section
QString getType(QString parName, bool applyTmplType=true) const
Get type of some parameter or slot.
QStringList getParameters(QString objName) const
Get parameters of object.
virtual bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex())
Remove data from the model.
int minPriority() const
Get property _minPriority.
bool isInputSlot(QString name) const
Check if some parameter/slot is an input slot.
virtual bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
Set item content.
QStringList _priorityTagFilter(QStringList list) const
filter keys containing priority information
QStringList _priorityFilter(QStringList list) const
filter keys depending on their priority
QString _prefix
Parameter prefix.