[Qt-interest] Potential bug in QTreeWidgetItemIterator ctor
Anton Chernov
mechernov at gmail.com
Thu May 12 08:39:29 CEST 2011
I guess you have an absolutly uninitialized QTreeWidget (or a pointer to it)
or use a similar model for it.
2011/5/12 Dan Furlani <dan.furlani at e-cortex.com>
> My application is crashing in this code, since the item->view is null:
>
> QTreeWidgetItemIterator::QTreeWidgetItemIterator(QTreeWidgetItem *item,
> IteratorFlags flags)
> : d_ptr(new QTreeWidgetItemIteratorPrivate(
> this, qobject_cast<QTreeModel*>(item->view->model()))),
> current(item), flags(flags)
>
> The crash actually occurs when QAbstractItemView::model() calls d_func()
> calls qGetPtrHelper() calls QScopedPointer<...>::data().
>
> Is this something that should be fixed in Qt or in my code? Just wondering
> if it's valid for my code to be providing a QTreeWidgetItem with a null view
> member. QTreeWidgetItem::view is private so I'm not even sure how I would
> fix this in my application's code.
>
> I found a bug report with a similar stack trace, in another application:
> http://www.mail-archive.com/kdepim-bugs@kde.org/msg39604.html
>
> Maybe not a common bug, but not a one-off either I guess.
>
> Thanks
> -dan
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110512/ec8298d2/attachment.html
More information about the Qt-interest-old
mailing list