You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes it is nice to be able to replace a widget in a layout.
Change-Id: I23a6a65e417e94d53bc48639503db1a142bc3f10
Reviewed-by: J-P Nurmi <[email protected]>
Copy file name to clipboardexpand all lines: src/widgets/kernel/qlayout.cpp
+48
Original file line number
Diff line number
Diff line change
@@ -1108,6 +1108,54 @@ bool QLayout::activate()
1108
1108
returntrue;
1109
1109
}
1110
1110
1111
+
/*!
1112
+
\since 5.2
1113
+
1114
+
Searches for widget \a from and replaces it with widget \a to if found.
1115
+
Returns the layout item that contains the widget \a from on success. Otherwise \c 0 is returned.
1116
+
If \a recursive is \c true, sub-layouts are searched for doing the replacement. Notice that the returned item therefore might not belong to this layout, but to a sub-layout.
1117
+
1118
+
The returned layout item is no longer owned by the layout and should be either deleted or inserted to another layout. The widget \a from is no longer managed by the layout and may need to be deleted or hidden. The parent of widget \a from is left unchanged.
1119
+
1120
+
This function works for the built-in Qt layouts, but might not work for custom layouts.
0 commit comments