48 const QString pname =
property->propName();
54 (*it).object->setProperty((*it).targetName, newValue);
55 }
else if ((*it).target ==
Slot) {
59 qWarning()<<KLF_FUNC_NAME<<
": Unknown target type "<<(*it).target<<
" !";
95 klfDbg(
"Connecting prop "<<configPropertyName<<
" to object "<<
object<<
", targettype="<<target
96 <<
", targetName="<<targetName ) ;
101 if ((*it)->propName() == configPropertyName) {
106 KLF_ASSERT_NOT_NULL(p,
"Invalid config property name: "<<configPropertyName<<
".",
return; ) ;
111 c.targetName = targetName;
117 qWarning()<<KLF_FUNC_NAME<<
": "<<configPropertyName<<
" already connected to "<<
object<<
"/"<<targetName;
127 object->setProperty(targetName, value);
128 }
else if (c.target ==
Slot) {
145 klfDbg(
"removed QObject-connection target-type "<<(*it).target<<
", target-name "<<(*it).targetName) ;
151 qWarning()<<KLF_FUNC_NAME<<
": "<<configPropertyName<<
" is not connected to "<<
object<<
"/"<<targetName;
162 if ((*it).object ==
object) {
163 klfDbg(
"Removing connection between object "<<
object<<
" and config property "<<pname) ;
183 klfWarning(
"Requesting property instance for empty name !?! Program might crash!") ;
190 qWarning()<<KLF_FUNC_NAME<<
": Can't find config property name "<<name<<
" !";
virtual void propertyChanged(KLFConfigPropBase *property, const QVariant &oldValue, const QVariant &newValue)
virtual void connectQObjectProperty(const QString &configPropertyName, QObject *object, const QByteArray &objPropName)
virtual QStringList propertyList() const
KLFConfigPropBase * property(const QString &name)
virtual void propertyValueRequested(const KLFConfigPropBase *property)
QList< KLFConfigPropBase * > pProperties
virtual void connectQObjectSlot(const QString &configPropertyName, QObject *object, const QByteArray &slotMethodName)
virtual void disconnectQObjectSlot(const QString &configPropertyName, QObject *object, const QByteArray &slotMethodName)
virtual void disconnectQObject(QObject *object)
virtual bool okChangeProperty(KLFConfigPropBase *property, const QVariant &oldValue, const QVariant &newValue)
QHash< QString, QList< ObjConnection > > pObjConnections
virtual void disconnectQObjectProperty(const QString &configPropertyName, QObject *object, const QByteArray &objPropName)
void connectQObject(const QString &configPropertyName, QObject *object, ConnectionTarget target, const QByteArray &targetName)
virtual ~KLFConfigPropBase()
virtual QString propName() const
virtual QVariant toVariant() const =0
#define klfWarning(streamableItems)
#define KLF_DEBUG_BLOCK(msg)
Utility to debug the execution of a block.
#define KLF_ASSERT_NOT_NULL(ptr, msg, failaction)
Asserting Non-NULL pointers (NON-FATAL)
#define klfDbg(streamableItems)
print debug stream items
QByteArray & append(char ch)
const Key key(const T &value) const
const T value(const Key &key) const
iterator erase(iterator pos)
const char * typeName() const