Example #1
0
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);
}
Example #2
0
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);
}
Example #3
0
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;
}
Example #4
0
void QWidgetProto::insertAction(QAction *before, QAction *action)
{
  QWidget *item = qscriptvalue_cast<QWidget*>(thisObject());
  if (item)
    item->insertAction(before, action);
}