qlands
16th September 2011, 07:45
Hi,
I have a class that looks like this:
struct moduleFieldDef
{
QString code;
QString description;
QVariant value;
QVariant previousValue;
QAbstractItemDelegate* delegate;
};
typedef moduleFieldDef TmoduleFieldDef;
class fieldInColModel : public QAbstractTableModel
{
Q_OBJECT
public:
fieldInColModel(QObject *parent=0);
~fieldInColModel();
private:
QList<TmoduleFieldDef> m_fields;
};
In the implementation m_fields gets filled with a series of fields some of them with a valid * to a delegate. Both the class and the * to delegates share the same parent (a QDialog).
Now, when the class gets destroyed what happens to the list m_fields, the fields it contains and the valid * to a delegates? Do the valid * to a delegates gets destroyed too? or they will get destroy after (when its parent gets destroyed)?
Thanks,
Carlos.
I have a class that looks like this:
struct moduleFieldDef
{
QString code;
QString description;
QVariant value;
QVariant previousValue;
QAbstractItemDelegate* delegate;
};
typedef moduleFieldDef TmoduleFieldDef;
class fieldInColModel : public QAbstractTableModel
{
Q_OBJECT
public:
fieldInColModel(QObject *parent=0);
~fieldInColModel();
private:
QList<TmoduleFieldDef> m_fields;
};
In the implementation m_fields gets filled with a series of fields some of them with a valid * to a delegate. Both the class and the * to delegates share the same parent (a QDialog).
Now, when the class gets destroyed what happens to the list m_fields, the fields it contains and the valid * to a delegates? Do the valid * to a delegates gets destroyed too? or they will get destroy after (when its parent gets destroyed)?
Thanks,
Carlos.