23 </table> |
23 </table> |
24 |
24 |
25 <h3>Functions</h3> |
25 <h3>Functions</h3> |
26 <table> |
26 <table> |
27 <tr> |
27 <tr> |
|
28 <td><a href="#__compileUi">__compileUi</a></td> |
|
29 <td>Function to create a Python module from a Qt Designer .ui file.</td> |
|
30 </tr> |
|
31 <tr> |
28 <td><a href="#__pyName">__pyName</a></td> |
32 <td><a href="#__pyName">__pyName</a></td> |
29 <td>Local function to create the Python source file name for the compiled .ui file.</td> |
33 <td>Local function to create the Python source file name for the compiled .ui file.</td> |
|
34 </tr> |
|
35 <tr> |
|
36 <td><a href="#compileOneUi">compileOneUi</a></td> |
|
37 <td>Function to compile a single form file to Python code.</td> |
30 </tr> |
38 </tr> |
31 <tr> |
39 <tr> |
32 <td><a href="#compileUiFiles">compileUiFiles</a></td> |
40 <td><a href="#compileUiFiles">compileUiFiles</a></td> |
33 <td>Module function to compile the .ui files of a directory tree to Python sources.</td> |
41 <td>Module function to compile the .ui files of a directory tree to Python sources.</td> |
34 </tr> |
42 </tr> |
35 </table> |
43 </table> |
36 |
44 |
|
45 <hr /> |
|
46 <hr /> |
|
47 <a NAME="__compileUi" ID="__compileUi"></a> |
|
48 <h2>__compileUi</h2> |
|
49 <b>__compileUi</b>(<i>uifile, pyfile, execute=False, indent=4, uiheadername=""</i>) |
|
50 <p> |
|
51 Function to create a Python module from a Qt Designer .ui file. |
|
52 </p> |
|
53 |
|
54 <dl> |
|
55 |
|
56 <dt><i>uifile</i> (str or file)</dt> |
|
57 <dd> |
|
58 file name or file-like object containing the .ui file |
|
59 </dd> |
|
60 <dt><i>pyfile</i> (file)</dt> |
|
61 <dd> |
|
62 file-like object to which the Python code will be written to |
|
63 </dd> |
|
64 <dt><i>execute</i> (bool (optional))</dt> |
|
65 <dd> |
|
66 flag indicating to generate extra Python code that allows the |
|
67 code to be run as a standalone application (defaults to False) |
|
68 </dd> |
|
69 <dt><i>indent</i> (int (optional))</dt> |
|
70 <dd> |
|
71 indentation width using spaces. If it is 0 then a tab is used. |
|
72 (defaults to 4) |
|
73 </dd> |
|
74 <dt><i>uiheadername</i> (str ((optional))</dt> |
|
75 <dd> |
|
76 UI file name to be placed in the header (defaults to "") |
|
77 </dd> |
|
78 </dl> |
|
79 <div align="right"><a href="#top">Up</a></div> |
37 <hr /> |
80 <hr /> |
38 <hr /> |
81 <hr /> |
39 <a NAME="__pyName" ID="__pyName"></a> |
82 <a NAME="__pyName" ID="__pyName"></a> |
40 <h2>__pyName</h2> |
83 <h2>__pyName</h2> |
41 <b>__pyName</b>(<i>py_dir, py_file</i>) |
84 <b>__pyName</b>(<i>py_dir, py_file</i>) |
68 </dd> |
111 </dd> |
69 </dl> |
112 </dl> |
70 <div align="right"><a href="#top">Up</a></div> |
113 <div align="right"><a href="#top">Up</a></div> |
71 <hr /> |
114 <hr /> |
72 <hr /> |
115 <hr /> |
|
116 <a NAME="compileOneUi" ID="compileOneUi"></a> |
|
117 <h2>compileOneUi</h2> |
|
118 <b>compileOneUi</b>(<i>ui_path, mapFunc=None, execute=False, indent=4, uiheadername=""</i>) |
|
119 <p> |
|
120 Function to compile a single form file to Python code. |
|
121 </p> |
|
122 |
|
123 <dl> |
|
124 |
|
125 <dt><i>ui_path</i> (str)</dt> |
|
126 <dd> |
|
127 path of the Qt form file |
|
128 </dd> |
|
129 <dt><i>mapFunc</i> (func (optional))</dt> |
|
130 <dd> |
|
131 function to change directory and/or name of the resulting Python file |
|
132 (defaults to None) |
|
133 </dd> |
|
134 <dt><i>execute</i> (bool (optional))</dt> |
|
135 <dd> |
|
136 flag indicating to generate code to execute the form in standalone |
|
137 mode (defaults to False) |
|
138 </dd> |
|
139 <dt><i>indent</i> (int (optional))</dt> |
|
140 <dd> |
|
141 indentation width using spaces (defaults to 4) |
|
142 </dd> |
|
143 <dt><i>uiheadername</i> (str ((optional))</dt> |
|
144 <dd> |
|
145 UI file name to be placed in the header (defaults to "") |
|
146 </dd> |
|
147 </dl> |
|
148 <div align="right"><a href="#top">Up</a></div> |
|
149 <hr /> |
|
150 <hr /> |
73 <a NAME="compileUiFiles" ID="compileUiFiles"></a> |
151 <a NAME="compileUiFiles" ID="compileUiFiles"></a> |
74 <h2>compileUiFiles</h2> |
152 <h2>compileUiFiles</h2> |
75 <b>compileUiFiles</b>(<i>directory, recurse=False</i>) |
153 <b>compileUiFiles</b>(<i>directory, recurse=False</i>) |
76 <p> |
154 <p> |
77 Module function to compile the .ui files of a directory tree to Python |
155 Module function to compile the .ui files of a directory tree to Python |