19 std::function<
void()> slot)
21 auto* removeAction =
new QAction(parent);
22 removeAction->setText(
"Remove");
23 removeAction->setIcon(QIcon(
":/images/delete.svg"));
24 removeAction->setIconText(
"Remove");
25 removeAction->setToolTip(
"Remove " + what);
28 QObject::connect(removeAction, &QAction::triggered, slot);
34 std::function<
void()> slot)
36 auto* action =
new QAction(parent);
37 action->setText(
"Show in Real Space (3D) view");
38 action->setIcon(QIcon(
":/SampleDesigner/images/rotate-3d.svg"));
39 action->setIconText(
"3D");
40 action->setToolTip(
"Show " + what +
" in Real Space (3D) view");
43 QObject::connect(action, &QAction::triggered, slot);
50 auto* action =
new QAction(parent);
51 action->setText(
"Properties");
52 action->setIcon(QIcon(
":/images/dock-right.svg"));
53 action->setToolTip(
"Toggle properties panel");
54 action->setCheckable(
true);
57 QObject::connect(action, &QAction::triggered, toggledWidget, &QWidget::setVisible);
Defines class ActionFactory.
static QAction * createShowInRealSpaceAction(QObject *parent, const QString &what, std::function< void()> slot=nullptr)
Create "show in RealSpace" action.
static QAction * createRemoveAction(QObject *parent, const QString &what, std::function< void()> slot=nullptr)
Create "remove" action.
static QAction * createTogglePropertiesPanelAction(QObject *parent, QWidget *toggledWidget=nullptr)
Create "toggle properties panel" action.