void Action::addActionBefore(QAction *action) { QWidget *w = parentMenu(); QF_ASSERT(w!=nullptr, "bad parent", return); //qfInfo() << w << this << action; action->setParent(w); w->insertAction(this, action); }
void Action::addSeparatorBefore() { QWidget *w = parentMenu(); QF_ASSERT(w!=nullptr, "bad parent", return); Action *a = new Action(w); a->setSeparator(true); w->insertAction(this, a); }
Action* Action::addSeparatorBefore(const QString &id) { QWidget *w = parentMenu(); QF_ASSERT(w != nullptr, "bad parent", return nullptr); Action *a = new Action(w); a->setObjectName(id); a->setSeparator(true); w->insertAction(this, a); return a; }
void QWidgetProto::insertAction(QAction *before, QAction *action) { QWidget *item = qscriptvalue_cast<QWidget*>(thisObject()); if (item) item->insertAction(before, action); }