qt_ui_tools/lib.rs
1#![cfg_attr(feature = "ritual_rustdoc_nightly", feature(doc_cfg))]
2//! Bindings for QtUiTools C++ library.
3//!
4//! Starting guide and examples are available at
5//!       [https://github.com/rust-qt/examples](https://github.com/rust-qt/examples).
6//!
7//! This crate was generated for Qt 5.9.7, 5.11.3, 5.12.2, 5.13.0, 5.14.0.
8//!         It should work with other Qt versions later than 5.9.7,
9//!         but API specific to other versions will not be available.
10//!
11//! This crate was generated by `ritual`.
12//!           See [README](https://github.com/rust-qt/ritual) for more information.
13
14mod impl_ui_loader;
15
16pub use qt_macros::ui_form;
17
18mod __ffi {
19 //! Functions provided by the C++ wrapper library
20
21 include!(concat!(env!("OUT_DIR"), "/ffi.rs"));
22}
23pub use ::cpp_core;
24pub use ::qt_core;
25pub use ::qt_gui;
26pub use ::qt_widgets;
27/// <p>The <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a> class enables standalone applications to dynamically create user interfaces at run-time using the information stored in UI files or specified in plugin paths.</p>
28///
29/// C++ class: <span style='color: green;'>```QUiLoader```</span>.
30///
31/// <a href="http://doc.qt.io/qt-5/quiloader.html">C++ documentation</a>:<div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>The <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a> class enables standalone applications to dynamically create user interfaces at run-time using the information stored in UI files or specified in plugin paths.</p>
32/// <p>In addition, you can customize or create your own user interface by deriving your own loader class.</p>
33/// <p>If you have a custom component or an application that embeds <i>Qt Designer</i>, you can also use the <a href="http://doc.qt.io/qt-5/qformbuilder.html">QFormBuilder</a> class provided by the <a href="http://doc.qt.io/qt-5/qtdesigner-module.html">QtDesigner</a> module to create user interfaces from UI files.</p>
34/// <p>The <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a> class provides a collection of functions allowing you to create widgets based on the information stored in UI files (created with <i>Qt Designer</i>) or available in the specified plugin paths. The specified plugin paths can be retrieved using the <a href="http://doc.qt.io/qt-5/quiloader.html#pluginPaths">pluginPaths</a>() function. Similarly, the contents of a UI file can be retrieved using the <a href="http://doc.qt.io/qt-5/quiloader.html#load">load</a>() function. For example:</p>
35/// <pre class="cpp">
36///
37/// MyWidget<span class="operator">::</span>MyWidget(<span class="type"><a href="http://doc.qt.io/qt-5/qwidget.html">QWidget</a></span> <span class="operator">*</span>parent)
38///   : <span class="type"><a href="http://doc.qt.io/qt-5/qwidget.html">QWidget</a></span>(parent)
39/// {
40///   <span class="type"><a href="http://doc.qt.io/qt-5/quiloader.html#QUiLoader">QUiLoader</a></span> loader;
41///   <span class="type"><a href="http://doc.qt.io/qt-5/qfile.html">QFile</a></span> file(<span class="string">":/forms/myform.ui"</span>);
42///   file<span class="operator">.</span>open(<span class="type"><a href="http://doc.qt.io/qt-5/qfile.html">QFile</a></span><span class="operator">::</span>ReadOnly);
43///   <span class="type"><a href="http://doc.qt.io/qt-5/qwidget.html">QWidget</a></span> <span class="operator">*</span>myWidget <span class="operator">=</span> loader<span class="operator">.</span>load(<span class="operator">&</span>file<span class="operator">,</span> <span class="keyword">this</span>);
44///   file<span class="operator">.</span>close();
45///
46///   <span class="type"><a href="http://doc.qt.io/qt-5/qvboxlayout.html">QVBoxLayout</a></span> <span class="operator">*</span>layout <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="http://doc.qt.io/qt-5/qvboxlayout.html">QVBoxLayout</a></span>;
47///   layout<span class="operator">-</span><span class="operator">></span>addWidget(myWidget);
48///   setLayout(layout);
49/// }
50///
51/// </pre>
52/// <p>By including the user interface in the form's resources (<code>myform.qrc</code>), we ensure that it will be present at run-time:</p>
53/// <pre class="cpp">
54///
55/// <!DOCTYPE RCC><RCC version="1.0">
56/// <qresource prefix="/forms">
57/// <file>myform.ui</file>
58/// </qresource>
59/// </RCC>
60///
61/// </pre>
62/// <p>The <a href="http://doc.qt.io/qt-5/quiloader.html#availableWidgets">availableWidgets</a>() function returns a <a href="http://doc.qt.io/qt-5/qstringlist.html">QStringList</a> with the class names of the widgets available in the specified plugin paths. To create these widgets, simply use the <a href="http://doc.qt.io/qt-5/quiloader.html#createWidget">createWidget</a>() function. For example:</p>
63/// <pre class="cpp">
64///
65/// <span class="type"><a href="http://doc.qt.io/qt-5/qwidget.html">QWidget</a></span> <span class="operator">*</span>loadCustomWidget(<span class="type"><a href="http://doc.qt.io/qt-5/qwidget.html">QWidget</a></span> <span class="operator">*</span>parent)
66/// {
67///   <span class="type"><a href="http://doc.qt.io/qt-5/quiloader.html#QUiLoader">QUiLoader</a></span> loader;
68///   <span class="type"><a href="http://doc.qt.io/qt-5/qwidget.html">QWidget</a></span> <span class="operator">*</span>myWidget;
69///
70///   <span class="type"><a href="http://doc.qt.io/qt-5/qstringlist.html">QStringList</a></span> availableWidgets <span class="operator">=</span> loader<span class="operator">.</span>availableWidgets();
71///
72///   <span class="keyword">if</span> (availableWidgets<span class="operator">.</span>contains(<span class="string">"AnalogClock"</span>))
73///     myWidget <span class="operator">=</span> loader<span class="operator">.</span>createWidget(<span class="string">"AnalogClock"</span><span class="operator">,</span> parent);
74///
75///   <span class="keyword">return</span> myWidget;
76/// }
77///
78/// </pre>
79/// <p>To make a custom widget available to the loader, you can use the <a href="http://doc.qt.io/qt-5/quiloader.html#addPluginPath">addPluginPath</a>() function; to remove all available widgets, you can call the <a href="http://doc.qt.io/qt-5/quiloader.html#clearPluginPaths">clearPluginPaths</a>() function.</p>
80/// <p>The <a href="http://doc.qt.io/qt-5/quiloader.html#createAction">createAction</a>(), <a href="http://doc.qt.io/qt-5/quiloader.html#createActionGroup">createActionGroup</a>(), <a href="http://doc.qt.io/qt-5/quiloader.html#createLayout">createLayout</a>(), and <a href="http://doc.qt.io/qt-5/quiloader.html#createWidget">createWidget</a>() functions are used internally by the <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a> class whenever it has to create an action, action group, layout, or widget respectively. For that reason, you can subclass the <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a> class and reimplement these functions to intervene the process of constructing a user interface. For example, you might want to have a list of the actions created when loading a form or creating a custom widget.</p>
81/// <p>For a complete example using the <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a> class, see the <a href="http://doc.qt.io/qt-5/qtdesigner-calculatorbuilder-example.html">Calculator Builder Example</a>.</p></div>
82#[repr(C)]
83pub struct QUiLoader {
84 _unused: u8,
85}
86impl QUiLoader {
87 /// <p>Adds the given <i>path</i> to the list of paths in which the loader will search when locating plugins.</p>
88 ///
89 /// Calls C++ function: <span style='color: green;'>```void QUiLoader::addPluginPath(const QString& path)```</span>.
90 ///
91 /// <a href="http://doc.qt.io/qt-5/quiloader.html#addPluginPath">C++ documentation</a>:<div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Adds the given <i>path</i> to the list of paths in which the loader will search when locating plugins.</p>
92 /// <p><b>See also </b><a href="http://doc.qt.io/qt-5/quiloader.html#pluginPaths">pluginPaths</a>() and <a href="http://doc.qt.io/qt-5/quiloader.html#clearPluginPaths">clearPluginPaths</a>().</p></div>
93 #[inline(always)]
94 pub unsafe fn add_plugin_path(
95 &self,
96 path: impl ::cpp_core::CastInto<::cpp_core::Ref<::qt_core::QString>>,
97 ) {
98 crate::__ffi::ctr_qt_ui_tools_ffi_QUiLoader_addPluginPath(
99 self as *const crate::QUiLoader as *mut crate::QUiLoader,
100 ::cpp_core::CastInto::<::cpp_core::Ref<::qt_core::QString>>::cast_into(path)
101 .as_raw_ptr(),
102 )
103 }
104
105 /// <p>Returns a list naming all available layouts that can be built using the <a href="http://doc.qt.io/qt-5/quiloader.html#createLayout">createLayout</a>() function</p>
106 ///
107 /// Calls C++ function: <span style='color: green;'>```QStringList QUiLoader::availableLayouts() const```</span>.
108 ///
109 /// <a href="http://doc.qt.io/qt-5/quiloader.html#availableLayouts">C++ documentation</a>:<div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns a list naming all available layouts that can be built using the <a href="http://doc.qt.io/qt-5/quiloader.html#createLayout">createLayout</a>() function</p>
110 /// <p>This function was introduced in Qt 4.5.</p>
111 /// <p><b>See also </b><a href="http://doc.qt.io/qt-5/quiloader.html#createLayout">createLayout</a>().</p></div>
112 #[inline(always)]
113 pub unsafe fn available_layouts(&self) -> ::cpp_core::CppBox<::qt_core::QStringList> {
114 let ffi_result = {
115 crate::__ffi::ctr_qt_ui_tools_ffi_QUiLoader_availableLayouts(
116 self as *const crate::QUiLoader,
117 )
118 };
119 ::cpp_core::CppBox::from_raw(ffi_result).expect("attempted to construct a null CppBox")
120 }
121
122 /// <p>Returns a list naming all available widgets that can be built using the <a href="http://doc.qt.io/qt-5/quiloader.html#createWidget">createWidget</a>() function, i.e all the widgets specified within the given plugin paths.</p>
123 ///
124 /// Calls C++ function: <span style='color: green;'>```QStringList QUiLoader::availableWidgets() const```</span>.
125 ///
126 /// <a href="http://doc.qt.io/qt-5/quiloader.html#availableWidgets">C++ documentation</a>:<div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns a list naming all available widgets that can be built using the <a href="http://doc.qt.io/qt-5/quiloader.html#createWidget">createWidget</a>() function, i.e all the widgets specified within the given plugin paths.</p>
127 /// <p><b>See also </b><a href="http://doc.qt.io/qt-5/quiloader.html#pluginPaths">pluginPaths</a>() and <a href="http://doc.qt.io/qt-5/quiloader.html#createWidget">createWidget</a>().</p></div>
128 #[inline(always)]
129 pub unsafe fn available_widgets(&self) -> ::cpp_core::CppBox<::qt_core::QStringList> {
130 let ffi_result = {
131 crate::__ffi::ctr_qt_ui_tools_ffi_QUiLoader_availableWidgets(
132 self as *const crate::QUiLoader,
133 )
134 };
135 ::cpp_core::CppBox::from_raw(ffi_result).expect("attempted to construct a null CppBox")
136 }
137
138 /// <p>Clears the list of paths in which the loader will search when locating plugins.</p>
139 ///
140 /// Calls C++ function: <span style='color: green;'>```void QUiLoader::clearPluginPaths()```</span>.
141 ///
142 /// <a href="http://doc.qt.io/qt-5/quiloader.html#clearPluginPaths">C++ documentation</a>:<div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Clears the list of paths in which the loader will search when locating plugins.</p>
143 /// <p><b>See also </b><a href="http://doc.qt.io/qt-5/quiloader.html#addPluginPath">addPluginPath</a>() and <a href="http://doc.qt.io/qt-5/quiloader.html#pluginPaths">pluginPaths</a>().</p></div>
144 #[inline(always)]
145 pub unsafe fn clear_plugin_paths(&self) {
146 crate::__ffi::ctr_qt_ui_tools_ffi_QUiLoader_clearPluginPaths(
147 self as *const crate::QUiLoader as *mut crate::QUiLoader,
148 )
149 }
150
151 /// <p>Creates a new action with the given <i>parent</i> and <i>name</i>.</p>
152 ///
153 /// Calls C++ function: <span style='color: green;'>```virtual QAction* QUiLoader::createAction(QObject* parent = …, const QString& name = …)```</span>.
154 ///
155 /// <a href="http://doc.qt.io/qt-5/quiloader.html#createAction">C++ documentation</a>:<div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Creates a new action with the given <i>parent</i> and <i>name</i>.</p>
156 /// <p>The function is also used internally by the <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a> class whenever it creates a widget. Hence, you can subclass <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a> and reimplement this function to intervene process of constructing a user interface or widget. However, in your implementation, ensure that you call <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a>'s version first.</p>
157 /// <p><b>See also </b><a href="http://doc.qt.io/qt-5/quiloader.html#createActionGroup">createActionGroup</a>(), <a href="http://doc.qt.io/qt-5/quiloader.html#createWidget">createWidget</a>(), and <a href="http://doc.qt.io/qt-5/quiloader.html#load">load</a>().</p></div>
158 #[inline(always)]
159 pub unsafe fn create_action_2a(
160 &self,
161 parent: impl ::cpp_core::CastInto<::cpp_core::Ptr<::qt_core::QObject>>,
162 name: impl ::cpp_core::CastInto<::cpp_core::Ref<::qt_core::QString>>,
163 ) -> ::qt_core::QPtr<::qt_widgets::QAction> {
164 let ffi_result = {
165 crate::__ffi::ctr_qt_ui_tools_ffi_QUiLoader_createAction(
166 self as *const crate::QUiLoader as *mut crate::QUiLoader,
167 ::cpp_core::CastInto::<::cpp_core::Ptr<::qt_core::QObject>>::cast_into(parent)
168 .as_raw_ptr() as *mut ::qt_core::QObject,
169 ::cpp_core::CastInto::<::cpp_core::Ref<::qt_core::QString>>::cast_into(name)
170 .as_raw_ptr(),
171 )
172 };
173 ::qt_core::QPtr::from_raw(ffi_result)
174 }
175
176 /// <p>Creates a new action with the given <i>parent</i> and <i>name</i>.</p>
177 ///
178 /// Calls C++ function: <span style='color: green;'>```virtual QAction* QUiLoader::createAction(QObject* parent = …)```</span>.
179 ///
180 /// <a href="http://doc.qt.io/qt-5/quiloader.html#createAction">C++ documentation</a>:<div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Creates a new action with the given <i>parent</i> and <i>name</i>.</p>
181 /// <p>The function is also used internally by the <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a> class whenever it creates a widget. Hence, you can subclass <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a> and reimplement this function to intervene process of constructing a user interface or widget. However, in your implementation, ensure that you call <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a>'s version first.</p>
182 /// <p><b>See also </b><a href="http://doc.qt.io/qt-5/quiloader.html#createActionGroup">createActionGroup</a>(), <a href="http://doc.qt.io/qt-5/quiloader.html#createWidget">createWidget</a>(), and <a href="http://doc.qt.io/qt-5/quiloader.html#load">load</a>().</p></div>
183 #[inline(always)]
184 pub unsafe fn create_action_1a(
185 &self,
186 parent: impl ::cpp_core::CastInto<::cpp_core::Ptr<::qt_core::QObject>>,
187 ) -> ::qt_core::QPtr<::qt_widgets::QAction> {
188 let ffi_result = {
189 crate::__ffi::ctr_qt_ui_tools_ffi_QUiLoader_createAction1(
190 self as *const crate::QUiLoader as *mut crate::QUiLoader,
191 ::cpp_core::CastInto::<::cpp_core::Ptr<::qt_core::QObject>>::cast_into(parent)
192 .as_raw_ptr() as *mut ::qt_core::QObject,
193 )
194 };
195 ::qt_core::QPtr::from_raw(ffi_result)
196 }
197
198 /// <p>Creates a new action with the given <i>parent</i> and <i>name</i>.</p>
199 ///
200 /// Calls C++ function: <span style='color: green;'>```virtual QAction* QUiLoader::createAction()```</span>.
201 ///
202 /// <a href="http://doc.qt.io/qt-5/quiloader.html#createAction">C++ documentation</a>:<div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Creates a new action with the given <i>parent</i> and <i>name</i>.</p>
203 /// <p>The function is also used internally by the <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a> class whenever it creates a widget. Hence, you can subclass <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a> and reimplement this function to intervene process of constructing a user interface or widget. However, in your implementation, ensure that you call <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a>'s version first.</p>
204 /// <p><b>See also </b><a href="http://doc.qt.io/qt-5/quiloader.html#createActionGroup">createActionGroup</a>(), <a href="http://doc.qt.io/qt-5/quiloader.html#createWidget">createWidget</a>(), and <a href="http://doc.qt.io/qt-5/quiloader.html#load">load</a>().</p></div>
205 #[inline(always)]
206 pub unsafe fn create_action_0a(&self) -> ::qt_core::QPtr<::qt_widgets::QAction> {
207 let ffi_result = {
208 crate::__ffi::ctr_qt_ui_tools_ffi_QUiLoader_createAction2(
209 self as *const crate::QUiLoader as *mut crate::QUiLoader,
210 )
211 };
212 ::qt_core::QPtr::from_raw(ffi_result)
213 }
214
215 /// <p>Creates a new action group with the given <i>parent</i> and <i>name</i>.</p>
216 ///
217 /// Calls C++ function: <span style='color: green;'>```virtual QActionGroup* QUiLoader::createActionGroup(QObject* parent = …, const QString& name = …)```</span>.
218 ///
219 /// <a href="http://doc.qt.io/qt-5/quiloader.html#createActionGroup">C++ documentation</a>:<div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Creates a new action group with the given <i>parent</i> and <i>name</i>.</p>
220 /// <p>The function is also used internally by the <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a> class whenever it creates a widget. Hence, you can subclass <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a> and reimplement this function to intervene process of constructing a user interface or widget. However, in your implementation, ensure that you call <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a>'s version first.</p>
221 /// <p><b>See also </b><a href="http://doc.qt.io/qt-5/quiloader.html#createAction">createAction</a>(), <a href="http://doc.qt.io/qt-5/quiloader.html#createWidget">createWidget</a>(), and <a href="http://doc.qt.io/qt-5/quiloader.html#load">load</a>().</p></div>
222 #[inline(always)]
223 pub unsafe fn create_action_group_2a(
224 &self,
225 parent: impl ::cpp_core::CastInto<::cpp_core::Ptr<::qt_core::QObject>>,
226 name: impl ::cpp_core::CastInto<::cpp_core::Ref<::qt_core::QString>>,
227 ) -> ::qt_core::QPtr<::qt_widgets::QActionGroup> {
228 let ffi_result = {
229 crate::__ffi::ctr_qt_ui_tools_ffi_QUiLoader_createActionGroup(
230 self as *const crate::QUiLoader as *mut crate::QUiLoader,
231 ::cpp_core::CastInto::<::cpp_core::Ptr<::qt_core::QObject>>::cast_into(parent)
232 .as_raw_ptr() as *mut ::qt_core::QObject,
233 ::cpp_core::CastInto::<::cpp_core::Ref<::qt_core::QString>>::cast_into(name)
234 .as_raw_ptr(),
235 )
236 };
237 ::qt_core::QPtr::from_raw(ffi_result)
238 }
239
240 /// <p>Creates a new action group with the given <i>parent</i> and <i>name</i>.</p>
241 ///
242 /// Calls C++ function: <span style='color: green;'>```virtual QActionGroup* QUiLoader::createActionGroup(QObject* parent = …)```</span>.
243 ///
244 /// <a href="http://doc.qt.io/qt-5/quiloader.html#createActionGroup">C++ documentation</a>:<div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Creates a new action group with the given <i>parent</i> and <i>name</i>.</p>
245 /// <p>The function is also used internally by the <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a> class whenever it creates a widget. Hence, you can subclass <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a> and reimplement this function to intervene process of constructing a user interface or widget. However, in your implementation, ensure that you call <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a>'s version first.</p>
246 /// <p><b>See also </b><a href="http://doc.qt.io/qt-5/quiloader.html#createAction">createAction</a>(), <a href="http://doc.qt.io/qt-5/quiloader.html#createWidget">createWidget</a>(), and <a href="http://doc.qt.io/qt-5/quiloader.html#load">load</a>().</p></div>
247 #[inline(always)]
248 pub unsafe fn create_action_group_1a(
249 &self,
250 parent: impl ::cpp_core::CastInto<::cpp_core::Ptr<::qt_core::QObject>>,
251 ) -> ::qt_core::QPtr<::qt_widgets::QActionGroup> {
252 let ffi_result = {
253 crate::__ffi::ctr_qt_ui_tools_ffi_QUiLoader_createActionGroup1(
254 self as *const crate::QUiLoader as *mut crate::QUiLoader,
255 ::cpp_core::CastInto::<::cpp_core::Ptr<::qt_core::QObject>>::cast_into(parent)
256 .as_raw_ptr() as *mut ::qt_core::QObject,
257 )
258 };
259 ::qt_core::QPtr::from_raw(ffi_result)
260 }
261
262 /// <p>Creates a new action group with the given <i>parent</i> and <i>name</i>.</p>
263 ///
264 /// Calls C++ function: <span style='color: green;'>```virtual QActionGroup* QUiLoader::createActionGroup()```</span>.
265 ///
266 /// <a href="http://doc.qt.io/qt-5/quiloader.html#createActionGroup">C++ documentation</a>:<div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Creates a new action group with the given <i>parent</i> and <i>name</i>.</p>
267 /// <p>The function is also used internally by the <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a> class whenever it creates a widget. Hence, you can subclass <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a> and reimplement this function to intervene process of constructing a user interface or widget. However, in your implementation, ensure that you call <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a>'s version first.</p>
268 /// <p><b>See also </b><a href="http://doc.qt.io/qt-5/quiloader.html#createAction">createAction</a>(), <a href="http://doc.qt.io/qt-5/quiloader.html#createWidget">createWidget</a>(), and <a href="http://doc.qt.io/qt-5/quiloader.html#load">load</a>().</p></div>
269 #[inline(always)]
270 pub unsafe fn create_action_group_0a(&self) -> ::qt_core::QPtr<::qt_widgets::QActionGroup> {
271 let ffi_result = {
272 crate::__ffi::ctr_qt_ui_tools_ffi_QUiLoader_createActionGroup2(
273 self as *const crate::QUiLoader as *mut crate::QUiLoader,
274 )
275 };
276 ::qt_core::QPtr::from_raw(ffi_result)
277 }
278
279 /// <p>Creates a new layout with the given <i>parent</i> and <i>name</i> using the class specified by <i>className</i>.</p>
280 ///
281 /// Calls C++ function: <span style='color: green;'>```virtual QLayout* QUiLoader::createLayout(const QString& className, QObject* parent = …, const QString& name = …)```</span>.
282 ///
283 /// <a href="http://doc.qt.io/qt-5/quiloader.html#createLayout">C++ documentation</a>:<div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Creates a new layout with the given <i>parent</i> and <i>name</i> using the class specified by <i>className</i>.</p>
284 /// <p>The function is also used internally by the <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a> class whenever it creates a widget. Hence, you can subclass <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a> and reimplement this function to intervene process of constructing a user interface or widget. However, in your implementation, ensure that you call <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a>'s version first.</p>
285 /// <p><b>See also </b><a href="http://doc.qt.io/qt-5/quiloader.html#createWidget">createWidget</a>() and <a href="http://doc.qt.io/qt-5/quiloader.html#load">load</a>().</p></div>
286 #[inline(always)]
287 pub unsafe fn create_layout_3a(
288 &self,
289 class_name: impl ::cpp_core::CastInto<::cpp_core::Ref<::qt_core::QString>>,
290 parent: impl ::cpp_core::CastInto<::cpp_core::Ptr<::qt_core::QObject>>,
291 name: impl ::cpp_core::CastInto<::cpp_core::Ref<::qt_core::QString>>,
292 ) -> ::qt_core::QPtr<::qt_widgets::QLayout> {
293 let ffi_result = {
294 crate::__ffi::ctr_qt_ui_tools_ffi_QUiLoader_createLayout(
295 self as *const crate::QUiLoader as *mut crate::QUiLoader,
296 ::cpp_core::CastInto::<::cpp_core::Ref<::qt_core::QString>>::cast_into(class_name)
297 .as_raw_ptr(),
298 ::cpp_core::CastInto::<::cpp_core::Ptr<::qt_core::QObject>>::cast_into(parent)
299 .as_raw_ptr() as *mut ::qt_core::QObject,
300 ::cpp_core::CastInto::<::cpp_core::Ref<::qt_core::QString>>::cast_into(name)
301 .as_raw_ptr(),
302 )
303 };
304 ::qt_core::QPtr::from_raw(ffi_result)
305 }
306
307 /// <p>Creates a new layout with the given <i>parent</i> and <i>name</i> using the class specified by <i>className</i>.</p>
308 ///
309 /// Calls C++ function: <span style='color: green;'>```virtual QLayout* QUiLoader::createLayout(const QString& className, QObject* parent = …)```</span>.
310 ///
311 /// <a href="http://doc.qt.io/qt-5/quiloader.html#createLayout">C++ documentation</a>:<div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Creates a new layout with the given <i>parent</i> and <i>name</i> using the class specified by <i>className</i>.</p>
312 /// <p>The function is also used internally by the <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a> class whenever it creates a widget. Hence, you can subclass <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a> and reimplement this function to intervene process of constructing a user interface or widget. However, in your implementation, ensure that you call <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a>'s version first.</p>
313 /// <p><b>See also </b><a href="http://doc.qt.io/qt-5/quiloader.html#createWidget">createWidget</a>() and <a href="http://doc.qt.io/qt-5/quiloader.html#load">load</a>().</p></div>
314 #[inline(always)]
315 pub unsafe fn create_layout_2a(
316 &self,
317 class_name: impl ::cpp_core::CastInto<::cpp_core::Ref<::qt_core::QString>>,
318 parent: impl ::cpp_core::CastInto<::cpp_core::Ptr<::qt_core::QObject>>,
319 ) -> ::qt_core::QPtr<::qt_widgets::QLayout> {
320 let ffi_result = {
321 crate::__ffi::ctr_qt_ui_tools_ffi_QUiLoader_createLayout1(
322 self as *const crate::QUiLoader as *mut crate::QUiLoader,
323 ::cpp_core::CastInto::<::cpp_core::Ref<::qt_core::QString>>::cast_into(class_name)
324 .as_raw_ptr(),
325 ::cpp_core::CastInto::<::cpp_core::Ptr<::qt_core::QObject>>::cast_into(parent)
326 .as_raw_ptr() as *mut ::qt_core::QObject,
327 )
328 };
329 ::qt_core::QPtr::from_raw(ffi_result)
330 }
331
332 /// <p>Creates a new layout with the given <i>parent</i> and <i>name</i> using the class specified by <i>className</i>.</p>
333 ///
334 /// Calls C++ function: <span style='color: green;'>```virtual QLayout* QUiLoader::createLayout(const QString& className)```</span>.
335 ///
336 /// <a href="http://doc.qt.io/qt-5/quiloader.html#createLayout">C++ documentation</a>:<div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Creates a new layout with the given <i>parent</i> and <i>name</i> using the class specified by <i>className</i>.</p>
337 /// <p>The function is also used internally by the <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a> class whenever it creates a widget. Hence, you can subclass <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a> and reimplement this function to intervene process of constructing a user interface or widget. However, in your implementation, ensure that you call <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a>'s version first.</p>
338 /// <p><b>See also </b><a href="http://doc.qt.io/qt-5/quiloader.html#createWidget">createWidget</a>() and <a href="http://doc.qt.io/qt-5/quiloader.html#load">load</a>().</p></div>
339 #[inline(always)]
340 pub unsafe fn create_layout_1a(
341 &self,
342 class_name: impl ::cpp_core::CastInto<::cpp_core::Ref<::qt_core::QString>>,
343 ) -> ::qt_core::QPtr<::qt_widgets::QLayout> {
344 let ffi_result = {
345 crate::__ffi::ctr_qt_ui_tools_ffi_QUiLoader_createLayout2(
346 self as *const crate::QUiLoader as *mut crate::QUiLoader,
347 ::cpp_core::CastInto::<::cpp_core::Ref<::qt_core::QString>>::cast_into(class_name)
348 .as_raw_ptr(),
349 )
350 };
351 ::qt_core::QPtr::from_raw(ffi_result)
352 }
353
354 /// <p>Creates a new widget with the given <i>parent</i> and <i>name</i> using the class specified by <i>className</i>. You can use this function to create any of the widgets returned by the <a href="http://doc.qt.io/qt-5/quiloader.html#availableWidgets">availableWidgets</a>() function.</p>
355 ///
356 /// Calls C++ function: <span style='color: green;'>```virtual QWidget* QUiLoader::createWidget(const QString& className, QWidget* parent = …, const QString& name = …)```</span>.
357 ///
358 /// <a href="http://doc.qt.io/qt-5/quiloader.html#createWidget">C++ documentation</a>:<div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Creates a new widget with the given <i>parent</i> and <i>name</i> using the class specified by <i>className</i>. You can use this function to create any of the widgets returned by the <a href="http://doc.qt.io/qt-5/quiloader.html#availableWidgets">availableWidgets</a>() function.</p>
359 /// <p>The function is also used internally by the <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a> class whenever it creates a widget. Hence, you can subclass <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a> and reimplement this function to intervene process of constructing a user interface or widget. However, in your implementation, ensure that you call <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a>'s version first.</p>
360 /// <p><b>See also </b><a href="http://doc.qt.io/qt-5/quiloader.html#availableWidgets">availableWidgets</a>() and <a href="http://doc.qt.io/qt-5/quiloader.html#load">load</a>().</p></div>
361 #[inline(always)]
362 pub unsafe fn create_widget_3a(
363 &self,
364 class_name: impl ::cpp_core::CastInto<::cpp_core::Ref<::qt_core::QString>>,
365 parent: impl ::cpp_core::CastInto<::cpp_core::Ptr<::qt_widgets::QWidget>>,
366 name: impl ::cpp_core::CastInto<::cpp_core::Ref<::qt_core::QString>>,
367 ) -> ::qt_core::QPtr<::qt_widgets::QWidget> {
368 let ffi_result = {
369 crate::__ffi::ctr_qt_ui_tools_ffi_QUiLoader_createWidget(
370 self as *const crate::QUiLoader as *mut crate::QUiLoader,
371 ::cpp_core::CastInto::<::cpp_core::Ref<::qt_core::QString>>::cast_into(class_name)
372 .as_raw_ptr(),
373 ::cpp_core::CastInto::<::cpp_core::Ptr<::qt_widgets::QWidget>>::cast_into(parent)
374 .as_raw_ptr() as *mut ::qt_widgets::QWidget,
375 ::cpp_core::CastInto::<::cpp_core::Ref<::qt_core::QString>>::cast_into(name)
376 .as_raw_ptr(),
377 )
378 };
379 ::qt_core::QPtr::from_raw(ffi_result)
380 }
381
382 /// <p>Creates a new widget with the given <i>parent</i> and <i>name</i> using the class specified by <i>className</i>. You can use this function to create any of the widgets returned by the <a href="http://doc.qt.io/qt-5/quiloader.html#availableWidgets">availableWidgets</a>() function.</p>
383 ///
384 /// Calls C++ function: <span style='color: green;'>```virtual QWidget* QUiLoader::createWidget(const QString& className, QWidget* parent = …)```</span>.
385 ///
386 /// <a href="http://doc.qt.io/qt-5/quiloader.html#createWidget">C++ documentation</a>:<div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Creates a new widget with the given <i>parent</i> and <i>name</i> using the class specified by <i>className</i>. You can use this function to create any of the widgets returned by the <a href="http://doc.qt.io/qt-5/quiloader.html#availableWidgets">availableWidgets</a>() function.</p>
387 /// <p>The function is also used internally by the <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a> class whenever it creates a widget. Hence, you can subclass <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a> and reimplement this function to intervene process of constructing a user interface or widget. However, in your implementation, ensure that you call <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a>'s version first.</p>
388 /// <p><b>See also </b><a href="http://doc.qt.io/qt-5/quiloader.html#availableWidgets">availableWidgets</a>() and <a href="http://doc.qt.io/qt-5/quiloader.html#load">load</a>().</p></div>
389 #[inline(always)]
390 pub unsafe fn create_widget_2a(
391 &self,
392 class_name: impl ::cpp_core::CastInto<::cpp_core::Ref<::qt_core::QString>>,
393 parent: impl ::cpp_core::CastInto<::cpp_core::Ptr<::qt_widgets::QWidget>>,
394 ) -> ::qt_core::QPtr<::qt_widgets::QWidget> {
395 let ffi_result = {
396 crate::__ffi::ctr_qt_ui_tools_ffi_QUiLoader_createWidget1(
397 self as *const crate::QUiLoader as *mut crate::QUiLoader,
398 ::cpp_core::CastInto::<::cpp_core::Ref<::qt_core::QString>>::cast_into(class_name)
399 .as_raw_ptr(),
400 ::cpp_core::CastInto::<::cpp_core::Ptr<::qt_widgets::QWidget>>::cast_into(parent)
401 .as_raw_ptr() as *mut ::qt_widgets::QWidget,
402 )
403 };
404 ::qt_core::QPtr::from_raw(ffi_result)
405 }
406
407 /// <p>Creates a new widget with the given <i>parent</i> and <i>name</i> using the class specified by <i>className</i>. You can use this function to create any of the widgets returned by the <a href="http://doc.qt.io/qt-5/quiloader.html#availableWidgets">availableWidgets</a>() function.</p>
408 ///
409 /// Calls C++ function: <span style='color: green;'>```virtual QWidget* QUiLoader::createWidget(const QString& className)```</span>.
410 ///
411 /// <a href="http://doc.qt.io/qt-5/quiloader.html#createWidget">C++ documentation</a>:<div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Creates a new widget with the given <i>parent</i> and <i>name</i> using the class specified by <i>className</i>. You can use this function to create any of the widgets returned by the <a href="http://doc.qt.io/qt-5/quiloader.html#availableWidgets">availableWidgets</a>() function.</p>
412 /// <p>The function is also used internally by the <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a> class whenever it creates a widget. Hence, you can subclass <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a> and reimplement this function to intervene process of constructing a user interface or widget. However, in your implementation, ensure that you call <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a>'s version first.</p>
413 /// <p><b>See also </b><a href="http://doc.qt.io/qt-5/quiloader.html#availableWidgets">availableWidgets</a>() and <a href="http://doc.qt.io/qt-5/quiloader.html#load">load</a>().</p></div>
414 #[inline(always)]
415 pub unsafe fn create_widget_1a(
416 &self,
417 class_name: impl ::cpp_core::CastInto<::cpp_core::Ref<::qt_core::QString>>,
418 ) -> ::qt_core::QPtr<::qt_widgets::QWidget> {
419 let ffi_result = {
420 crate::__ffi::ctr_qt_ui_tools_ffi_QUiLoader_createWidget2(
421 self as *const crate::QUiLoader as *mut crate::QUiLoader,
422 ::cpp_core::CastInto::<::cpp_core::Ref<::qt_core::QString>>::cast_into(class_name)
423 .as_raw_ptr(),
424 )
425 };
426 ::qt_core::QPtr::from_raw(ffi_result)
427 }
428
429 /// <p>Returns a human-readable description of the last error occurred in <a href="http://doc.qt.io/qt-5/quiloader.html#load">load</a>().</p>
430 ///
431 /// Calls C++ function: <span style='color: green;'>```QString QUiLoader::errorString() const```</span>.
432 ///
433 /// <a href="http://doc.qt.io/qt-5/quiloader.html#errorString">C++ documentation</a>:<div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns a human-readable description of the last error occurred in <a href="http://doc.qt.io/qt-5/quiloader.html#load">load</a>().</p>
434 /// <p>This function was introduced in Qt 5.0.</p>
435 /// <p><b>See also </b><a href="http://doc.qt.io/qt-5/quiloader.html#load">load</a>().</p></div>
436 #[inline(always)]
437 pub unsafe fn error_string(&self) -> ::cpp_core::CppBox<::qt_core::QString> {
438 let ffi_result = {
439 crate::__ffi::ctr_qt_ui_tools_ffi_QUiLoader_errorString(self as *const crate::QUiLoader)
440 };
441 ::cpp_core::CppBox::from_raw(ffi_result).expect("attempted to construct a null CppBox")
442 }
443
444 /// <p>Returns true if dynamic retranslation on language change is enabled; returns false otherwise.</p>
445 ///
446 /// Calls C++ function: <span style='color: green;'>```bool QUiLoader::isLanguageChangeEnabled() const```</span>.
447 ///
448 /// <a href="http://doc.qt.io/qt-5/quiloader.html#isLanguageChangeEnabled">C++ documentation</a>:<div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns true if dynamic retranslation on language change is enabled; returns false otherwise.</p>
449 /// <p>This function was introduced in Qt 4.5.</p>
450 /// <p><b>See also </b><a href="http://doc.qt.io/qt-5/quiloader.html#setLanguageChangeEnabled">setLanguageChangeEnabled</a>().</p></div>
451 #[inline(always)]
452 pub unsafe fn is_language_change_enabled(&self) -> bool {
453 crate::__ffi::ctr_qt_ui_tools_ffi_QUiLoader_isLanguageChangeEnabled(
454 self as *const crate::QUiLoader,
455 )
456 }
457
458 /// Calls C++ function: <span style='color: green;'>```bool QUiLoader::isTranslationEnabled() const```</span>.
459 #[inline(always)]
460 pub unsafe fn is_translation_enabled(&self) -> bool {
461 crate::__ffi::ctr_qt_ui_tools_ffi_QUiLoader_isTranslationEnabled(
462 self as *const crate::QUiLoader,
463 )
464 }
465
466 /// <p>Loads a form from the given <i>device</i> and creates a new widget with the given <i>parentWidget</i> to hold its contents.</p>
467 ///
468 /// Calls C++ function: <span style='color: green;'>```QWidget* QUiLoader::load(QIODevice* device, QWidget* parentWidget = …)```</span>.
469 ///
470 /// <a href="http://doc.qt.io/qt-5/quiloader.html#load">C++ documentation</a>:<div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Loads a form from the given <i>device</i> and creates a new widget with the given <i>parentWidget</i> to hold its contents.</p>
471 /// <p><b>See also </b><a href="http://doc.qt.io/qt-5/quiloader.html#createWidget">createWidget</a>() and <a href="http://doc.qt.io/qt-5/quiloader.html#errorString">errorString</a>().</p></div>
472 #[inline(always)]
473 pub unsafe fn load_2a(
474 &self,
475 device: impl ::cpp_core::CastInto<::cpp_core::Ptr<::qt_core::QIODevice>>,
476 parent_widget: impl ::cpp_core::CastInto<::cpp_core::Ptr<::qt_widgets::QWidget>>,
477 ) -> ::qt_core::QPtr<::qt_widgets::QWidget> {
478 let ffi_result = {
479 crate::__ffi::ctr_qt_ui_tools_ffi_QUiLoader_load(
480 self as *const crate::QUiLoader as *mut crate::QUiLoader,
481 ::cpp_core::CastInto::<::cpp_core::Ptr<::qt_core::QIODevice>>::cast_into(device)
482 .as_raw_ptr() as *mut ::qt_core::QIODevice,
483 ::cpp_core::CastInto::<::cpp_core::Ptr<::qt_widgets::QWidget>>::cast_into(
484 parent_widget,
485 )
486 .as_raw_ptr() as *mut ::qt_widgets::QWidget,
487 )
488 };
489 ::qt_core::QPtr::from_raw(ffi_result)
490 }
491
492 /// <p>Loads a form from the given <i>device</i> and creates a new widget with the given <i>parentWidget</i> to hold its contents.</p>
493 ///
494 /// Calls C++ function: <span style='color: green;'>```QWidget* QUiLoader::load(QIODevice* device)```</span>.
495 ///
496 /// <a href="http://doc.qt.io/qt-5/quiloader.html#load">C++ documentation</a>:<div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Loads a form from the given <i>device</i> and creates a new widget with the given <i>parentWidget</i> to hold its contents.</p>
497 /// <p><b>See also </b><a href="http://doc.qt.io/qt-5/quiloader.html#createWidget">createWidget</a>() and <a href="http://doc.qt.io/qt-5/quiloader.html#errorString">errorString</a>().</p></div>
498 #[inline(always)]
499 pub unsafe fn load_1a(
500 &self,
501 device: impl ::cpp_core::CastInto<::cpp_core::Ptr<::qt_core::QIODevice>>,
502 ) -> ::qt_core::QPtr<::qt_widgets::QWidget> {
503 let ffi_result = {
504 crate::__ffi::ctr_qt_ui_tools_ffi_QUiLoader_load1(
505 self as *const crate::QUiLoader as *mut crate::QUiLoader,
506 ::cpp_core::CastInto::<::cpp_core::Ptr<::qt_core::QIODevice>>::cast_into(device)
507 .as_raw_ptr() as *mut ::qt_core::QIODevice,
508 )
509 };
510 ::qt_core::QPtr::from_raw(ffi_result)
511 }
512
513 /// Calls C++ function: <span style='color: green;'>```virtual const QMetaObject* QUiLoader::metaObject() const```</span>.
514 #[inline(always)]
515 pub unsafe fn meta_object(&self) -> ::cpp_core::Ptr<::qt_core::QMetaObject> {
516 let ffi_result = {
517 crate::__ffi::ctr_qt_ui_tools_ffi_QUiLoader_metaObject(self as *const crate::QUiLoader)
518 };
519 ::cpp_core::Ptr::from_raw(ffi_result as *mut ::qt_core::QMetaObject)
520 }
521
522 /// <p>Creates a form loader with the given <i>parent</i>.</p>
523 ///
524 /// Calls C++ function: <span style='color: green;'>```[constructor] void QUiLoader::QUiLoader(QObject* parent = …)```</span>.
525 ///
526 /// <a href="http://doc.qt.io/qt-5/quiloader.html#QUiLoader">C++ documentation</a>:<div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Creates a form loader with the given <i>parent</i>.</p></div>
527 #[inline(always)]
528 pub unsafe fn new_1a(
529 parent: impl ::cpp_core::CastInto<::cpp_core::Ptr<::qt_core::QObject>>,
530 ) -> ::qt_core::QBox<crate::QUiLoader> {
531 let ffi_result = {
532 crate::__ffi::ctr_qt_ui_tools_ffi_QUiLoader_QUiLoader(
533 ::cpp_core::CastInto::<::cpp_core::Ptr<::qt_core::QObject>>::cast_into(parent)
534 .as_raw_ptr() as *mut ::qt_core::QObject,
535 )
536 };
537 ::qt_core::QBox::from_raw(ffi_result)
538 }
539
540 /// <p>The <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a> class enables standalone applications to dynamically create user interfaces at run-time using the information stored in UI files or specified in plugin paths.</p>
541 ///
542 /// Calls C++ function: <span style='color: green;'>```[constructor] void QUiLoader::QUiLoader()```</span>.
543 ///
544 /// <a href="http://doc.qt.io/qt-5/quiloader.html">C++ documentation</a>:<div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>The <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a> class enables standalone applications to dynamically create user interfaces at run-time using the information stored in UI files or specified in plugin paths.</p>
545 /// <p>In addition, you can customize or create your own user interface by deriving your own loader class.</p>
546 /// <p>If you have a custom component or an application that embeds <i>Qt Designer</i>, you can also use the <a href="http://doc.qt.io/qt-5/qformbuilder.html">QFormBuilder</a> class provided by the <a href="http://doc.qt.io/qt-5/qtdesigner-module.html">QtDesigner</a> module to create user interfaces from UI files.</p>
547 /// <p>The <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a> class provides a collection of functions allowing you to create widgets based on the information stored in UI files (created with <i>Qt Designer</i>) or available in the specified plugin paths. The specified plugin paths can be retrieved using the <a href="http://doc.qt.io/qt-5/quiloader.html#pluginPaths">pluginPaths</a>() function. Similarly, the contents of a UI file can be retrieved using the <a href="http://doc.qt.io/qt-5/quiloader.html#load">load</a>() function. For example:</p>
548 /// <pre class="cpp">
549 ///
550 /// MyWidget<span class="operator">::</span>MyWidget(<span class="type"><a href="http://doc.qt.io/qt-5/qwidget.html">QWidget</a></span> <span class="operator">*</span>parent)
551 ///   : <span class="type"><a href="http://doc.qt.io/qt-5/qwidget.html">QWidget</a></span>(parent)
552 /// {
553 ///   <span class="type"><a href="http://doc.qt.io/qt-5/quiloader.html#QUiLoader">QUiLoader</a></span> loader;
554 ///   <span class="type"><a href="http://doc.qt.io/qt-5/qfile.html">QFile</a></span> file(<span class="string">":/forms/myform.ui"</span>);
555 ///   file<span class="operator">.</span>open(<span class="type"><a href="http://doc.qt.io/qt-5/qfile.html">QFile</a></span><span class="operator">::</span>ReadOnly);
556 ///   <span class="type"><a href="http://doc.qt.io/qt-5/qwidget.html">QWidget</a></span> <span class="operator">*</span>myWidget <span class="operator">=</span> loader<span class="operator">.</span>load(<span class="operator">&</span>file<span class="operator">,</span> <span class="keyword">this</span>);
557 ///   file<span class="operator">.</span>close();
558 ///
559 ///   <span class="type"><a href="http://doc.qt.io/qt-5/qvboxlayout.html">QVBoxLayout</a></span> <span class="operator">*</span>layout <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="http://doc.qt.io/qt-5/qvboxlayout.html">QVBoxLayout</a></span>;
560 ///   layout<span class="operator">-</span><span class="operator">></span>addWidget(myWidget);
561 ///   setLayout(layout);
562 /// }
563 ///
564 /// </pre>
565 /// <p>By including the user interface in the form's resources (<code>myform.qrc</code>), we ensure that it will be present at run-time:</p>
566 /// <pre class="cpp">
567 ///
568 /// <!DOCTYPE RCC><RCC version="1.0">
569 /// <qresource prefix="/forms">
570 /// <file>myform.ui</file>
571 /// </qresource>
572 /// </RCC>
573 ///
574 /// </pre>
575 /// <p>The <a href="http://doc.qt.io/qt-5/quiloader.html#availableWidgets">availableWidgets</a>() function returns a <a href="http://doc.qt.io/qt-5/qstringlist.html">QStringList</a> with the class names of the widgets available in the specified plugin paths. To create these widgets, simply use the <a href="http://doc.qt.io/qt-5/quiloader.html#createWidget">createWidget</a>() function. For example:</p>
576 /// <pre class="cpp">
577 ///
578 /// <span class="type"><a href="http://doc.qt.io/qt-5/qwidget.html">QWidget</a></span> <span class="operator">*</span>loadCustomWidget(<span class="type"><a href="http://doc.qt.io/qt-5/qwidget.html">QWidget</a></span> <span class="operator">*</span>parent)
579 /// {
580 ///   <span class="type"><a href="http://doc.qt.io/qt-5/quiloader.html#QUiLoader">QUiLoader</a></span> loader;
581 ///   <span class="type"><a href="http://doc.qt.io/qt-5/qwidget.html">QWidget</a></span> <span class="operator">*</span>myWidget;
582 ///
583 ///   <span class="type"><a href="http://doc.qt.io/qt-5/qstringlist.html">QStringList</a></span> availableWidgets <span class="operator">=</span> loader<span class="operator">.</span>availableWidgets();
584 ///
585 ///   <span class="keyword">if</span> (availableWidgets<span class="operator">.</span>contains(<span class="string">"AnalogClock"</span>))
586 ///     myWidget <span class="operator">=</span> loader<span class="operator">.</span>createWidget(<span class="string">"AnalogClock"</span><span class="operator">,</span> parent);
587 ///
588 ///   <span class="keyword">return</span> myWidget;
589 /// }
590 ///
591 /// </pre>
592 /// <p>To make a custom widget available to the loader, you can use the <a href="http://doc.qt.io/qt-5/quiloader.html#addPluginPath">addPluginPath</a>() function; to remove all available widgets, you can call the <a href="http://doc.qt.io/qt-5/quiloader.html#clearPluginPaths">clearPluginPaths</a>() function.</p>
593 /// <p>The <a href="http://doc.qt.io/qt-5/quiloader.html#createAction">createAction</a>(), <a href="http://doc.qt.io/qt-5/quiloader.html#createActionGroup">createActionGroup</a>(), <a href="http://doc.qt.io/qt-5/quiloader.html#createLayout">createLayout</a>(), and <a href="http://doc.qt.io/qt-5/quiloader.html#createWidget">createWidget</a>() functions are used internally by the <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a> class whenever it has to create an action, action group, layout, or widget respectively. For that reason, you can subclass the <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a> class and reimplement these functions to intervene the process of constructing a user interface. For example, you might want to have a list of the actions created when loading a form or creating a custom widget.</p>
594 /// <p>For a complete example using the <a href="http://doc.qt.io/qt-5/quiloader.html">QUiLoader</a> class, see the <a href="http://doc.qt.io/qt-5/qtdesigner-calculatorbuilder-example.html">Calculator Builder Example</a>.</p></div>
595 #[inline(always)]
596 pub unsafe fn new_0a() -> ::qt_core::QBox<crate::QUiLoader> {
597 let ffi_result = { crate::__ffi::ctr_qt_ui_tools_ffi_QUiLoader_QUiLoader1() };
598 ::qt_core::QBox::from_raw(ffi_result)
599 }
600
601 /// <p>Returns a list naming the paths in which the loader will search when locating custom widget plugins.</p>
602 ///
603 /// Calls C++ function: <span style='color: green;'>```QStringList QUiLoader::pluginPaths() const```</span>.
604 ///
605 /// <a href="http://doc.qt.io/qt-5/quiloader.html#pluginPaths">C++ documentation</a>:<div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns a list naming the paths in which the loader will search when locating custom widget plugins.</p>
606 /// <p><b>See also </b><a href="http://doc.qt.io/qt-5/quiloader.html#addPluginPath">addPluginPath</a>() and <a href="http://doc.qt.io/qt-5/quiloader.html#clearPluginPaths">clearPluginPaths</a>().</p></div>
607 #[inline(always)]
608 pub unsafe fn plugin_paths(&self) -> ::cpp_core::CppBox<::qt_core::QStringList> {
609 let ffi_result = {
610 crate::__ffi::ctr_qt_ui_tools_ffi_QUiLoader_pluginPaths(self as *const crate::QUiLoader)
611 };
612 ::cpp_core::CppBox::from_raw(ffi_result).expect("attempted to construct a null CppBox")
613 }
614
615 /// Calls C++ function: <span style='color: green;'>```virtual int QUiLoader::qt_metacall(QMetaObject::Call arg1, int arg2, void** arg3)```</span>.
616 #[inline(always)]
617 pub unsafe fn qt_metacall(
618 &self,
619 arg1: ::qt_core::q_meta_object::Call,
620 arg2: ::std::os::raw::c_int,
621 arg3: *mut *mut ::std::ffi::c_void,
622 ) -> ::std::os::raw::c_int {
623 crate::__ffi::ctr_qt_ui_tools_ffi_QUiLoader_qt_metacall(
624 self as *const crate::QUiLoader as *mut crate::QUiLoader,
625 arg1,
626 arg2,
627 arg3,
628 )
629 }
630
631 /// Calls C++ function: <span style='color: green;'>```virtual void* QUiLoader::qt_metacast(const char* arg1)```</span>.
632 #[inline(always)]
633 pub unsafe fn qt_metacast(
634 &self,
635 arg1: *const ::std::os::raw::c_char,
636 ) -> *mut ::std::ffi::c_void {
637 crate::__ffi::ctr_qt_ui_tools_ffi_QUiLoader_qt_metacast(
638 self as *const crate::QUiLoader as *mut crate::QUiLoader,
639 arg1,
640 )
641 }
642
643 /// <p>If <i>enabled</i> is true, user interfaces loaded by this loader will automatically retranslate themselves upon receiving a language change event. Otherwise, the user interfaces will not be retranslated.</p>
644 ///
645 /// Calls C++ function: <span style='color: green;'>```void QUiLoader::setLanguageChangeEnabled(bool enabled)```</span>.
646 ///
647 /// <a href="http://doc.qt.io/qt-5/quiloader.html#setLanguageChangeEnabled">C++ documentation</a>:<div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>If <i>enabled</i> is true, user interfaces loaded by this loader will automatically retranslate themselves upon receiving a language change event. Otherwise, the user interfaces will not be retranslated.</p>
648 /// <p>This function was introduced in Qt 4.5.</p>
649 /// <p><b>See also </b><a href="http://doc.qt.io/qt-5/quiloader.html#isLanguageChangeEnabled">isLanguageChangeEnabled</a>().</p></div>
650 #[inline(always)]
651 pub unsafe fn set_language_change_enabled(&self, enabled: bool) {
652 crate::__ffi::ctr_qt_ui_tools_ffi_QUiLoader_setLanguageChangeEnabled(
653 self as *const crate::QUiLoader as *mut crate::QUiLoader,
654 enabled,
655 )
656 }
657
658 /// Calls C++ function: <span style='color: green;'>```void QUiLoader::setTranslationEnabled(bool enabled)```</span>.
659 #[inline(always)]
660 pub unsafe fn set_translation_enabled(&self, enabled: bool) {
661 crate::__ffi::ctr_qt_ui_tools_ffi_QUiLoader_setTranslationEnabled(
662 self as *const crate::QUiLoader as *mut crate::QUiLoader,
663 enabled,
664 )
665 }
666
667 /// <p>Sets the working directory of the loader to <i>dir</i>. The loader will look for other resources, such as icons and resource files, in paths relative to this directory.</p>
668 ///
669 /// Calls C++ function: <span style='color: green;'>```void QUiLoader::setWorkingDirectory(const QDir& dir)```</span>.
670 ///
671 /// <a href="http://doc.qt.io/qt-5/quiloader.html#setWorkingDirectory">C++ documentation</a>:<div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Sets the working directory of the loader to <i>dir</i>. The loader will look for other resources, such as icons and resource files, in paths relative to this directory.</p>
672 /// <p><b>See also </b><a href="http://doc.qt.io/qt-5/quiloader.html#workingDirectory">workingDirectory</a>().</p></div>
673 #[inline(always)]
674 pub unsafe fn set_working_directory(
675 &self,
676 dir: impl ::cpp_core::CastInto<::cpp_core::Ref<::qt_core::QDir>>,
677 ) {
678 crate::__ffi::ctr_qt_ui_tools_ffi_QUiLoader_setWorkingDirectory(
679 self as *const crate::QUiLoader as *mut crate::QUiLoader,
680 ::cpp_core::CastInto::<::cpp_core::Ref<::qt_core::QDir>>::cast_into(dir).as_raw_ptr(),
681 )
682 }
683
684 /// Returns a reference to the <span style='color: green;'>```staticMetaObject```</span> field.
685 #[inline(always)]
686 pub unsafe fn static_meta_object() -> ::cpp_core::Ref<::qt_core::QMetaObject> {
687 let ffi_result = { crate::__ffi::ctr_qt_ui_tools_ffi_QUiLoader_staticMetaObject() };
688 ::cpp_core::Ref::from_raw(ffi_result as *mut ::qt_core::QMetaObject)
689 .expect("attempted to construct a null Ref")
690 }
691
692 /// Calls C++ function: <span style='color: green;'>```static QString QUiLoader::tr(const char* s, const char* c, int n)```</span>.
693 #[inline(always)]
694 pub unsafe fn tr(
695 s: *const ::std::os::raw::c_char,
696 c: *const ::std::os::raw::c_char,
697 n: ::std::os::raw::c_int,
698 ) -> ::cpp_core::CppBox<::qt_core::QString> {
699 let ffi_result = { crate::__ffi::ctr_qt_ui_tools_ffi_QUiLoader_tr(s, c, n) };
700 ::cpp_core::CppBox::from_raw(ffi_result).expect("attempted to construct a null CppBox")
701 }
702
703 /// Calls C++ function: <span style='color: green;'>```static QString QUiLoader::trUtf8(const char* s, const char* c, int n)```</span>.
704 #[inline(always)]
705 pub unsafe fn tr_utf8(
706 s: *const ::std::os::raw::c_char,
707 c: *const ::std::os::raw::c_char,
708 n: ::std::os::raw::c_int,
709 ) -> ::cpp_core::CppBox<::qt_core::QString> {
710 let ffi_result = { crate::__ffi::ctr_qt_ui_tools_ffi_QUiLoader_trUtf8(s, c, n) };
711 ::cpp_core::CppBox::from_raw(ffi_result).expect("attempted to construct a null CppBox")
712 }
713
714 /// <p>Returns the working directory of the loader.</p>
715 ///
716 /// Calls C++ function: <span style='color: green;'>```QDir QUiLoader::workingDirectory() const```</span>.
717 ///
718 /// <a href="http://doc.qt.io/qt-5/quiloader.html#workingDirectory">C++ documentation</a>:<div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns the working directory of the loader.</p>
719 /// <p><b>See also </b><a href="http://doc.qt.io/qt-5/quiloader.html#setWorkingDirectory">setWorkingDirectory</a>().</p></div>
720 #[inline(always)]
721 pub unsafe fn working_directory(&self) -> ::cpp_core::CppBox<::qt_core::QDir> {
722 let ffi_result = {
723 crate::__ffi::ctr_qt_ui_tools_ffi_QUiLoader_workingDirectory(
724 self as *const crate::QUiLoader,
725 )
726 };
727 ::cpp_core::CppBox::from_raw(ffi_result).expect("attempted to construct a null CppBox")
728 }
729}
730
731impl ::cpp_core::CppDeletable for crate::QUiLoader {
732 /// <p>Destroys the loader.</p>
733 ///
734 /// Calls C++ function: <span style='color: green;'>```virtual [destructor] void QUiLoader::~QUiLoader()```</span>.
735 ///
736 /// <a href="http://doc.qt.io/qt-5/quiloader.html#dtor.QUiLoader">C++ documentation</a>:<div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Destroys the loader.</p></div>
737 #[inline(always)]
738 unsafe fn delete(&self) {
739 crate::__ffi::ctr_qt_ui_tools_ffi_QUiLoader_dQUiLoader(
740 self as *const crate::QUiLoader as *mut crate::QUiLoader,
741 )
742 }
743}
744
745impl ::cpp_core::StaticDowncast<crate::QUiLoader> for ::qt_core::QObject {
746 /// Calls C++ function: <span style='color: green;'>```QUiLoader* static_cast<QUiLoader*>(QObject* ptr)```</span>.
747 #[inline(always)]
748 unsafe fn static_downcast(
749 ptr: ::cpp_core::Ptr<::qt_core::QObject>,
750 ) -> ::cpp_core::Ptr<crate::QUiLoader> {
751 let ffi_result = {
752 crate::__ffi::ctr_qt_ui_tools_ffi_static_cast_QUiLoader_ptr(
753 ptr.as_raw_ptr() as *mut ::qt_core::QObject
754 )
755 };
756 ::cpp_core::Ptr::from_raw(ffi_result)
757 }
758}
759
760impl ::cpp_core::StaticUpcast<::qt_core::QObject> for crate::QUiLoader {
761 /// Calls C++ function: <span style='color: green;'>```QObject* static_cast<QObject*>(QUiLoader* ptr)```</span>.
762 #[inline(always)]
763 unsafe fn static_upcast(
764 ptr: ::cpp_core::Ptr<crate::QUiLoader>,
765 ) -> ::cpp_core::Ptr<::qt_core::QObject> {
766 let ffi_result = {
767 crate::__ffi::ctr_qt_ui_tools_ffi_static_cast_QObject_ptr(
768 ptr.as_raw_ptr() as *mut crate::QUiLoader
769 )
770 };
771 ::cpp_core::Ptr::from_raw(ffi_result)
772 }
773}
774
775impl ::std::ops::Deref for crate::QUiLoader {
776 type Target = ::qt_core::QObject;
777 /// Calls C++ function: <span style='color: green;'>```QObject* static_cast<QObject*>(QUiLoader* ptr)```</span>.
778 #[inline(always)]
779 fn deref(&self) -> &::qt_core::QObject {
780 let ffi_result = {
781 unsafe {
782 crate::__ffi::ctr_qt_ui_tools_ffi_static_cast_QObject_ptr(
783 self as *const crate::QUiLoader as *mut crate::QUiLoader,
784 )
785 }
786 };
787 unsafe { ffi_result.as_ref() }.expect("Attempted to convert null pointer to reference")
788 }
789}
790
791impl ::cpp_core::DynamicCast<crate::QUiLoader> for ::qt_core::QObject {
792 /// Calls C++ function: <span style='color: green;'>```QUiLoader* dynamic_cast<QUiLoader*>(QObject* ptr)```</span>.
793 #[inline(always)]
794 unsafe fn dynamic_cast(
795 ptr: ::cpp_core::Ptr<::qt_core::QObject>,
796 ) -> ::cpp_core::Ptr<crate::QUiLoader> {
797 let ffi_result = {
798 crate::__ffi::ctr_qt_ui_tools_ffi_dynamic_cast_QUiLoader_ptr(
799 ptr.as_raw_ptr() as *mut ::qt_core::QObject
800 )
801 };
802 ::cpp_core::Ptr::from_raw(ffi_result)
803 }
804}