I think I figured out what I was doing wrong ... was putting quotes around the fields for the Q_PROPERTY entries. I'd still like to see a more rich example. It might be something I could add in a Wiki area ... if there is one ... when I get my hands wrapped around it.
#ifndef _MY_CLASS_H_
#define _MY_CLASS_H_
#include <QMetaClassInfo>
{
Q_OBJECT
Q_CLASSINFO("author", "John Doe")
Q_CLASSINFO("url", "http://doc.trolltech.com/")
Q_PROPERTY(int mData
READ getData()
WRITE setData())
public:
cMyClass() :
mData(0) {}
int const getData() { return mData; }
void setData(int data) { mData = data; }
int mData;
}; // cMyClass
#endif // _MY_CLASS_H_
#ifndef _MY_CLASS_H_
#define _MY_CLASS_H_
#include <QMetaClassInfo>
class cMyClass : public QObject
{
Q_OBJECT
Q_CLASSINFO("author", "John Doe")
Q_CLASSINFO("url", "http://doc.trolltech.com/")
Q_PROPERTY(int mData
READ getData()
WRITE setData())
public:
cMyClass() :
mData(0) {}
int const getData() { return mData; }
void setData(int data) { mData = data; }
int mData;
}; // cMyClass
#endif // _MY_CLASS_H_
To copy to clipboard, switch view to plain text mode
Bookmarks