void FormWindowBase::deleteWidgetList(const QWidgetList &widget_list){ // We need a macro here even for single widgets because the some components (for example, // the signal slot editor are connected to widgetRemoved() and add their // own commands (for example, to delete w's connections) const QString description = widget_list.size() == 1 ? tr("Delete '%1'").arg(widget_list.front()->objectName()) : tr("Delete"); commandHistory()->beginMacro(description); foreach (QWidget *w, widget_list) { emit widgetRemoved(w); DeleteWidgetCommand *cmd = new DeleteWidgetCommand(this); cmd->init(w); commandHistory()->push(cmd); } commandHistory()->endMacro();}