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

Hans-Peter Jansen hpj at urpla.net
Sun Apr 9 11:30:57 BST 2017

Hi Phil,

On Sonntag, 9. April 2017 11:15:00 Phil Thompson wrote:
> 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-qcolordial
> > og-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.

Thanks a lot for testing, Phil. That's an interesting data point. 

So far, it points to some platform dependent issues of Qt itself.

@Audience: these issues could use some tests on different platforms. While 
Phil's environment is guaranteed to test the latest versions of Qt, sip and 
PyQt (and guess, MacOS as well), please give a note of your environment and 
versions, if being so nice to help me here with more data points. If testing 
on Linux, mentioning the window manager would be important as well.

Start digging into Qt now...


More information about the PyQt mailing list