///
/// Searches for widget *from* and replaces it with widget *to* if found.
/// Returns the layout item that contains the widget *from* on success.
/// Otherwise `0` is returned. If *options* contains `Qt::FindChildrenRecursively`
/// (the default), sub-layouts are searched for doing the replacement.
/// Any other flag in *options* is ignored.
///
/// Notice that the returned item therefore might not belong to this layout,
/// but to a sub-layout.
///
/// The returned layout item is no longer owned by the layout and should be
/// either deleted or inserted to another layout. The widget *from* is no
/// longer managed by the layout and may need to be deleted or hidden. The
/// parent of widget *from* is left unchanged.
///
/// This function works for the built-in Qt layouts, but might not work for
/// custom layouts.
///
/// **See also:** [`index_of()`]
Searches for widget *from* and replaces it with widget *to* if found.
Returns the layout item that contains the widget *from* on success.
Otherwise `0` is returned. If *options* contains `Qt::FindChildrenRecursively`
(the default), sub-layouts are searched for doing the replacement.
Any other flag in *options* is ignored.

Notice that the returned item therefore might not belong to this layout,
but to a sub-layout.

The returned layout item is no longer owned by the layout and should be
either deleted or inserted to another layout. The widget *from* is no
longer managed by the layout and may need to be deleted or hidden. The
parent of widget *from* is left unchanged.

This function works for the built-in Qt layouts, but might not work for
custom layouts.


Searches for widget * from * and replaces it with widget * to * if found . Returns the layout item that contains the widget * from * on success . Otherwise ` 0 ` is returned . If * options * contains ` Qt :: FindChildrenRecursively ` ( the default ) sub - layouts are searched for doing the replacement . Any other flag in * options * is ignored . Notice that the returned item therefore might not belong to this layout but to a sub - layout . The returned layout item is no longer owned by the layout and should be either deleted or inserted to another layout . The widget * from * is no longer managed by the layout and may need to be deleted or hidden . The parent of widget * from * is left unchanged . This function works for the built - in Qt layouts but might not work for custom layouts .
pub fn replace_widget<W: WidgetTrait<'a>>(
        &self,
        from: &W,
        to: &W,
        options: FindChildOptions,
    ) -> Option<LayoutItem> {
        let (obj_from_1, _funcs) = from.get_widget_obj_funcs();
        let (obj_to_2, _funcs) = to.get_widget_obj_funcs();
        let enum_options_3 = options.bits();
        let (obj_data, funcs) = self.get_layout_obj_funcs();
        unsafe {
            let ret_val = ((*funcs).replace_widget)(obj_data, obj_from_1, obj_to_2, enum_options_3);
            if ret_val.qt_data == ::std::ptr::null() {
                return None;
            }
            let t = ret_val;
            let ret_val;
            if t.host_data != ::std::ptr::null() {
                ret_val = LayoutItem::new_from_rc(t);
            } else {
                ret_val = LayoutItem::new_from_owned(t);
            }
            Some(ret_val)
        }
    }
pub fn replace_widget < W : WidgetTrait < ' a > > ( & self , from : & W , to : & W , options : FindChildOptions , ) -> Option < LayoutItem > { let ( obj_from_1 , _funcs ) = from . get_widget_obj_funcs ( ) ; let ( obj_to_2 , _funcs ) = to . get_widget_obj_funcs ( ) ; let enum_options_3 = options . bits ( ) ; let ( obj_data , funcs ) = self . get_layout_obj_funcs ( ) ; unsafe { let ret_val = ( ( * funcs ) . replace_widget ) ( obj_data , obj_from_1 , obj_to_2 , enum_options_3 ) ; if ret_val . qt_data == :: std :: ptr :: null ( ) { return None ; } let t = ret_val ; let ret_val ; if t . host_data != :: std :: ptr :: null ( ) { ret_val = LayoutItem :: new_from_rc ( t ) ; } else { ret_val = LayoutItem :: new_from_owned ( t ) ; } Some ( ret_val ) } }
Searches for widget *from* and replaces it with widget *to* if found.
Searches for widget * from * and replaces it with widget * to * if found .
&self
from
&W
to
&W
options
FindChildOptions