I'm a newbie in qt. And i started to read the book. In which i found out the following code.
Q_OBJECT
Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly)
private:
bool m_bReadOnly;
public:
, m_bReadOnly(false)
{
}
public:
void setReadOnly(bool bReadOnly)
{
m_bReadOnly = bReadOnly;
}
bool isReadOnly() const
{
return m_bReadOnly;
}
}
class MyClass : public QObject {
Q_OBJECT
Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly)
private:
bool m_bReadOnly;
public:
MyClass(QObject* pobj = 0) : QObject(pobj)
, m_bReadOnly(false)
{
}
public:
void setReadOnly(bool bReadOnly)
{
m_bReadOnly = bReadOnly;
}
bool isReadOnly() const
{
return m_bReadOnly;
}
}
To copy to clipboard, switch view to plain text mode
This code about "Determination of properties to control the read-only mode".
But i didn't understand it. And if someone know something about it. Plz,write down your answer. And where do i have to write this code in which file?
Bookmarks