use setProperty with QString instead of char*
As a | CEP developer |
I would like | a setProperty with const QString name instead of const char * name
|
To | improve camitk code consistency |
Epic/Topics | Property setProperty QString char* |
Description / Overview
I noticed that the QObject::setProperty
method prototype demands a const char *
type for the first argument whereas the camitk::Property
constructor and the getProperty
method use a QString
type.
I think it might be a good idea to implement a method looking like
//PropertyObject.h
virtual bool setProperty(const QString name, const QVariant &value);
//PropertyObject.cpp
bool PropertyObject::setProperty(const QString name, const QVariant &value) {
if (propertiesMap.contains(name)) {
return setProperty(name.toStdString().c_str(), value);
}
else {
return false;
}
}
, to be re-implemented in component and action.
(just like getPropertyValue
(which I think should be re-implemented in component and action too (for the same reason)))
This would allow manipulating camitk properties only with QStrings and not with a mix of qstrings and char* types depending on the method being used.
Acceptance tests
- SetProperty works with QString One is able to set a property with the setProperty method using a QSting for the first argument
- All uses of setProperty in CamiTK and CEPs are updated CamiTK and CEPs compile without errors regarding the setProperty method
Track
One (or two) of:
Misc
- Automatic subscription of issue creator:
Do not forget to mark this issue as "confidential" by checking the tick box below (if appropriate)
Edited by Matthias Tummers