Documentation/Source/eric5.Utilities.uic.html

changeset 58
37f0444c3479
parent 21
b88a0e6268bd
child 110
c9a969db1469
equal deleted inserted replaced
57:81326a94fdca 58:37f0444c3479
20 </style> 20 </style>
21 </head> 21 </head>
22 <body><a NAME="top" ID="top"></a> 22 <body><a NAME="top" ID="top"></a>
23 <h1>eric5.Utilities.uic</h1> 23 <h1>eric5.Utilities.uic</h1>
24 <p> 24 <p>
25 &#77;&#111;&#100;&#117;&#108;&#101; &#105;&#109;&#112;&#108;&#101;&#109;&#101;&#110;&#116;&#105;&#110;&#103; &#97; &#102;&#117;&#110;&#99;&#116;&#105;&#111;&#110; &#116;&#111; &#99;&#111;&#109;&#112;&#105;&#108;&#101; &#97;&#108;&#108; &#117;&#115;&#101;&#114; &#105;&#110;&#116;&#101;&#114;&#102;&#97;&#99;&#101; &#102;&#105;&#108;&#101;&#115; &#111;&#102; &#97; 25 Module implementing a function to compile all user interface files of a
26 &#100;&#105;&#114;&#101;&#99;&#116;&#111;&#114;y &#111;&#114; &#100;&#105;&#114;&#101;&#99;&#116;&#111;&#114;y &#116;&#114;&#101;&#101;. 26 directory or directory tree.
27 </p> 27 </p>
28 <h3>Global Attributes</h3> 28 <h3>Global Attributes</h3>
29 <table> 29 <table>
30 <tr><td>None</td></tr> 30 <tr><td>None</td></tr>
31 </table> 31 </table>
35 </table> 35 </table>
36 <h3>Functions</h3> 36 <h3>Functions</h3>
37 <table> 37 <table>
38 <tr> 38 <tr>
39 <td><a href="#compileUiDir">compileUiDir</a></td> 39 <td><a href="#compileUiDir">compileUiDir</a></td>
40 <td>&#67;&#114;&#101;&#97;&#116;&#101;&#115; &#80;y&#116;&#104;&#111;&#110; &#109;&#111;&#100;&#117;&#108;&#101;&#115; &#102;&#114;&#111;&#109; &#81;&#116; &#68;&#101;&#115;&#105;&#103;&#110;&#101;&#114; .&#117;&#105; &#102;&#105;&#108;&#101;&#115; &#105;&#110; &#97; &#100;&#105;&#114;&#101;&#99;&#116;&#111;&#114;y &#111;&#114; &#100;&#105;&#114;&#101;&#99;&#116;&#111;&#114;y &#116;&#114;&#101;&#101;.</td> 40 <td>Creates Python modules from Qt Designer .ui files in a directory or directory tree.</td>
41 </tr><tr> 41 </tr><tr>
42 <td><a href="#compileUiFiles">compileUiFiles</a></td> 42 <td><a href="#compileUiFiles">compileUiFiles</a></td>
43 <td>&#77;&#111;&#100;&#117;&#108;&#101; &#102;&#117;&#110;&#99;&#116;&#105;&#111;&#110; &#116;&#111; &#99;&#111;&#109;&#112;&#105;&#108;&#101; &#116;&#104;&#101; .&#117;&#105; &#102;&#105;&#108;&#101;&#115; &#111;&#102; &#97; &#100;&#105;&#114;&#101;&#99;&#116;&#111;&#114;y &#116;&#114;&#101;&#101; &#116;&#111; &#80;y&#116;&#104;&#111;&#110; &#115;&#111;&#117;&#114;&#99;&#101;&#115;.</td> 43 <td>Module function to compile the .ui files of a directory tree to Python sources.</td>
44 </tr><tr> 44 </tr><tr>
45 <td><a href="#compile_ui">compile_ui</a></td> 45 <td><a href="#compile_ui">compile_ui</a></td>
46 <td>&#76;&#111;&#99;&#97;&#108; &#102;&#117;&#110;&#99;&#116;&#105;&#111;&#110; &#116;&#111; &#99;&#111;&#109;&#112;&#105;&#108;&#101; &#97; &#115;&#105;&#110;&#103;&#108;&#101; .&#117;&#105; &#102;&#105;&#108;&#101;.</td> 46 <td>Local function to compile a single .ui file.</td>
47 </tr><tr> 47 </tr><tr>
48 <td><a href="#pyName">pyName</a></td> 48 <td><a href="#pyName">pyName</a></td>
49 <td>&#76;&#111;&#99;&#97;&#108; &#102;&#117;&#110;&#99;&#116;&#105;&#111;&#110; &#116;&#111; &#99;&#114;&#101;&#97;&#116;&#101; &#116;&#104;&#101; &#80;y&#116;&#104;&#111;&#110; &#115;&#111;&#117;&#114;&#99;&#101; &#102;&#105;&#108;&#101; &#110;&#97;&#109;&#101; &#102;&#111;&#114; &#116;&#104;&#101; &#99;&#111;&#109;&#112;&#105;&#108;&#101;&#100; .&#117;&#105; &#102;&#105;&#108;&#101;.</td> 49 <td>Local function to create the Python source file name for the compiled .ui file.</td>
50 </tr> 50 </tr>
51 </table> 51 </table>
52 <hr /><hr /> 52 <hr /><hr />
53 <a NAME="compileUiDir" ID="compileUiDir"></a> 53 <a NAME="compileUiDir" ID="compileUiDir"></a>
54 <h2>compileUiDir</h2> 54 <h2>compileUiDir</h2>
55 <b>compileUiDir</b>(<i>dir, recurse = False, map = None, **compileUi_args</i>) 55 <b>compileUiDir</b>(<i>dir, recurse = False, map = None, **compileUi_args</i>)
56 <p> 56 <p>
57 &#67;&#114;&#101;&#97;&#116;&#101;&#115; &#80;y&#116;&#104;&#111;&#110; &#109;&#111;&#100;&#117;&#108;&#101;&#115; &#102;&#114;&#111;&#109; &#81;&#116; &#68;&#101;&#115;&#105;&#103;&#110;&#101;&#114; .&#117;&#105; &#102;&#105;&#108;&#101;&#115; &#105;&#110; &#97; &#100;&#105;&#114;&#101;&#99;&#116;&#111;&#114;y &#111;&#114; 57 Creates Python modules from Qt Designer .ui files in a directory or
58 &#100;&#105;&#114;&#101;&#99;&#116;&#111;&#114;y &#116;&#114;&#101;&#101;. 58 directory tree.
59 </p><p> 59 </p><p>
60 &#78;&#111;&#116;&#101;&#58; &#84;&#104;&#105;&#115; &#102;&#117;&#110;&#99;&#116;&#105;&#111;&#110; &#105;&#115; &#97; &#109;&#111;&#100;&#105;&#102;&#105;&#101;&#100; v&#101;&#114;&#115;&#105;&#111;&#110; &#111;&#102; &#116;&#104;&#101; &#111;&#110;&#101; &#102;&#111;&#117;&#110;&#100; &#105;&#110; &#80;y&#81;&#116;&#52;. 60 Note: This function is a modified version of the one found in PyQt4.
61 </p><dl> 61 </p><dl>
62 <dt><i>dir</i></dt> 62 <dt><i>dir</i></dt>
63 <dd> 63 <dd>
64 &#78;&#97;&#109;&#101; &#111;&#102; &#116;&#104;&#101; &#100;&#105;&#114;&#101;&#99;&#116;&#111;&#114;y &#116;&#111; &#115;&#99;&#97;&#110; &#102;&#111;&#114; &#102;&#105;&#108;&#101;&#115; w&#104;&#111;&#115;&#101; &#110;&#97;&#109;&#101; &#101;&#110;&#100;&#115; w&#105;&#116;&#104; 64 Name of the directory to scan for files whose name ends with
65 '.&#117;&#105;'. &#66;y &#100;&#101;&#102;&#97;&#117;&#108;&#116; &#116;&#104;&#101; &#103;&#101;&#110;&#101;&#114;&#97;&#116;&#101;&#100; &#80;y&#116;&#104;&#111;&#110; &#109;&#111;&#100;&#117;&#108;&#101; &#105;&#115; &#99;&#114;&#101;&#97;&#116;&#101;&#100; &#105;&#110; &#116;&#104;&#101; &#115;&#97;&#109;&#101; 65 '.ui'. By default the generated Python module is created in the same
66 &#100;&#105;&#114;&#101;&#99;&#116;&#111;&#114;y &#101;&#110;&#100;&#105;&#110;&#103; w&#105;&#116;&#104; '.&#112;y'. 66 directory ending with '.py'.
67 </dd><dt><i>recurse</i></dt> 67 </dd><dt><i>recurse</i></dt>
68 <dd> 68 <dd>
69 &#102;&#108;&#97;&#103; &#105;&#110;&#100;&#105;&#99;&#97;&#116;&#105;&#110;&#103; &#116;&#104;&#97;&#116; &#97;&#110;y &#115;&#117;&#98;-&#100;&#105;&#114;&#101;&#99;&#116;&#111;&#114;&#105;&#101;&#115; &#115;&#104;&#111;&#117;&#108;&#100; &#98;&#101; &#115;&#99;&#97;&#110;&#110;&#101;&#100;. 69 flag indicating that any sub-directories should be scanned.
70 </dd><dt><i>map</i></dt> 70 </dd><dt><i>map</i></dt>
71 <dd> 71 <dd>
72 &#97;&#110; &#111;&#112;&#116;&#105;&#111;&#110;&#97;&#108; &#99;&#97;&#108;&#108;&#97;&#98;&#108;&#101; &#116;&#104;&#97;&#116; &#105;&#115; &#112;&#97;&#115;&#115;&#101;&#100; &#116;&#104;&#101; &#110;&#97;&#109;&#101; &#111;&#102; &#116;&#104;&#101; &#100;&#105;&#114;&#101;&#99;&#116;&#111;&#114;y 72 an optional callable that is passed the name of the directory
73 &#99;&#111;&#110;&#116;&#97;&#105;&#110;&#105;&#110;&#103; &#116;&#104;&#101; '.&#117;&#105;' &#102;&#105;&#108;&#101; &#97;&#110;&#100; &#116;&#104;&#101; &#110;&#97;&#109;&#101; &#111;&#102; &#116;&#104;&#101; &#80;y&#116;&#104;&#111;&#110; &#109;&#111;&#100;&#117;&#108;&#101; &#116;&#104;&#97;&#116; w&#105;&#108;&#108; &#98;&#101; 73 containing the '.ui' file and the name of the Python module that will be
74 &#99;&#114;&#101;&#97;&#116;&#101;&#100;. &#84;&#104;&#101; &#99;&#97;&#108;&#108;&#97;&#98;&#108;&#101; &#115;&#104;&#111;&#117;&#108;&#100; &#114;&#101;&#116;&#117;&#114;&#110; &#97; &#116;&#117;&#112;&#108;&#101; &#111;&#102; &#116;&#104;&#101; &#110;&#97;&#109;&#101; &#111;&#102; &#116;&#104;&#101; &#100;&#105;&#114;&#101;&#99;&#116;&#111;&#114;y 74 created. The callable should return a tuple of the name of the directory
75 &#105;&#110; w&#104;&#105;&#99;&#104; &#116;&#104;&#101; &#80;y&#116;&#104;&#111;&#110; &#109;&#111;&#100;&#117;&#108;&#101; w&#105;&#108;&#108; &#98;&#101; &#99;&#114;&#101;&#97;&#116;&#101;&#100; &#97;&#110;&#100; &#116;&#104;&#101; (&#112;&#111;&#115;&#115;&#105;&#98;&#108;y &#109;&#111;&#100;&#105;&#102;&#105;&#101;&#100;) 75 in which the Python module will be created and the (possibly modified)
76 &#110;&#97;&#109;&#101; &#111;&#102; &#116;&#104;&#101; &#109;&#111;&#100;&#117;&#108;&#101;. 76 name of the module.
77 </dd><dt><i>compileUi_args</i></dt> 77 </dd><dt><i>compileUi_args</i></dt>
78 <dd> 78 <dd>
79 &#97;&#110;y &#97;&#100;&#100;&#105;&#116;&#105;&#111;&#110;&#97;&#108; &#107;&#101;yw&#111;&#114;&#100; &#97;&#114;&#103;&#117;&#109;&#101;&#110;&#116;&#115; &#116;&#104;&#97;&#116; &#97;&#114;&#101; &#112;&#97;&#115;&#115;&#101;&#100; &#116;&#111; 79 any additional keyword arguments that are passed to
80 &#116;&#104;&#101; &#99;&#111;&#109;&#112;&#105;&#108;&#101;&#85;&#105;() &#102;&#117;&#110;&#99;&#116;&#105;&#111;&#110; &#116;&#104;&#97;&#116; &#105;&#115; &#99;&#97;&#108;&#108;&#101;&#100; &#116;&#111; &#99;&#114;&#101;&#97;&#116;&#101; &#101;&#97;&#99;&#104; &#80;y&#116;&#104;&#111;&#110; &#109;&#111;&#100;&#117;&#108;&#101;. 80 the compileUi() function that is called to create each Python module.
81 </dd> 81 </dd>
82 </dl> 82 </dl>
83 <div align="right"><a href="#top">Up</a></div> 83 <div align="right"><a href="#top">Up</a></div>
84 <hr /><hr /> 84 <hr /><hr />
85 <a NAME="compileUiFiles" ID="compileUiFiles"></a> 85 <a NAME="compileUiFiles" ID="compileUiFiles"></a>
86 <h2>compileUiFiles</h2> 86 <h2>compileUiFiles</h2>
87 <b>compileUiFiles</b>(<i>dir, recurse = False</i>) 87 <b>compileUiFiles</b>(<i>dir, recurse = False</i>)
88 <p> 88 <p>
89 &#77;&#111;&#100;&#117;&#108;&#101; &#102;&#117;&#110;&#99;&#116;&#105;&#111;&#110; &#116;&#111; &#99;&#111;&#109;&#112;&#105;&#108;&#101; &#116;&#104;&#101; .&#117;&#105; &#102;&#105;&#108;&#101;&#115; &#111;&#102; &#97; &#100;&#105;&#114;&#101;&#99;&#116;&#111;&#114;y &#116;&#114;&#101;&#101; &#116;&#111; &#80;y&#116;&#104;&#111;&#110; &#115;&#111;&#117;&#114;&#99;&#101;&#115;. 89 Module function to compile the .ui files of a directory tree to Python sources.
90 </p><dl> 90 </p><dl>
91 <dt><i>dir</i></dt> 91 <dt><i>dir</i></dt>
92 <dd> 92 <dd>
93 &#110;&#97;&#109;&#101; &#111;&#102; &#97; &#100;&#105;&#114;&#101;&#99;&#116;&#111;&#114;y &#116;&#111; &#115;&#99;&#97;&#110; &#102;&#111;&#114; .&#117;&#105; &#102;&#105;&#108;&#101;&#115; (&#115;&#116;&#114;&#105;&#110;&#103; &#111;&#114; &#81;&#83;&#116;&#114;&#105;&#110;&#103;) 93 name of a directory to scan for .ui files (string or QString)
94 </dd><dt><i>recurse</i></dt> 94 </dd><dt><i>recurse</i></dt>
95 <dd> 95 <dd>
96 &#102;&#108;&#97;&#103; &#105;&#110;&#100;&#105;&#99;&#97;&#116;&#105;&#110;&#103; &#116;&#111; &#114;&#101;&#99;&#117;&#114;&#115;&#101; &#105;&#110;&#116;&#111; &#115;&#117;&#98;&#100;&#105;&#114;&#101;&#99;&#116;&#111;&#114;&#105;&#101;&#115; (&#98;&#111;&#111;&#108;&#101;&#97;&#110;) 96 flag indicating to recurse into subdirectories (boolean)
97 </dd> 97 </dd>
98 </dl> 98 </dl>
99 <div align="right"><a href="#top">Up</a></div> 99 <div align="right"><a href="#top">Up</a></div>
100 <hr /><hr /> 100 <hr /><hr />
101 <a NAME="compile_ui" ID="compile_ui"></a> 101 <a NAME="compile_ui" ID="compile_ui"></a>
102 <h2>compile_ui</h2> 102 <h2>compile_ui</h2>
103 <b>compile_ui</b>(<i>ui_dir, ui_file</i>) 103 <b>compile_ui</b>(<i>ui_dir, ui_file</i>)
104 <p> 104 <p>
105 &#76;&#111;&#99;&#97;&#108; &#102;&#117;&#110;&#99;&#116;&#105;&#111;&#110; &#116;&#111; &#99;&#111;&#109;&#112;&#105;&#108;&#101; &#97; &#115;&#105;&#110;&#103;&#108;&#101; .&#117;&#105; &#102;&#105;&#108;&#101;. 105 Local function to compile a single .ui file.
106 </p><dl> 106 </p><dl>
107 <dt><i>ui_dir</i></dt> 107 <dt><i>ui_dir</i></dt>
108 <dd> 108 <dd>
109 &#100;&#105;&#114;&#101;&#99;&#116;&#111;&#114;y &#99;&#111;&#110;&#116;&#97;&#105;&#110;&#105;&#110;&#103; &#116;&#104;&#101; .&#117;&#105; &#102;&#105;&#108;&#101; (&#115;&#116;&#114;&#105;&#110;&#103;) 109 directory containing the .ui file (string)
110 </dd><dt><i>ui_file</i></dt> 110 </dd><dt><i>ui_file</i></dt>
111 <dd> 111 <dd>
112 &#102;&#105;&#108;&#101; &#110;&#97;&#109;&#101; &#111;&#102; &#116;&#104;&#101; .&#117;&#105; &#102;&#105;&#108;&#101; (&#115;&#116;&#114;&#105;&#110;&#103;) 112 file name of the .ui file (string)
113 </dd> 113 </dd>
114 </dl> 114 </dl>
115 <div align="right"><a href="#top">Up</a></div> 115 <div align="right"><a href="#top">Up</a></div>
116 <hr /><hr /> 116 <hr /><hr />
117 <a NAME="pyName" ID="pyName"></a> 117 <a NAME="pyName" ID="pyName"></a>
118 <h2>pyName</h2> 118 <h2>pyName</h2>
119 <b>pyName</b>(<i>py_dir, py_file</i>) 119 <b>pyName</b>(<i>py_dir, py_file</i>)
120 <p> 120 <p>
121 &#76;&#111;&#99;&#97;&#108; &#102;&#117;&#110;&#99;&#116;&#105;&#111;&#110; &#116;&#111; &#99;&#114;&#101;&#97;&#116;&#101; &#116;&#104;&#101; &#80;y&#116;&#104;&#111;&#110; &#115;&#111;&#117;&#114;&#99;&#101; &#102;&#105;&#108;&#101; &#110;&#97;&#109;&#101; &#102;&#111;&#114; &#116;&#104;&#101; &#99;&#111;&#109;&#112;&#105;&#108;&#101;&#100; .&#117;&#105; &#102;&#105;&#108;&#101;. 121 Local function to create the Python source file name for the compiled .ui file.
122 </p><dl> 122 </p><dl>
123 <dt><i>py_dir</i></dt> 123 <dt><i>py_dir</i></dt>
124 <dd> 124 <dd>
125 &#115;&#117;&#103;&#103;&#101;&#115;&#116;&#101;&#100; &#110;&#97;&#109;&#101; &#111;&#102; &#116;&#104;&#101; &#100;&#105;&#114;&#101;&#99;&#116;&#111;&#114;y (&#115;&#116;&#114;&#105;&#110;&#103;) 125 suggested name of the directory (string)
126 </dd><dt><i>py_file</i></dt> 126 </dd><dt><i>py_file</i></dt>
127 <dd> 127 <dd>
128 &#115;&#117;&#103;&#103;&#101;&#115;&#116;&#101;&#100; &#110;&#97;&#109;&#101; &#102;&#111;&#114; &#116;&#104;&#101; &#99;&#111;&#109;&#112;&#105;&#108;&#101; &#115;&#111;&#117;&#114;&#99;&#101; &#102;&#105;&#108;&#101; (&#115;&#116;&#114;&#105;&#110;&#103;) 128 suggested name for the compile source file (string)
129 </dd> 129 </dd>
130 </dl><dl> 130 </dl><dl>
131 <dt>Returns:</dt> 131 <dt>Returns:</dt>
132 <dd> 132 <dd>
133 &#116;&#117;&#112;&#108;&#101; &#111;&#102; &#100;&#105;&#114;&#101;&#99;&#116;&#111;&#114;y &#110;&#97;&#109;&#101; (&#115;&#116;&#114;&#105;&#110;&#103;) &#97;&#110;&#100; &#115;&#111;&#117;&#114;&#99;&#101; &#102;&#105;&#108;&#101; &#110;&#97;&#109;&#101; (&#115;&#116;&#114;&#105;&#110;&#103;) 133 tuple of directory name (string) and source file name (string)
134 </dd> 134 </dd>
135 </dl> 135 </dl>
136 <div align="right"><a href="#top">Up</a></div> 136 <div align="right"><a href="#top">Up</a></div>
137 <hr /> 137 <hr />
138 </body></html> 138 </body></html>

eric ide

mercurial