[PyKDE] Re: Bug in QApplication.setStyle()

Phil Thompson phil at river-bank.demon.co.uk
Fri Apr 7 19:21:47 BST 2000


Boudewijn,

Attached is a patch for sipqtQApplication.cpp (PyQt v0.11.1) which fixes
your segfault. The other patch can be applied to the .sip file if you
are re-generating the C++ code.

I'll add your script to the examples directory - I'll leave you to find
the bug in it :).

Thanks,
Phil
-------------- next part --------------
--- sipqtQApplication.cpp.orig	Fri Apr  7 18:07:10 2000
+++ sipqtQApplication.cpp	Fri Apr  7 17:39:06 2000
@@ -2535,6 +2535,8 @@
 
 			QApplication::setStyle( a0);
 
+			sipTransferSelfToCpp(a0obj);
+
 			Py_INCREF(Py_None);
 			return Py_None;
 		}
@@ -4476,7 +4478,7 @@
 
 			PyQtUpdatePyArgv(argvlist,argc,argv);
 		}
-#line 4480 "PyQt/qt/sipqtQApplication.cpp"
+#line 4482 "PyQt/qt/sipqtQApplication.cpp"
 	}
 
 	if (sipNew == NULL)
-------------- next part --------------
--- qapplication.sip.orig	Fri Apr  7 17:37:01 2000
+++ qapplication.sip	Fri Apr  7 17:37:18 2000
@@ -101,7 +101,7 @@
 %End
 %If Version(QT_2x)
 	static QStyle &style();
-	static void setStyle(QStyle *);
+	static void setStyle(QStyle * /Transfer/);
 %End
 
 %If Version(QT_1x)


More information about the PyQt mailing list