Clear layout content.

    :param layout: A layout.
    :type layout: QLayout
338155
def clear_layout(layout):
    
    # Different platform has different treatment
    # If InaSAFE running on Windows or Linux

    # Adapted from http://stackoverflow.com/a/9383780
    if layout is not None:
        while layout.count():
            item = layout.takeAt(0)
            widget = item.widget()
            if widget is not None:
                # Remove the widget from layout
                widget.close()
                widget.deleteLater()
            else:
                clear_layout(item.layout())

            # Remove the item from layout
            layout.removeItem(item)
            del item
1309249
def clear_widget(self):
        
        if not self.gui_up:
            return
        canvas = self.c_view.get_canvas()
        canvas.delete_all_objects()
        self.c_view.redraw(whence=0)
159340
def remove(self, slide_layout):
        
        # ---raise if layout is in use---
        if slide_layout.used_by_slides:
            raise ValueError('cannot remove slide-layout in use by one or more slides')

        # ---target layout is identified by its index in this collection---
        target_idx = self.index(slide_layout)

        # --remove layout from p:sldLayoutIds of its master
        # --this stops layout from showing up, but doesn't remove it from package
        target_sldLayoutId = self._sldLayoutIdLst.sldLayoutId_lst[target_idx]
        self._sldLayoutIdLst.remove(target_sldLayoutId)

        # --drop relationship from master to layout
        # --this removes layout from package, along with everything (only) it refers to,
        # --including images (not used elsewhere) and hyperlinks
        slide_layout.slide_master.part.drop_rel(target_sldLayoutId.rId)
23255
def unregister_layout(self, name):
        

        if not name in self:
            raise umbra.exceptions.LayoutRegistrationError("{0} | '{1}' layout is not registered!".format(
                self.__class__.__name__, name))

        del (self.__layouts[name])
        return True
174973
public void setVerticalLayout(VerticalLayout layout, boolean addAll) {

        if (m_results.size() > 0) {
            if (addAll) {
                for (CmsResourceTypeStatResult result : m_results) {
                    layout.addComponent(getLayoutFromResult(result), 0);
                }
            } else {
                CmsResourceTypeStatResult statResult = m_results.get(m_results.size() - 1);

                if (m_updated) {
                    removeRow(layout, statResult);
                }
                layout.addComponent(getLayoutFromResult(statResult), 0);
            }
        }
    }
611910
@Override
    public final void clear(LayoutManagerHelper helper) {
        // remove LayoutViews if there is one
        if (mLayoutView != null) {
            if (mLayoutViewUnBindListener != null) {
                mLayoutViewUnBindListener.onUnbind(mLayoutView, this);
            }
            helper.removeChildView(mLayoutView);
            mLayoutView = null;
        }

        // call user defined
        onClear(helper);
    }
1041949
public static void saveLayout(Layout layout, LayoutIdentifier layoutId, boolean hideScope,
                                  IResponseCallback<LayoutIdentifier> callback) {
        LayoutPrompt.show(layoutId, hideScope, true, CAP_LAYOUT_SAVE, MSG_LAYOUT_SAVE, (event) -> {
            LayoutIdentifier id = event.getTarget().getAttribute("layoutId", LayoutIdentifier.class);
            
            if (id != null) {
                layout.saveToProperty(id);
                
                if (callback != null) {
                    callback.onComplete(id);
                }
            }
            
        }
299654
def remake_display(self, *args):
        
        Builder.load_string(self.kv)
        if hasattr(self, '_kv_layout'):
            self.remove_widget(self._kv_layout)
            del self._kv_layout
        self._kv_layout = KvLayout()
        self.add_widget(self._kv_layout)
1361602
def child_removed(self, child):
        
        layout = self.layout
        if child.widget is not None:
            layout.removeArrangedSubview(child.widget)
            layout.removeSubview(child.widget)
790588
public void clearButtonsLeft() {

        m_itemsLeft.removeAllComponents();
        m_leftButtons.removeAllComponents();
        // in case the app title is set, make sure to keep the label in the button bar
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_appIndicator.getValue())) {
            m_itemsLeft.addComponent(m_appIndicator);
        }
        updateFoldingThreshhold();
    }
175418
def clear_document(self):
        
        self._components.clear()
        self._sequences.clear()
        self._namespaces.clear()
        self._models.clear()
        self._modules.clear()
        self._collections.clear()
        self._annotations.clear()
        self._functional_component_store.clear()
        self._collection_store.clear()
226890
def clearFilter(self):
        
        if self._dataFrameOriginal is not None:
            self.layoutAboutToBeChanged.emit()
            self._dataFrame = self._dataFrameOriginal
            self._dataFrameOriginal = None
            self.layoutChanged.emit()
527050
def reset_window_layout(self):
        """"""
        answer = QMessageBox.warning(self, _("Warning"),
                     _("Window layout will be reset to default settings: "
                       "this affects window position, size and dockwidgets.\n"
                       "Do you want to continue?"),
                     QMessageBox.Yes | QMessageBox.No)
        if answer == QMessageBox.Yes:
            self.setup_layout(default=True)
867097
def forget(element_id)
      unless is_parent_layout?
        return parent_layout.remove(element_id)
      end
      removed = nil
      context(self.view) do
        removed = all(element_id)
        @elements[element_id] = nil
      end
      removed
    end
733046
def setLayout(self, value):
        
        new_layout = sorted(value, key=lambda k: k['position'])
        self.getField('Layout').set(self, new_layout)
304185
def clear( self ):
        
        self.uiQueryTXT.setText('')
        self.uiQueryTREE.clear()
        self.uiGroupingTXT.setText('')
        self.uiSortingTXT.setText('')
163735
def init_layout(self):
        
        super(AndroidToast, self).init_layout()
        if not self.made_toast:
            for view in self.child_widgets():
                self.toast.setView(view)
                break