[PyKDE] Core dump and QString

Pete Ware ware at cis.ohio-state.edu
Mon Apr 17 21:03:15 BST 2000


Qt 2.0.2, PyQt 0.11.1.  Calling QMessageBox.warning() with None as one
of the string arguments crashes (core dump).  It does so because
"QString *a5" is NULL since the parameter is None and the code says:

    res = QMessageBox::warning( a0,* a1,* a2,* a3,* a4,* a5, a6, a7);

Note the "*a5".  Shouldn't None == QString::null?

Also, why throughout the code does it say:


	int istemp4 = sipConvertTo_QString(a4obj,(QString **)&a4,&iserr);
#if defined(SIP_VERS_QT_1x)
	int istemp4 = sipConvertTo_QString(a4obj,(QString **)&a4,&iserr);
#endif

It seems like for QT_1x it is going to do the same thing twice.
First, shouldn't it be:

#if defined(SIP_VERS_QT_1x)
	int istemp4 = sipConvertTo_QString(a4obj,(QString **)&a4,&iserr);
#else
	int istemp4 = sipConvertTo_QString(a4obj,(QString **)&a4,&iserr);
#endif

Ignoring that they are the same line?  Or is something clever going on
(like getting reference counting set right).

Thanks,
--pete




More information about the PyQt mailing list