![]() |
Is there anything wrong with this? Random Segfaults.
I've implemented a custom QObject based C++ listmodel and i get random segfaults wondering if anyone can spot if I've done anything wrong:
.h file: Code:
#ifndef KEYVALUELISTITEM_H Code:
#include "keyvaluelistitem.h" create new items like this, where conditions is QList<QObject*> Code:
conditions->append(new KeyValueListItem("New other (see details)", ItemFilterType_CONDITION, "1500", false)); |
Re: Is there anything wrong with this? Random Segfaults.
On that NOTIFY comment, you can add CONSTANT instead to your property declarations if they are indeed read only. Also, why are you checking your private member variables for NULL? They are not pointers. Why a QLIst<QObject*> instead of a QList<KeyValueListItem*>? Why it segfaults? Who knows, not enough details, why don't you run it through gdb and get a backtrace?
|
Re: Is there anything wrong with this? Random Segfaults.
Quote:
using QLIst<QObject*> because QList<KeyValueListItem*> gives an error which its not registered with the qt meta system I've got around the problem though by using QVariant::fromValue(xxxx) like in the examples. |
All times are GMT. The time now is 09:23. |
vBulletin® Version 3.8.8