Dear all,

In my app, I have two main widgets :
 - One displaying a tree (TreeWidget) and allowing selecting nodes.
 - One for editing the selected node (EditWidget), embedded in a QScrollArea

Selecting a node sets a new EditWidget using QScrollArea::setWidget. This
deletes the previous widget with a standard "delete" statement as seen in
Qt code.

One of the possible actions in EditWidget tells the TreeWidget to select
another node. This is the issue : it crashes because a queued event
(generally a focus out) gets called while the widget is deleted already.

1) I know could use a QueuedConnection for the previously described action,
but I don't like that kind of GUI design where a QueuedConnection is
required to avoid an app crash...

2) I could use scrollArea->takeWidget()->deleteLater() before setWidget().
I will try that.

3) Wouldn't it be better to use deleteLater() in the QScrollArea::setWidget
? This would solve the issue here. How about changing this in Qt source?

I'm using 4.8.1

Etienne
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to