[PyQt] Object lifetime issues with dialogs, called from QStyledItemDelegate editors

Phil Thompson phil at riverbankcomputing.com
Sun Apr 9 11:15:00 BST 2017

On 8 Apr 2017, at 9:06 pm, Hans-Peter Jansen <hpj at urpla.net> wrote:
> Hi,
> I'm suffering from strange behavior related to object lifetime issues, when 
> modal dialogs are called from QStyledItemDelegate editors, and posted these 
> issues here:
> http://stackoverflow.com/questions/43298605/strange-behavior-of-qcolordialog-when-called-from-qstyleditemdelegate-subclass
> http://stackoverflow.com/questions/43299616/calling-qcolordialog-triggered-from-qstyleditemdelegate-editor-results-in-crash
> When executing the itemdelegate.py script, double clicking on a color item 
> displays the standard QColorDialog. The dialog will close immediately, if the 
> dialog is moved(!). OTOH, selecting an arbitrary color beforehand, the dialog 
> behaves correctly.. 

Works fine for me on macOS.

> The mplexitemdelegate.py script crashes, when closing the QColorDialog, after 
> being called from a QTableView subclass, triggered from a signal. 
> When started, various editors for different types appear in the second column. 
> The color editors open a QComboBox with various predefined colors. The last 
> item triggers a signal in the QTableView, that calls QColorDialog.getColor().

Again, works fine for me on macOS.


More information about the PyQt mailing list