[PyKDE] Patch for pyuic layout problems

Dan Haffey dhaffey at linuxteams.com
Tue Aug 22 16:44:07 BST 2000


I happened to notice (by way of nested layout problems) that Phil's pyuic
compiler doesn't prepend self. on the layout widget initializations, which
causes them to die prematurely.  Here's a small patch to uic.cpp that
fixes it.  It crashes on exit now when using nested layouts, but I have yet to
figure out why.  Maybe someone can figure that one out.

Dan Haffey
LinuxTeams
-------------- next part --------------
855,859c855,859
< 	out << indent << parent << ".setColumnLayout(0,Qt.Orientation.Vertical)" << endl;
< 	out << indent << parent << ".layout().setSpacing(0)" << endl;
< 	out << indent << parent << ".layout().setMargin(0)" << endl;
< 	out << indent << objName << " = " << qlayout << "(" << parent << ".layout())" << endl;
< 	out << indent << objName << ".setAlignment(Qt.AlignmentFlags.AlignTop)" << endl;
---
> 	out << indent << "self." << parent << ".setColumnLayout(0,Qt.Orientation.Vertical)" << endl;
> 	out << indent << "self." << parent << ".layout().setSpacing(0)" << endl;
> 	out << indent << "self." << parent << ".layout().setMargin(0)" << endl;
> 	out << indent << "self." << objName << " = " << qlayout << "(" << parent << ".layout())" << endl;
> 	out << indent << "self." << objName << ".setAlignment(Qt.AlignmentFlags.AlignTop)" << endl;
862c862
< 	    out << indent << objName << " = " << qlayout << "(" << parent << ")" << endl;
---
> 	    out << indent << "self." << objName << " = " << qlayout << "(" << parent << ")" << endl;
864c864
< 	    out << indent << objName << " = " << qlayout << "()" << endl;
---
> 	    out << indent << "self." << objName << " = " << qlayout << "()" << endl;
867,868c867,868
<     out << indent << objName << ".setSpacing(" << spacing << ")" << endl;
<     out << indent << objName << ".setMargin(" << margin << ")" << endl;
---
>     out << indent << "self." << objName << ".setSpacing(" << spacing << ")" << endl;
>     out << indent << "self." << objName << ".setMargin(" << margin << ")" << endl;
874c874
< 		out << indent << objName << ".addItem(" << child << ")" << endl;
---
> 		out << indent << "self." << objName << ".addItem(" << "self." << child << ")" << endl;
878c878
< 		    out << indent << objName << ".addLayout(" << child << ")" << endl;
---
> 		    out << indent << "self." << objName << ".addLayout(" << "self." << child << ")" << endl;
880c880
< 		    out << indent << objName << ".addWidget(" << child << ")" << endl;
---
> 		    out << indent << "self." << objName << ".addWidget(" << child << ")" << endl;
897c897
< 		    out << indent << objName << ".addMultiCell(" << child << ","
---
> 		    out << indent << "self." << objName << ".addMultiCell(" << "self." << child << ","
901c901
< 		    out << indent << objName << ".addItem(" << child << ","
---
> 		    out << indent << "self." << objName << ".addItem(" << "self." << child << ","
910c910
< 		    out << indent << objName << ".addMultiCell" << o << "(" << child << ","
---
> 		    out << indent << "self." << objName << ".addMultiCell" << o << "(" << "self." << child << ","
913c913
< 		    out << indent << objName << ".add" << o << "(" << child << ","
---
> 		    out << indent << "self." << objName << ".add" << o << "(" << "self." << child << ","
936c936
< 	out << indent << objName << " = QSpacerItem("
---
> 	out << indent << "self." << objName << " = QSpacerItem("
940c940
< 	out << indent << objName << " = QSpacerItem("
---
> 	out << indent << "self." << objName << " = QSpacerItem("


More information about the PyQt mailing list